-1

I have recently installed Opencart Ver. 2.1.0.1

What i want is to add products directly from Landing pages (basic HTML/CSS) to cart of Opencart.

Earlier for Opencart version 1.5, i was using a tweak and it was working fine.

Ideally adding ?route=checkout/cart&add_product=1&product_id[]=170&qty[]=1 after domain name, so add product to the cart.

Any help by Opencart expert will be highly appreciated.

1 Answers1

0

In opencart V2 and upwards the change has been made as follows:

The link is now changed to

onclick="cart.add('<?php echo $product['product_id']; ?>', '<?php echo $product['minimum']; ?>');"

Where the onclick event triggers the add to cart function with the parameters

  1. Product ID - Unique identifier of the product.
  2. Minimum - this refers to the quantity being ordered.
Sphinx
  • 956
  • 7
  • 21