stolarz Posted August 28, 2014 Share Posted August 28, 2014 I've got some issue with Prestashop product-list. Here is a link to my site: http://vigdm.no-restrictions.com/index.php?id_category=29&controller=category You can see small link 'Add to cart' under each product. Unfortunately, the product is not added to cart. When I'm on product page, everytyhing works fine. The code is copied from the default prestatshop theme, it's goes like this: <div class = "cart-logo-on-product"> {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE} {if ($product.allow_oosp || $product.quantity > 0)} {if isset($static_token)} <a id="add_to_cart" class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html'}" title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a> {else} <a id ="add_to_cart" class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}", false)|escape:'html'}" title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a> {/if} {else} <span class="exclusive"><span></span>{l s='Add to cart'}</span><br /> {/if} {/if} </div> I need to add product to cart from the product list, do you know what can be wrong? Link to comment Share on other sites More sharing options...
dioniz Posted August 28, 2014 Share Posted August 28, 2014 When i click on cart icon it takes me to cart pge and product is added to cart Link to comment Share on other sites More sharing options...
stolarz Posted August 28, 2014 Author Share Posted August 28, 2014 Yep, that's right, I've made it that way, but I need to aim another goal, after clicking on cart icon, the product should be added to cart and should not redirect me to the cart page. On the product page it works, but on the category page doesn't. I suspect that may be js issue, but now I stucked. Link to comment Share on other sites More sharing options...
vekia Posted August 28, 2014 Share Posted August 28, 2014 your button haven't got class param with necessary things: class="button ajax_add_to_cart_button btn btn-default" Link to comment Share on other sites More sharing options...
stolarz Posted September 2, 2014 Author Share Posted September 2, 2014 I've added this class, but adding still doesn't work. http://vigdm.no-restrictions.com/index.php?id_category=28&controller=category Could it be, that some javascript file block this action? Link to comment Share on other sites More sharing options...
vekia Posted September 2, 2014 Share Posted September 2, 2014 in your button there is no data-products-id="" param with id of products it's necessary add it there after that it will start to work Link to comment Share on other sites More sharing options...
stolarz Posted September 3, 2014 Author Share Posted September 3, 2014 Thanks Vekia, it works!But when I add sth to cart, 'Koszyk' appears with nothing I need to reload site and there is no animation like when I add product from product site. Do you know how to make it works? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now