- Posts: 50
- Thank you received: 4
Add to cart link. Ajax or Stay same page POSSIBLE?
In item (product) card there is a button Add to cart HTML link
After clicking on this link (in content) is redirected to checkout.
1. Is it possible to add product from content with ajax ?
2. Do not redirect to checkout, Stay at same page (content) and display a popup notice ? (HikaShop->System->Configuration->Checkout->After a product is added to the cart: any setting does not affect)
Thanks.
Please Log in or Create an account to join the conversation.
Making it ajax is possible if you know javascript...Instead of having your link directly as an href attribute of a link, you could add some JS in your article to trigger that URL. The popup notice could be possible as well but it's also difficult.
In that case, the easiest would be to create a category for your product and add that category to your product. Then, create a new module in the menu Display->Content modules and set the parent category as that category and set it to display the add to cart button and us the layout "title". You can also add some CSS to remove the name and the price if you don't want it. Then, you can insert your module in your article using the loadposition plugin of joomla.
Please Log in or Create an account to join the conversation.
- Posts: 2
- Thank you received: 0
How can you make the "add to cart html link" simply add the product to the cart without redirecting? I would like to be able to add multiple items before checkout.
AJAX would be great if we could get an example.
Please Log in or Create an account to join the conversation.
forum.joomla.org/viewtopic.php?p=1533434
Then, you need to have your links like this:
You need to replace ADD_TO_CART_LINK with your link.
Please Log in or Create an account to join the conversation.
- Posts: 2
- Thank you received: 0
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Posts: 26
- Thank you received: 1
Selling a lot of cheap items and if is add one item to a cart i have to browse all the way back to the product category.
Please Log in or Create an account to join the conversation.
What this thread is about is the add to cart link when you want to use joomla articles as product pages and that you need to add your add to cart link manually in the HTML of the article.
Please Log in or Create an account to join the conversation.
Also with the cart itself you can edit the quantity - how can that be done with ajax?
Please Log in or Create an account to join the conversation.
www.demo.hikashop.com/index.php?option=c...kout=1&product_id=ZZ
where YY is the new quantity of the product in the cart and ZZ is the id of the product.
You can also use it to remove the product with a quantity of 0.
Refresh the checkout ? You can just do a window.location = 'URL_OF_THE_CHECKOUT'; in javascript.
Please Log in or Create an account to join the conversation.
You can refresh the quantity by calling the URL like that:
www.demo.hikashop.com/index.php?option=c...kout=1&product_id=ZZ
where YY is the new quantity of the product in the cart and ZZ is the id of the product.
You can also use it to remove the product with a quantity of 0.
Refresh the checkout ? You can just do a window.location = 'URL_OF_THE_CHECKOUT'; in javascript.
My checkout is a module. Will that work?
I want to press the add to cart button like above and get the shopping cart to update via ajax as well. Is there a way?
Please Log in or Create an account to join the conversation.
You must be talking about refreshing the cart module right ?
Then you should use the functions of the file administrator/components/com_hikashop/helpers/cart.php which already do that for normal add to cart buttons of HikaShop.
Please Log in or Create an account to join the conversation.
The checkout cannot be a module. It's always displayed on the main area of your website.
You must be talking about refreshing the cart module right ?
Then you should use the functions of the file administrator/components/com_hikashop/helpers/cart.php which already do that for normal add to cart buttons of HikaShop.
Yes I mean the cart. Thanks for your help so far.
Please Log in or Create an account to join the conversation.
- Posts: 10
- Thank you received: 1
Please Log in or Create an account to join the conversation.
There are two plugins called "HikaShop Product TAG insertion" and "HikaShop Product TAG translation" which have to be published for that.
Once done, you can use the "product" button below the HTML editor to add the add to cart buttons in your articles and they will use the behavior that you select in the "when a product is added to the cart" option of the Checkout tab of the configuration.
Please Log in or Create an account to join the conversation.
I can use the Ajax link provided, but I am wondering if there is an amendment to that A HREF to allow us to specify a quantity?
Please Log in or Create an account to join the conversation.
In the link you have the quantity parameter "&quantity=1" you just have to replace 1 by the desired quantity.
Please Log in or Create an account to join the conversation.
Thanks Xavier
Please Log in or Create an account to join the conversation.
Thank you dear nicolas
It's work very well.
Please Log in or Create an account to join the conversation.
With that kind of code ; you cannot.
But it will be possible in HikaShop 3.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.