Language setting in Orders module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
otsakir
Forum Members
Forum Members
Posts: 17
Joined: Wed Mar 07, 2012 4:26 pm

Language setting in Orders module

Post 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
Peciura

Re: Language setting in Orders module

Post 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}" />
otsakir
Forum Members
Forum Members
Posts: 17
Joined: Wed Mar 07, 2012 4:26 pm

Re: Language setting in Orders module

Post by otsakir »

Makes perfect sense. Thanks!
Post Reply

Return to “Modules/Add-Ons”