php - Opencart 2.0 - add product direct to cart -


i have installed opencart ver. 2.1.0.1

what want add products directly landing pages (basic html/css) cart of opencart.

earlier opencart version 1.5, using tweak , working fine.

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

any opencart expert highly appreciated.

in opencart v2 , upwards change has been made follows:

the link changed to

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

where onclick event triggers add cart function parameters

  1. product id - unique identifier of product.
  2. minimum - refers quantity being ordered.

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -