In this topic: http://forum.opencart.com/viewtopic.php?f=131&t=37180, the following URL is used to add multiple products to the cart (and the link does work correctly to add two products to the cart):
http://unbannable.com/v149x/index.php?r ... ntity[1]=2
I am using opencart 1.4.8 and the above link is probably working on version 1.4.9. I can only get this URL technique to work for single products. For example, the following URL correctly puts qty 3 of product #29 into my cart:
http://www.mywebsite.com/index.php?rout ... quantity=3
However, the next URL does not work; my cart reports the shopping cart is empty:
http://www.mywebsite.com/index.php?rout ... ntity[1]=2
Is this being caused by a difference between versions 1.4.8 and 1.4.9 ?
Does anyone know of a fix?
SOLUTION:
in catalog\controller\checkout\cart.php
Change line 8 from:
if ($this->request->server['REQUEST_METHOD'] == 'GET' && isset($this->request->get['product_id'])) {
to:
if ($this->request->server['REQUEST_METHOD'] == 'GET' && isset($this->request->get['product_id'][0])) {
AND line 45 from:
$this->cart->add($this->request->get['product_id'], $quantity, $option);
To:
$this->cart->add($this->request->get['product_id'][$i], $quantity, $option);
Hope someone finds this useful
in catalog\controller\checkout\cart.php
Change line 8 from:
if ($this->request->server['REQUEST_METHOD'] == 'GET' && isset($this->request->get['product_id'])) {
to:
if ($this->request->server['REQUEST_METHOD'] == 'GET' && isset($this->request->get['product_id'][0])) {
AND line 45 from:
$this->cart->add($this->request->get['product_id'], $quantity, $option);
To:
$this->cart->add($this->request->get['product_id'][$i], $quantity, $option);
Hope someone finds this useful
Who is online
Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 82 guests