Page 1 of 1

Language setting in Orders module

Posted: Mon Mar 26, 2012 9:42 am
by otsakir
Hello,

I am using Orders module for order management in an e-shop site. I included the module in a checkout page (actually two, one for each language supported) like this:

...
{if $ccuser->loggedin()}
{Orders lang=$lang}
{else}
...

$lang contains a locale string like "en_US" or "el_GR" which, in my setup, derives from the path of the page in the url. From what I have seen, the default action for a new order displays the Billing form template. User reviews his name, address, etc. and hits next. So far so good. $lang is correctly set and the Billing template is rendered nicely.

But, when I hit submit that eventually executes the "confirm" action and displays the Confirm Order Template the language information is lost and rendering of the template is done using the default locale for the site. Take into account that the page that hosts the module is still the checkout page i.e. it has not been overridden by the "Page to use for the confirmation form" option in the Orders/Preferences tab.

Is there any other way to pass-on this language information? I mean, from what I have seen i can either:

a) use the same page for billing/confirmation since it contains language setting already in its url

or

b) use a "Page to use for the confirmation form" override which does not work in a multi-language scheme like the one I use where the language is based on which page is rendered.


I also tried a little hack in the default action of the Orders module that propagates language information to the confirm action. I added the language parameter in the redirect to the confirm action. It seemed to work fine. But of course, I want to avoid messing with the Order's module code and having running after patches.

I am using CMS Made Simple 1.10.3 and Orders 1.13

Re: Language setting in Orders module

Posted: Tue Mar 27, 2012 10:55 am
by Peciura
Add this line bellow {$formstart} tag on Billing Form Template (the last template that retains correct language)

Code: Select all

<input type="hidden" name="{$actionid}lang" value="{$lang}" />

Re: Language setting in Orders module

Posted: Wed Mar 28, 2012 10:19 am
by otsakir
Makes perfect sense. Thanks!