Skip to main content

Add to Cart button by passing product ID in HTML / JavaScript code?

More
9 years 10 months ago #255337 by arkscan
I know how to create an 'Add to Cart' button on an article by simply passing in the product ID, such as '
Free
'. Since I don't have an option to create a button on article, but I believe we can use custom HTML & Javascript to create a 'Add to Cart' button, would please let me know if there is solution to do that?

If there is no solution, what about via PHP coding in a custom php module? is there a way to do so? Any direction on how to do it will be appreciated.

thank you!

Please Log in or Create an account to join the conversation.

More
9 years 10 months ago #255358 by nicolas
Hi,

When you edit a product in your HikaShop backend, you can find the "HTML add to cart button" button at the top. If you click on it, you'll get a popup with some HTML you can use to get an add to cart button for that product that you can paste anywhere on your website. It's however less flexible than the content tag system as it doesn't have any options.

Please Log in or Create an account to join the conversation.

More
9 years 10 months ago #255427 by arkscan
I don't see "HTML add to cart button", am I in a wrong version of Hikashop? I see 'Add to cat HTML link', here is what I got

<a class="hikashop_html_add_to_cart_link" href="http://127.0.0.3/index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=1&checkout=1&product_id=1">Add to cart

What I want:
1. A button instead of a link.
2. the Add to cart link overwrite the existing quantity, if I have a quantity of 3 for this item, and after it's 'added' (actually it's updated to), it will become one, I would expect it becomes 4, is it possible?

thank you

Please Log in or Create an account to join the conversation.

More

Please Log in or Create an account to join the conversation.

Time to create page: 0.191 seconds
Powered by Kunena Forum