Commit Graph

7 Commits

Author SHA1 Message Date
Denis Ledoux 138cc11a5f [FIX] website_sale_options: option modal within foreign languages
If the default language of the visitor is not the default
language of the website
(If the default website lang is en_US, and the visitor
browser is configured in nl_NL, the default language
visitor will be nl_NL),
the go to cart button in the option modal was no
longer working.

This is related to revision a696913364

opw-632490
2015-04-09 11:42:44 +02:00
Denis Ledoux 0cf87d1671 [FIX] website_sale_options: keep website language on cart addition
In the ecommerce, when adding a product to the cart
while having website_sale_options installed
the product was added in the cart within the
website default language, not in the current
language of the visitor. The description of the product
was in the default website language (for instance, English)
instead of being in the visitor language (for instance, French).

The reason is quite simple: With website_sale_options, routes
are called in javascript, and these calls do not include the
website language within the url to the route
(e.g., call to '/shop/modal' instead of '/fr_FR/shop/modal)
and the language in the request context is therefore
the website default language.

The solution proposed here is probably not the cleanest possible,
a cleaner solution would be to define a new utility
JS function within website javascript to perform
Ajax calls, automatically adding the language to the url path
according to the current visitor language.

Another solution would be to set the lang of the session context
to the visitor language, and to use this lang instead of the
lang within request.context.

Nevertheless, none of the two above solutions can be performed in
stable releases, such as 8.0, to avoid any risks.

opw-631400
2015-03-25 14:33:33 +01:00
Fabien Pinckaers 1dadcc1fba fix 2014-07-02 20:08:51 +02:00
Christophe Matthieu 216456127d [IMP] website_sale_options: clean code; add ondelete cascade for optional product on sale order 2014-06-25 12:00:27 +02:00
Christophe Matthieu 412a7593be [IMP] website_sale_options 2014-06-25 11:31:39 +02:00
Christophe Matthieu 7505cce2e9 [WIP] 2014-06-24 17:37:13 +02:00
Christophe Matthieu 204a62499a [IMP] website_sale_options 2014-06-24 15:11:53 +02:00