ServWise.com Posted July 17, 2009 Share Posted July 17, 2009 Been playing with the language system in WHMCS trying to create a system that would allow me to display multilingual product information without big hacks. Since the admin is clearly not suitable for this job even using the workaround mod I created here I decided to focus on using the language files to pull in the data for each product. Turned out it was simpler than I had imagined. In your Language files place the following entries for each product $_LANG["products"]["1"] = array("desc"=>"the description","feat1"=>"Feature 1"); where 1 is the product id that this data is to be associated too, e.g $_LANG["products"]["1"] or $_LANG["products"]["22"] or $_LANG["products"]["35"] etc This creates a language variable array with items for "desc" and "feat1", obviously you can add more values to the array like more features or other values you want to be accessible to this products listing. Now to pull in the correct data for each product. In your products.tpl file use the following lines between your product foreach tags {if $LANG.products[$product.pid].desc}{$LANG.products[$product.pid].desc}<br />{/if} {if $LANG.products[$product.pid].feat1}{$LANG.products[$product.pid].feat1}<br />{/if} This will now show any language specific data for that product held in the current language file. All in all it is a really nice way to implement multilingual data for products. 0 Quote Link to comment Share on other sites More sharing options...
jozeph Posted July 18, 2009 Share Posted July 18, 2009 I really prefer use the getlang modifier that you create! http://forum.whmcs.com/showthread.php?t=20219 0 Quote Link to comment Share on other sites More sharing options...
ServWise.com Posted July 18, 2009 Author Share Posted July 18, 2009 I really prefer use the getlang modifier that you create! http://forum.whmcs.com/showthread.php?t=20219 It IS a great idea (if I say so myself) but unfortunately because of the way it has to be implemented (Not internally) it does not work so well IMO. This solution however has a number of advantages for product data and is more flexible for displaying lots of product data, features lists, large pop-up content per product, links etc etc. I implement this as a custom add-on language system in WHMCS, it uses individual language files per page instead of one BIG language file for the whole site, leaving the main language file as just a global language file for content that is shown globally on the site saving on page response times by only loading the content that is really needed. 0 Quote Link to comment Share on other sites More sharing options...
jozeph Posted July 24, 2009 Share Posted July 24, 2009 But you are limited to change this information in files. The first option, you can change everything just accessing the admin interface. Both are very useful, mainly because WHMCS is not fully multi-language system. 0 Quote Link to comment Share on other sites More sharing options...
equipc Posted August 21, 2009 Share Posted August 21, 2009 I hope WHMCS will become a completely multi-language system, this is the only thing they missed ... 0 Quote Link to comment Share on other sites More sharing options...
jozeph Posted December 12, 2009 Share Posted December 12, 2009 I lose my hope for this... Me and many others have requested a full multi-language support... I hope WHMCS will become a completely multi-language system, this is the only thing they missed ... 0 Quote Link to comment Share on other sites More sharing options...
alain100 Posted January 3, 2010 Share Posted January 3, 2010 Hi Sam, it seems pretty easy to setup but I just don't know where to put the code in the products.tpl file. Could you show an example of exactly where the code should go. Anyway thanks for this great plugin. Also, is it possible to have the group name bilingual using the same system. I have a group named Hosting in english but in French it stays the same. Any idea how to fix that Thanks 0 Quote Link to comment Share on other sites More sharing options...
pasko Posted January 6, 2011 Share Posted January 6, 2011 Been playing with the language system in WHMCS trying to create a system that would allow me to display multilingual product information without big hacks. Since the admin is clearly not suitable for this job even using the workaround mod I created here I decided to focus on using the language files to pull in the data for each product. Turned out it was simpler than I had imagined. In your Language files place the following entries for each product $_LANG["products"]["1"] = array("desc"=>"the description","feat1"=>"Feature 1"); where 1 is the product id that this data is to be associated too, e.g $_LANG["products"]["1"] or $_LANG["products"]["22"] or $_LANG["products"]["35"] etc This creates a language variable array with items for "desc" and "feat1", obviously you can add more values to the array like more features or other values you want to be accessible to this products listing. Now to pull in the correct data for each product. In your products.tpl file use the following lines between your product foreach tags {if $LANG.products[$product.pid].desc}{$LANG.products[$product.pid].desc}<br />{/if} {if $LANG.products[$product.pid].feat1}{$LANG.products[$product.pid].feat1}<br />{/if} This will now show any language specific data for that product held in the current language file. All in all it is a really nice way to implement multilingual data for products. Hello Sam, Thank you for your work. Unfortunately I am not familiar to whmcs, could you do a tutorial or give a more detailed description of the how to do for a newbie? I would even appreciate it more if you can make the modification for me, again a donation of course! Regards, Pascal 0 Quote Link to comment Share on other sites More sharing options...
joseep Posted January 30, 2011 Share Posted January 30, 2011 Hi ServWise.com, I was wondering if you new workaround includes product categories or if we should copy and adapt your new code for them. I was trying to display products in English and in French but the product dropdown show in both languages, which doesn't make sense for clients. Since then, I've been trying to find a solution to display language-specific product types, products and product descriptions. Thanks for helping to make WHMCS a multilingual software Josée Marianne 0 Quote Link to comment Share on other sites More sharing options...
ServWise.com Posted January 31, 2011 Author Share Posted January 31, 2011 Hi ServWise.com, I was wondering if you new workaround includes product categories or if we should copy and adapt your new code for them. I was trying to display products in English and in French but the product dropdown show in both languages, which doesn't make sense for clients. Since then, I've been trying to find a solution to display language-specific product types, products and product descriptions. Thanks for helping to make WHMCS a multilingual software Josée Marianne If you can parse an ID for the product category then you can make it pull in a specific language value from a language file and display it instead of the one in WHMCS admin. (Assuming the layout has not been hard coded by WHMCS) 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.