Add to cart adds wrong product

  • Posts: 279
  • Thank you received: 1
11 years 7 months ago #132135

-- url of the page with the problem -- : www.digitalguarddawg.com/rv/rv-1000/product
-- HikaShop version -- : 2.2.2
-- Joomla version -- : 2.5.16
-- PHP version -- : 5.3.x
-- Browser(s) name and version -- : Chrome

I have 3 tabs under the product on this page. Accessories lists 2 allied products to the main unit. If you click Add to cart for the main product it just adds the first product under the accessories tab.

I have an identical type of set up here - www.digitalguarddawg.com/automobiles-tru...motive/pbs-i/product - and it performs as expected.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 7 months ago #132163

Hi,
It's maybe a cache issue, can you disable the Joomla cache, and clear it ? You'll also have to disable it in the joomla config, and unpublish the cache plugin.

Last edit: 11 years 7 months ago by Mohamed Thelji.

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

  • Posts: 279
  • Thank you received: 1
11 years 7 months ago #132231

Definitely NOT the cache. It isn't on and never was.

The other pages that are working correctly are actually under this page (not the link as previously given) so I know it can work...

www.digitalguarddawg.com/motorcycles/rfi...y/dgd-kim-hd/product

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

  • Posts: 279
  • Thank you received: 1
11 years 7 months ago #132239

Inspecting the button with Firebug shows:

<input type="submit" class="btn button hikashop_cart_input_button art-button" name="add" value="Add to cart" onclick="var field=document.getElementById('hikashop_product_quantity_field_1');if(hikashopCheckChangeForm('item','hikashop_product_form')){ return hikashopModifyQuantity('405',field,1,'hikashop_product_form','cart'); } else { return false; }" style="zoom: 1;"/>

405 is the correct product code. If I remove the Accessories tab, the product is added correctly.

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

  • Posts: 26253
  • Thank you received: 4040
  • MODERATOR
11 years 7 months ago #132333

Hi,

edit
It is not possible to put a "add to cart" of another product in a tab of a product page.
There is a form in the product page which contain the all page. So when you click on the "add to cart", it is related to the current form.
Because you put a form into a form, it break the way that the HTML (and the forms) is processed so it send the wrong data to the server.

It is just not possible to put such data in the tab.
Or you have to modify the HTML so the other "add to cart" won't be include in the main form of the product page.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 11 years 7 months ago by Jerome.

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

  • Posts: 279
  • Thank you received: 1
11 years 7 months ago #132507

Sorry Jerome, I am really going to have to disagree. I have it working correctly on the very same site on this page (look under Harley Accessories tab):

www.digitalguarddawg.com/motorcycles/rfi...y/dgd-kim-hd/product

The DGD-KIM-HD can be added to the cart correctly, although, despite the setting to the contrary, after adding to the cart the user is taken to the checkout. That's less of an issue, though I would rather it didn't.

However, the fact remains, this page adds correctly to the cart and www.digitalguarddawg.com/rv/rv-1000/product does not despite being set up in exactly the same way.

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

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
11 years 7 months ago #132652

Hi,

It's normal that it doesn't work. Your would tab system is displayed inside the product description which is displayed inside the product page form. And each product of your listing has also a form for its own add to cart. But you can't have a form inside a form in HTML. That's why it messes up.
The solution is to not have your tab system in the description but edit the show file of the view product and add custom code to add the listing (and the whole tab element if you want) outside of the form of the product page. Or you remove the add to cart buttons of the listing of products on the product page.

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

Time to create page: 0.057 seconds
Powered by Kunena Forum