For those who use more than one currency, you may find useful this small patch in order to make it stay in the same page (even in checkout):
Modify 2 lines in: catalog/controller/module/currency.php:
(on the top)
From:
$this->redirect($this->url->http('common/home'));
To:
$this->redirect($this->request->server['HTTP_REFERER']);
(on the middle)
From:
$this->data['action'] = $this->url->http('common/home');
To:
$this->data['action'] = $this->request->server['REQUEST_URI'];
It worked for me...
At the "Basket" section, the currency was not changing with the approach I posted.
So, I notice that in "catalog/controller/checkout/cart.php" was blocking my change.
I think it is not good to use the condition like this:
if ($this->request->server['REQUEST_METHOD'] == 'POST') {
better this way: (this is the solution to enable currency-change also in the "Basket")
if ($this->request->server['REQUEST_METHOD'] == 'POST' && isset($this->request->post['quantity'])) {
The reason is: If any other "plugin/extension" uses "POST" in the cart section, it will redirect again to "checkout/cart" without even accessing the "plugin/extension" code. I haven't checked in other codes, but I feel that every POST must be defined so it will only ignore the POST when do not belongs to it.
Done.
So, I notice that in "catalog/controller/checkout/cart.php" was blocking my change.
I think it is not good to use the condition like this:
if ($this->request->server['REQUEST_METHOD'] == 'POST') {
better this way: (this is the solution to enable currency-change also in the "Basket")
if ($this->request->server['REQUEST_METHOD'] == 'POST' && isset($this->request->post['quantity'])) {
The reason is: If any other "plugin/extension" uses "POST" in the cart section, it will redirect again to "checkout/cart" without even accessing the "plugin/extension" code. I haven't checked in other codes, but I feel that every POST must be defined so it will only ignore the POST when do not belongs to it.
Done.
You hit the nail on the headlepe wrote: if ($this->request->server['REQUEST_METHOD'] == 'POST' && isset($this->request->post['quantity'])) {
The reason is: If any other "plugin/extension" uses "POST" in the cart section, it will redirect again to "checkout/cart" without even accessing the "plugin/extension" code. I haven't checked in other codes, but I feel that every POST must be defined so it will only ignore the POST when do not belongs to it.

We did exactly this for 0.7.9 Final to get the "stay on same page" stuff working. Was worth it

Who is online
Users browsing this forum: No registered users and 6 guests