Skip to main content

Add to cart item bound to layout?

More
11 years 3 months ago - 11 years 3 months ago #207025 by veeco
-- HikaShop version -- : 2.2.3

Hi

so i tried to change the show_default.php through template override. The problem is if i use characteristics, it doesnt add the item to the cart, instead it shows to product listing page with "the cart is empty"

my question is, does add to cart button in the product detail page bounded to certain parameter or class when adding the item to the cart?

i used jQuery to append and move item around [such as custom field], is it because i moved the items from original structure and the "add to cart" button refused to work?


Thank You

original layout


i.imgur.com/mu3fxJk.jpg


i.imgur.com/tHhBbUW.jpg

Modified layout

i.imgur.com/mn3c2NK.jpg


i.imgur.com/UiEf4wt.jpg
Last edit: 11 years 3 months ago by veeco.

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

More
11 years 3 months ago #207043 by Xavier
Hi,

Giving the code of the show_default view will give us more details.
If you have moved elements out of the "form" HTML tags so yes that can't be working properly.

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

More
11 years 3 months ago - 11 years 3 months ago #207162 by veeco
Hi

i have attached the HTML of the new layout


This attachment is hidden for guests.
Please log in or register to see it.
Last edit: 11 years 3 months ago by veeco.

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

More
11 years 3 months ago #207210 by nicolas
Hi,

I can see that you completely altered the HTML of the page. That won't work.
If you look at the HTML of the original layout, you can see first the form of the product page, with all the divs with _main in their id. And you can see the second part with all the divs with a display:none style on them.
The characteristic system will replace the data in the _main divs with the data in the hidden divs based on what you select in the characteristic dropdowns so that you automatically see the data of the selected variant.
This also modifies the add to cart, product_id areas.
The way you modified the layout, that cannot work anymore and that's why you get that problem.

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

More
11 years 3 months ago - 11 years 3 months ago #207446 by veeco
Hi

after further inspection, turns out my form missing product id input field in it

after i put the input, it worked normally


Code:
<span id="hikashop_product_id_main" class="hikashop_product_id_main"> <input type="hidden" name="product_id" value="<?php echo $this->element->product_id; ?>" /> </span>
Last edit: 11 years 3 months ago by veeco.

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

Time to create page: 0.174 seconds
Powered by Kunena Forum