Jump to content

Any way to show Product Categories in another language?


HancoEuropa

Recommended Posts

Would anyone happen to know how to help WHMCS show the correct language in the drop-down lists in mobile view?

image.png.a74f4186c298b3d51d7d50d0d7b4c4cd.png

I did insert some {$LANG.categories} and {$LANG.actions} for the option groups, but the {$productgroup.name} in line 8 of /templates/orderforms/standard_cart/sidebar-categories-collapsed.tpl seems entirely uninterested in respecting the language set. 

What is feeding that template?  The sidebar is translated just fine in a normal-sized browser window. 

image.png.97e02cd686531e85a80caf221f5ff69d.png

Bit of a head-scratcher!

Thanks for any hints, cheers!

Link to comment
Share on other sites

1 hour ago, HancoEuropa said:

But yes, it is indeed Dynamic Field Translation

then the next step is to see how the page looks using a clean version of Six and standard_cart - I just tried it locally on a v8 dev and it's showing the category translations on the mobile as expected... I just tried to look at your site using Six, but I assume that the Six theme has been renamed or deleted?

Link to comment
Share on other sites

Interesting. 

The sidebar-categories-collapsed.tpl is in the /orderforms/standard_cart template folder (rather than in the custom template folder);  the changes I make there are shown fine in the front end.   Six is there; but I did not see any changes when switching to it in General Settings.

21 minutes ago, brian! said:

I just tried to look at your site using Six

How did you do that -- look at our site using Six?

I just noted that I'm on Version: 7.10.2 ... perhaps I should upgrade to Version 8.  😜

Thanks!

Link to comment
Share on other sites

🧐 Works perfectly fine now with v8.0.3 installed, thanks for noting the version number brian!   I hadn't checked for a few weeks. 

Both /templates/orderforms/standard_cart/products.tpl and /templates/orderforms/standard_cart/sidebar-categories-collapsed.tpl were overwritten with the update.

Will look over tomorrow and figure out what the issue was, but you've given me a good start!

Thanks!

 

Link to comment
Share on other sites

6 minutes ago, HancoEuropa said:

How did you do that -- look at our site using Six?

https://docs.whmcs.com/Linking_to_WHMCS#Setting_the_Language_or_Template_via_the_URL

though it's not working... which is curious.

8 minutes ago, HancoEuropa said:

Both /templates/orderforms/standard_cart/products.tpl and /templates/orderforms/standard_cart/sidebar-categories-collapsed.tpl were overwritten with the update.

I suspect that's what solved it - not necessary updating, but undoing whatever you did in those templates.

remember that unless you rename/duplicate them, an update will overwrite any customisations you make to those templates.

Link to comment
Share on other sites

Yeah, no worries -- they had, I note, changed the method for the gid etc for that drop-down menu.

{foreach key=num item=productgroup from=$productgroups}
     <option value="{$productgroup.gid}"{if $gid eq $productgroup.gid} selected="selected"{/if}>{$productgroup.name}</option>
{/foreach}

Became:

{foreach key=num item=productgroup from=$productgroups}
     <option value="{$productgroup.routePath}"{if $gid eq $productgroup.gid} selected="selected"{/if}>{$productgroup.name}</option>
{/foreach}

I just copied back the the edits I did into the new product and sidebar-categories-collapsed tpl files -- worked just fine.

And yes, I had to hard-code in the custom template somewhere I think ... because our custom template does a bit of heavy lifting here and there to block things like currency changing.   We also had to rework products and services to make sense for our business model which includes a lot of hourly rate services, so our data is not always appropriate to the Six template any more, nor would we want folks changing to it.

33 minutes ago, brian! said:

I suspect that's what solved it - not necessary updating, but undoing whatever you did in those templates.

remember that unless you rename/duplicate them, an update will overwrite any customisations you make to those templates.

Yes, that's possible, but looking it over, I'm leaning towards thinking that whatever data was feeding those tpls was possibly tightened up between 7.10.2 and 8.0.3 somewhere for the language thing.  Will figure out what that is eventually :))  

But putting back my changes just did not do anything that material to the tpls really, all display stuff.

All solved now -- Thanks again mate, most appreciated!  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated