- Posts: 272
- Thank you received: 7
Cannot add pdt to cart more than once
-- Joomla version -- : 3.4.1
Hi,
A developer I work with recently created a new module position on my shop so I can have the cart and category menu on the right hand side. This new module position was created in my Hikashop override folder: mysite/templates/mytemplate/html/com_hikashop
I tested it and I cannot add a product more than once to the cart. If I try to add the product twice it is not added. I don't think my developer knows why, so i am turning to you for assistance. I would be very grateful for some help/advice. Maybe you know why this is happening and what the solution would be..
Please Log in or Create an account to join the conversation.
The problem comes from the way the customization was done.
The cart module is displayed inside the product page form.
When you have a product in the cart, the quantity of the product in the cart module is passed along when you click on the "add to cart" button and that field has a higher priority than the product quantity field, resulting in the system updating the quantity of the product in the cart with the quantity it already had instead of adding the quantity in the quantity field to the cart.
So what you want is to turn off the "Show quantities in the cart" option of the cart module or to modify the code of the cart module override to not display the quantity field of each product in the cart but just the quantity value.
Please Log in or Create an account to join the conversation.
I did as you said and set "No" for "Show quantities in the cart. However this does not change anything - cart still does not add more than one item. Rather than change the code for the cart, can you suggest a better way to add a new module position for my shop pages that would not cause this problem? For example, if a module position was created in my site template (not in the hikashop override folder), would this solve the issue?
Please Log in or Create an account to join the conversation.
Otherwise, yes it would solve the problem too if you would move the cart module position from outside the product page view.
Please Log in or Create an account to join the conversation.
Thanks for the advice.
Is it possible to move the cart module position outside the product page view (so it functions correctly), but for the cart to still visually appear in the same place on the product page (right hand side of product page)?
To better explain, if I create a new module position in my site template (not in the hikashop override folder) and publish the cart to the new position (which visually is still on the right side of the product page), will the cart then work? I can then use a "nonumber.nl" extension to publish the cart module on Hikashop product URLs only.
Hopefully you understand what I am asking
Please Log in or Create an account to join the conversation.
Yes, that's possible. It just requires the proper CSS to be added so that you can place the different areas like you need them to appear. The exact CSS will depend on how the module position is created in the template (what HTML it ouputs), what CSS is already in the template, and what other customizations have been done to the product page.
A web designer or a web developer should be able to provide such CSS.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Do you have any economical developer you can suggest that would be able to create a new module position for me? The guy I used to work with isn't available. I know this is a reasonably easy thing to do, but possibly above my abilities.
Please Log in or Create an account to join the conversation.
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
My developer has said that the cart must be placed in the Hikashop layout, in order to get the module to display correctly on mobiles/ipads etc. So I have no other option than to do this (rather than place it in a site template module position).
Do you think it should be a relativly simple task to get the cart to update correctly by tweaking the "code of the module cart view file in the template to remove the input."?
Please Log in or Create an account to join the conversation.
I don't see why mobile devices display would be a problem. He must have overlooked that he can use CSS media queries to restrict the positioning CSS on the product page based on the width of the device and thus adapt the display so that it looks good for all of the devices.
line25.com/tutorials/create-a-responsive...n-with-media-queries
But yes, it will be easy to remove the quantity input. With the default code, it should just be changing the line:
So in short, both should be easy solutions taking a few minutes to implement for an experienced developer.
Please Log in or Create an account to join the conversation.
I notice that when the cart is added to the hikashop layout, then the "related products" at the bottom of the page do not show. I believe this is because both modules (the 'cart' and 'related product') is on Display > content module. The new module position that was created on the right of the product page for the cart is also inside the Hikashop component, which seems to disable the 'related product' module on the page.
Is there any fix for this, besides moving the 'related product' module to "bottom1" module position for example (which is not perfect)?
Thanks again
PS : I implemented your code, but as before the cart will only add one of the same product, not 2.
Do you have any other coding suggestions I could try?
Thanks in advance for your help
Please Log in or Create an account to join the conversation.
I don't know how the page was customized and that doesn't happen by default so I can't say much.
I would recommend to seek advice with your developer regarding that issue.
Please Log in or Create an account to join the conversation.