Cart module: language-specific "Add to Cart" redirect?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
ridelikeaturtle
Forum Members
Forum Members
Posts: 103
Joined: Thu May 06, 2010 9:22 pm

Cart module: language-specific "Add to Cart" redirect?

Post by ridelikeaturtle »

The Cart module... only allows redirecting to the English "View Cart" page when adding an item to the cart.

Is there a way to redirect to a language-specific "View Cart" page when adding an item to your shopping cart (using the Cart module)? It always goes to what is set in the Cart module's preferences (which is expected), but if I'm on (for example) a French page, I'd prefer to go to a French "View Cart" page, and not have to make the user re-select their desired language.
janvl
Power Poster
Power Poster
Posts: 947
Joined: Wed Aug 13, 2008 10:57 am

Re: Cart module: language-specific "Add to Cart" redirect?

Post by janvl »

I have just made this in 2 languages.
What version of CMSMS and Modules do you use?

You need to make templates for each language and in "page specific smarty" you must put {cms_set_language lang="de_DE"} for French then. At least when this is 1.11.7 with the latest modules.

Kind regards,
Jan
ridelikeaturtle
Forum Members
Forum Members
Posts: 103
Joined: Thu May 06, 2010 9:22 pm

Re: Cart module: language-specific "Add to Cart" redirect?

Post by ridelikeaturtle »

Thanks Jan for the suggestion - it might give me another way to approach this.

I've got a test area for CMS 1.11.7 where I'm trying this out. I'm using Babel 0.4.1 for the multi-language support, and have my pages in a hierarchy with all English pages beneath "en", all French under "fr", etc.

Using French as an example... I can create separate templates for anything French, that's no problem and all is being displayed as expected based on the page language.

I call the Cart module in the main page template specifying the language:

{Cart action='mycart' lang='fr_FR'}

In the Product detail template, I add the "add to cart" functionality with:

{cgecomm_form_addtocart lang='fr_FR' addtocarttemplate="bigaddtocart" product=$entry->id}

In the Cart's "add to cart" template, the form's HTML <input...> tag is always going to send me to the default "View Cart" redirect page, and as that's an English page it will be English. All French-language info seems to be discarded once redirected to this page. It doesn't seem to matter that the Cart module's language, or the CGEcommerceBase module's language, has been set to the French page language. Also, setting {cms_set_language lang="fr_FR"} doesn't seem to affect this either.

Is there a way to specify to the Cart module to redirect to a language-specific "View Cart" page through the form's <input...> tag, when adding an item to the cart?

Otherwise in the short term I'll shove in an additional step to make the user choose the language for their cart each time they add a product to their cart... which is not optimal.

Thanks again for the suggestions!
janvl
Power Poster
Power Poster
Posts: 947
Joined: Wed Aug 13, 2008 10:57 am

Re: Cart module: language-specific "Add to Cart" redirect?

Post by janvl »

Hi,

try removing lang="fr_FR" and only use {cms_set_language lang="fr_FR"}
Check wether the language-file is in the module-directory, it should be.

I use the e-commerce solution in 2 languages and there is no difference in a geman or english cart, the same cart is presented in either the one or the other language.

Did you check that you have the latest modules, just a few days ago new vesions were released.

Kind regards,
Jan
ridelikeaturtle
Forum Members
Forum Members
Posts: 103
Joined: Thu May 06, 2010 9:22 pm

Re: Cart module: language-specific "Add to Cart" redirect?

Post by ridelikeaturtle »

Jan, in your multi-language setup, do you have separate page hierarchies for each language? E.g.,
1 English, 1.1 Home... 1.8.3 View Cart;
2 Francais, 2.2 Home FR ... 2.8.3 View Cart FR;
3 Espanol, 3.3 Home ES ... 3.8.3 View Cart ES

If not, this may be a fundamental structure problem for me that the Cart module, or {cms_set_language} will not overcome.

But if your pages do follow that hierarchy, which page do you have specified in the Cart preference's "Page to Redirect to after add to cart"? Is it beneath one of the language hierarchies?
janvl
Power Poster
Power Poster
Posts: 947
Joined: Wed Aug 13, 2008 10:57 am

Re: Cart module: language-specific "Add to Cart" redirect?

Post by janvl »

Hi,
I use Rolf's solution for multilanguage.
Home with a redirect and a branch for each language, like you do.

I left that one open, I send the cart to a cartpage ( 1 for each language) where all detailinformation considering the cart is presented.

With checkout I send the user to a checkout page (one for each language).

When I define the language for a page this sticks to all actions for cart, checkout etc.

Kind regards,
Jan
Post Reply

Return to “Modules/Add-Ons”