Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Set Default Language Rate Topic   - - - - -

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19976 posts

Posted 07 September 2017 - 05:49 AM #21

Have you verified that this affects the CART_LANGUAGE constant?  I believe that fn_init_languages() is run before any addon init'.php files.

 

Yes, but you can change the HTTP_ACCEPT_LANGUAGE value, isn't it?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11442 posts

Posted 07 September 2017 - 06:40 PM #22

But I don't think you can change it at the point in the process where it will impact what's being set as the CART_LANGUAGE that is used throughout the cart.  What I believe the OP wanted to do is to set the language used in the cart based on his criteria (whatever that may be) without modifying a core file.  I don't think it can be done but am certainly open to learning how one might do it if it is possible.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19976 posts

Posted 08 September 2017 - 08:31 AM #23

Try solution from my previous post in the init.php file of the module. It should work


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11442 posts

Posted 08 September 2017 - 08:25 PM #24

Awesome, it worked.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19976 posts

Posted 11 September 2017 - 06:41 AM #25

Awesome, it worked.

 

Thank you for keeping me updated!


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • netikon
  • Newbie
  • Members
  • Join Date: 06-May 14
  • 3 posts

Posted 22 January 2020 - 05:46 PM #26

This is a very old topic but just for historic reasons and for all other that will come here to ask for a solution, I have to say that it can be done through an addon.
Addon files are being loaded before "fn_init_language", but their functions will not be called, so you cannot use a hook function in your addon to alter the browser language. However, in func.php or init.php of your addon, you can simply add a php server variable and set the default language for the cs-cart, no matter what is the language of the user's browser.

in func.php or init.php file of your addon add:

$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'en'; //or any language code you prefer as default