- Posts: 114
- Thank you received: 4
streamline a minishop
-- Joomla version -- : 3.7.0
-- PHP version -- : 7.1
I use the shop to sell 1 product. Therefore I would like to streamline the purchase process. I would like to put a button in a Joomla article that takes the user to my onepage checkout. For that I need to programmatically add my product to the users cart so my product is already in the user's cart when he comes to the checkout page. How can this be done?
Please Log in or Create an account to join the conversation.
That's really easy !
Just read this:
www.hikashop.com/support/documentation/1...-product-insert.html
That will allow you to add a tag in a Joomla article, which will display an add to cart button on your article and that button will add the product to the cart and redirect the customer to the checkout.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Maybe the tutorial is a little old, in order to update the screenshot and if you don't see it :
If for a reason or another, you don't have tag buttons, you have another solution (with a little more work...) is to directly insert hikashop button html in your article.
Just be sure to change product id in order to add the required product.
Hope this will help you.
regards
Please Log in or Create an account to join the conversation.
Workflow question: I do not need the user to put 1 item in the cart since I have only 1 product than can only be purchased at the amount of 1. So when the user clicks on the "buy now" button he should get immediatelly sent to tht checkout with 1 piece of my product added to the basket,. Right now the basket is empty when I send the user to the checkout. How can I make sure that 1 item gets added when the user clicks the purchase button? Thanks.
Please Log in or Create an account to join the conversation.
I'm not following you. The button added by the content tag system is supposed to add the product to the cart and then redirect to the checkout.
If that's not the case, then there must be an issue on the page and we would need a link to it in order to analyse the situation.
Please Log in or Create an account to join the conversation.
I sent you the credentials but I cant access my private messages (I could not find a menu item) ...7
cheers
Please Log in or Create an account to join the conversation.
The problem is that you've configured a custom field of the table "item" on your product and that custom item field is required.
But the content tags don't display custom item fields so when you click on the add to cart button there, the system refuses the add to cart as the custom item field is missing.
Instead of a content tag, I would recommend instead to use the Add to cart HTML link of the product (that you can find with the button of the same name when you edit the product and then copy/paste in your article's HTML). In the URL of that link, you can add the custom item field value you want. More information on that here:
www.hikashop.com/forum/2-general-talk-ab...-product-fields.html
That will also answer the other question you had in your message regarding how to add such value to the product being added to the cart.
Please use our contact form to send such access next time and make sure that your include the link to the thread in your contact request:
www.hikashop.com/support/contact-us.html
Please Log in or Create an account to join the conversation.
I went ahead and tried this link:
Please Log in or Create an account to join the conversation.
See : www.hikashop.com/support/20-documentatio...ct-form.html#toolbarBut I am struggling to find that "Add to cart HTML link". Would that be in the front end or back end?
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
That button gives the same link that I already put together myself but strangely enough now the custom field gets transfered to the checkout.
EDIT: now it stopped working and I get "Please complete the Listing field" again...
Please Log in or Create an account to join the conversation.
When I use your link with the product_id 11 like before or with the product_id 6, the product is added to the cart and I get redirected to the checkout which then redirects me to the login screen :
monosnap.com/file/PA5vWYoBCo0uHllUKDq81WI51PHaUU
I suppose that it is because of how you configured the menu item with the id 296 which is not public.
Then, if I access the checkout without that menu item id, it displays find with the product in the cart with the custom field:
monosnap.com/file/Y53JNbMFT2HBwC03zlQm0D6V5NslAQ
So the add to cart with the custom item field + redirection to the checkout seems to be working for me.
Please Log in or Create an account to join the conversation.
EDIT: I solved it by deleteing router.php from the hikashop component folder. Now I have no SEF urls on any of the hikashop urls but at least the purchase process works.
Please Log in or Create an account to join the conversation.
That's because you need to add a parameter &Itemid=XXX to the end of the URL where XXX is the id of a menu item of HikaShop.
Then it should work even with the router.php file.
Please Log in or Create an account to join the conversation.
I face another workflow issue:
My users buy one standard "sort of subscription" for their Joomla article that they publish on my site. Hence I set the max amount available per order to 1. That works in a straight forward workflow but if for some reason the user cancels the checkout process and later clicks a second time on my checkout link it says:
"Too much quantity selected for product Basic"
How can I prevent that from happening? I guess I would need to reset the quantity for the product in the cart before redirecting to the cart or just overriding that value? Or I could hide that "add to cart" link and instead put a "go to checkout" link in there. But that would mean I need to know if the product is already in the cart - can I know that via PHP?
Please Log in or Create an account to join the conversation.
1. This means that your URL is going through the JRoute::_ function. It's possible but in that case the data parameter of the custom field must be added at the end of the link, after the URL is processed by JRoute as it won't handle it properly in the SEF process.
2. You can add the parameter &add=0
That way, instead of adding the product to the cart, it will replace the product quantity in the cart if already there.
Please Log in or Create an account to join the conversation.
index.php?option=com_hikashop&Itemid=296&ctrl=product&task=updatecart&quantity=1&add=0&checkout=1&product_id=6&data[item][listingid]=...
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
We do as fast as we can. Please understand that sometimes we need time to understand and provide an adequate answer.
Also, we don't work during the weekend or during the time, and we have to answer to many other customers as well.
For example, to be able to write this message alone, it took me 3 hours of work.
On this case, the issue is actually a bug of the new cart system in HikaShop 3 which doesn't support properly add=0.
I've added a patch on our end. Download the install package on our website again and install it on yours and that will add the patch in order to support that parameter properly. I've tested the patch on my end and it now works properly.
Please Log in or Create an account to join the conversation.
I understand your work load but I also have to justify a software that costs me 150€ a year. It needs to be balanced not doubt, lets strive for that.
Please Log in or Create an account to join the conversation.