Post by talab123 » Sun May 05, 2019 1:54 am

Dears,
For version 3.0.3.1... I want to disable the language dropdown list to make one or two buttons, or any other one-click option.
Thanks in advance

Newbie

Posts

Joined
Mon Mar 25, 2019 2:18 am

Post by grgr » Sun May 05, 2019 8:08 pm

You'll have to update the template which can be found here:

Code: Select all

..\catalog\view\theme\default\template\common\language.twig

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by straightlight » Sun May 05, 2019 9:05 pm

And then follow this FAQ if you have the OC cache enabled to see the changes on your store: viewtopic.php?f=176&t=200804#p718325

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by talab123 » Sun May 05, 2019 10:48 pm

Thanks for your reply.
Yes I know that I should change in this file, and tried to figure out how to, but didn't succeeded.
Can you clarify any example of what I should change ?

Thanks alot

Newbie

Posts

Joined
Mon Mar 25, 2019 2:18 am

Post by straightlight » Sun May 05, 2019 10:50 pm

talab123 wrote:
Sun May 05, 2019 10:48 pm
Thanks for your reply.
Yes I know that I should change in this file, and tried to figure out how to, but didn't succeeded.
Can you clarify any example of what I should change ?

Thanks alot
Any URL you could post?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by talab123 » Mon May 06, 2019 2:32 am

straightlight wrote:
Sun May 05, 2019 10:50 pm

Any URL you could post?
Sorry, I am testing offline on my PC now, and will upload to the host when it is complete.
But I am using the default theme, so any advice on how to change the default theme to remove the language dropdown list, will be so much appreciated.

Thanks alot

Newbie

Posts

Joined
Mon Mar 25, 2019 2:18 am

Post by straightlight » Mon May 06, 2019 3:44 am

Simply remove this ...

Code: Select all

{{ language }}

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by talab123 » Mon May 06, 2019 6:53 am

straightlight wrote:
Mon May 06, 2019 3:44 am
Simply remove this ...

Code: Select all

{{ language }}

Thank you very much for your support.

I couldn't found the line you mentioned, below is the file contents:

Code: Select all

{% if languages|length > 1 %}
<div class="pull-left">
  <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-language">
    <div class="btn-group">
      <button class="btn btn-link dropdown-toggle" data-toggle="dropdown">
      {% for language in languages %}
      {% if language.code == code %} 
      <img src="catalog/language/{{ language.code }}/{{ language.code }}.png" alt="{{ language.name }}" title="{{ language.name }}">
      {% endif %}
      {% endfor %}
      <span class="hidden-xs hidden-sm hidden-md">{{ text_language }}</span>&nbsp;<i class="fa fa-caret-down"></i></button>
      <ul class="dropdown-menu">
        {% for language in languages %}
        <li>
          <button class="btn btn-link btn-block language-select" type="button" name="{{ language.code }}"><img src="catalog/language/{{ language.code }}/{{ language.code }}.png" alt="{{ language.name }}" title="{{ language.name }}" /> {{ language.name }}</button>
        </li>
        {% endfor %}
      </ul>
    </div>
    <input type="hidden" name="code" value="" />
    <input type="hidden" name="redirect" value="{{ redirect }}" />
  </form>
</div>
{% endif %}
This is the file in: \catalog\view\theme\default\template\common

Newbie

Posts

Joined
Mon Mar 25, 2019 2:18 am

Post by straightlight » Mon May 06, 2019 9:03 am

In your catalog/view/theme/default/template/common/header.twig file. Forgot to post the location.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by talab123 » Mon May 06, 2019 9:15 am

Thank you, That did the first part, to remove the dropdown menu. Now there is no language option at all. Is there is a way to make it a button to the other language?

Newbie

Posts

Joined
Mon Mar 25, 2019 2:18 am

Post by talab123 » Tue May 07, 2019 1:12 am

straightlight wrote:
Mon May 06, 2019 9:03 am
In your catalog/view/theme/default/template/common/header.twig file. Forgot to post the location.
Hello,
Any Idea how to make it as a button / URL ?

Thanks

Newbie

Posts

Joined
Mon Mar 25, 2019 2:18 am

Post by straightlight » Tue May 07, 2019 5:22 am

I couldn't found the line you mentioned, below is the file contents:
From which file are you posting these codes? More information is needed.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by talab123 » Thu May 09, 2019 3:24 am

straightlight wrote:
Tue May 07, 2019 5:22 am
From which file are you posting these codes? More information is needed.
ٍSorry for the misunderstanding, I replied after that confirming that I found the line and removed it, put the Language selection disapeared totally. Kindly I need to make it as a button or URL or any other one-click option.

Thanks alot for following up.

Newbie

Posts

Joined
Mon Mar 25, 2019 2:18 am

Post by straightlight » Thu May 09, 2019 3:58 am

I was referring to your reply:
I couldn't found the line you mentioned, below is the file contents:
From which file did you looked into for this big block of language code above?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by letxobnav » Thu May 09, 2019 7:50 am

you can use this

Code: Select all

{% if languages|length > 1 %}
<div class="pull-left">
  <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-language">
    <div class="btn-group">
        {% for language in languages %}
          <button class="btn btn-link language-select" type="button" name="{{ language.code }}"><img src="catalog/language/{{ language.code }}/{{ language.code }}.png" alt="{{ language.name }}" title="{{ language.name }}" /> {{ language.name }}</button>
        {% endfor %}
    </div>
    <input type="hidden" name="code" value="" />
    <input type="hidden" name="redirect" value="{{ redirect }}" />
  </form>
</div>
{% endif %}

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by talab123 » Fri May 10, 2019 11:35 pm

straightlight wrote:
Thu May 09, 2019 3:58 am
I was referring to your reply:
I couldn't found the line you mentioned, below is the file contents:
From which file did you looked into for this big block of language code above?
From the language.twig file

Newbie

Posts

Joined
Mon Mar 25, 2019 2:18 am

Post by talab123 » Fri May 10, 2019 11:48 pm

letxobnav wrote:
Thu May 09, 2019 7:50 am
you can use this

Code: Select all

{% if languages|length > 1 %}
<div class="pull-left">
  <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-language">
    <div class="btn-group">
        {% for language in languages %}
          <button class="btn btn-link language-select" type="button" name="{{ language.code }}"><img src="catalog/language/{{ language.code }}/{{ language.code }}.png" alt="{{ language.name }}" title="{{ language.name }}" /> {{ language.name }}</button>
        {% endfor %}
    </div>
    <input type="hidden" name="code" value="" />
    <input type="hidden" name="redirect" value="{{ redirect }}" />
  </form>
</div>
{% endif %}
Thank you very much, that was very helpful. it put two buttons with the two languages.

Is there any way to make it one button for the other language?

Sorry for the many questions.

Thanks in advance.

Newbie

Posts

Joined
Mon Mar 25, 2019 2:18 am

Post by letxobnav » Sat May 11, 2019 12:34 am

Code: Select all

{% if languages|length > 1 %}
<div class="pull-left">
  <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-language">
    <div class="btn-group">
        {% for language in languages %}
			{% if language.code != code %}
				<button class="btn btn-link language-select" type="button" name="{{ language.code }}"><img src="catalog/language/{{ language.code }}/{{ language.code }}.png" alt="{{ language.name }}" title="{{ language.name }}" /> {{ language.name }}</button>
			{% endif %}
        {% endfor %}
    </div>
    <input type="hidden" name="code" value="" />
    <input type="hidden" name="redirect" value="{{ redirect }}" />
  </form>
</div>
{% endif %}

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by talab123 » Sat May 11, 2019 3:20 am

letxobnav wrote:
Sat May 11, 2019 12:34 am

Code: Select all

{% if languages|length > 1 %}
<div class="pull-left">
  <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-language">
    <div class="btn-group">
        {% for language in languages %}
			{% if language.code != code %}
				<button class="btn btn-link language-select" type="button" name="{{ language.code }}"><img src="catalog/language/{{ language.code }}/{{ language.code }}.png" alt="{{ language.name }}" title="{{ language.name }}" /> {{ language.name }}</button>
			{% endif %}
        {% endfor %}
    </div>
    <input type="hidden" name="code" value="" />
    <input type="hidden" name="redirect" value="{{ redirect }}" />
  </form>
</div>
{% endif %}
I really can't Thank you enough. Thanks very much for you support.
So much appreciated.

Newbie

Posts

Joined
Mon Mar 25, 2019 2:18 am
Who is online

Users browsing this forum: shivankagrawal and 144 guests