if you have a list of product ready on your custom page, put below code inside the foreach loop of products inside your tpl
Code: Select all
<button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-shopping-cart"></i></button>
You can't control the weather, but you can change your mood.
You can't modify the visage, but you can show your smile.
You can't command someone else, but you can hold yourself.
You can't forecast tomorrow, but you can using today.
You can't obtain thanks, but you can exert yourself in everything.
OCEXTENSION.COM - YOUR PROFESSIONAL OPENCART EXTENSION STORE
You can't modify the visage, but you can show your smile.
You can't command someone else, but you can hold yourself.
You can't forecast tomorrow, but you can using today.
You can't obtain thanks, but you can exert yourself in everything.
OCEXTENSION.COM - YOUR PROFESSIONAL OPENCART EXTENSION STORE
I changed it to cart.add("53", "1") and it still doesn't work.
I run the command in the console and get the following error.
Uncaught Error: cannot call methods on button prior to initialization; attempted to call method 'loading'(…)
Thanks for any help!
I run the command in the console and get the following error.
Uncaught Error: cannot call methods on button prior to initialization; attempted to call method 'loading'(…)
Thanks for any help!
Hi danguz74,
Is this something you are looking for?
Add: Ability to add products to OpenCart shopping cart from your website to aid in a better customer experience - 20160206 - v1.12
If so, it is part of a larger group of fixes for v2.1.0.x - http://www.randemsystems.com/support/op ... n-2-1-0-1/
Is this something you are looking for?
Add: Ability to add products to OpenCart shopping cart from your website to aid in a better customer experience - 20160206 - v1.12
If so, it is part of a larger group of fixes for v2.1.0.x - http://www.randemsystems.com/support/op ... n-2-1-0-1/
NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart
do you have common.js included from "catalog\view\javascript" ?danguz74 wrote:Thanks!
I added an "onclick='cart.add(54)'" to my link and it doesn't seem to be working. Am I missing something?
You can't control the weather, but you can change your mood.
You can't modify the visage, but you can show your smile.
You can't command someone else, but you can hold yourself.
You can't forecast tomorrow, but you can using today.
You can't obtain thanks, but you can exert yourself in everything.
OCEXTENSION.COM - YOUR PROFESSIONAL OPENCART EXTENSION STORE
You can't modify the visage, but you can show your smile.
You can't command someone else, but you can hold yourself.
You can't forecast tomorrow, but you can using today.
You can't obtain thanks, but you can exert yourself in everything.
OCEXTENSION.COM - YOUR PROFESSIONAL OPENCART EXTENSION STORE
Who is online
Users browsing this forum: No registered users and 15 guests