Jump to content

Combinations product

Evgeny Oleinikov

Recommended Posts

Hello! Can you help me, please! I add to my wishlist next button with code 

<a class="exclusive button ajax_add_to_cart_button add-to-cart-in-wl" href="{$link->getPageLink('cart', true, NULL, "qty={$product.quantity|intval}&amp;id_product={$product.id_product|intval}&amp;add")|escape:'html':'UTF-8'}" data-id-attribute="{$product.id_product_attribute}" data-id-product="{$product.id_product|intval}" data-minimal_quantity="{$product.quantity|intval}" title="{l s='Add to cart' mod='blockwishlist'}"><span>{l s='Add to cart' mod='blockwishlist'}</span></a>

And change values in ajax-cart.js file.

$(document).off('click', '.ajax_add_to_cart_button').on('click', '.ajax_add_to_cart_button', function(e){
var idProduct =  parseInt($(this).data('id-product'));
var idProductAttribute =  parseInt($(this).data('id-product-attribute'));
var minimalQuantity =  parseInt($(this).data('minimal_quantity'));
if ($(this).is('.add-to-cart-in-wl')) {
quan = $(this).closest('.product_infos').find('.wishlist_product_detail input.form-control').val();
if (quan != minimalQuantity)
minimalQuantity = quan;
if (!minimalQuantity)
minimalQuantity = 1;
if ($(this).prop('disabled') != 'disabled')
ajaxCart.add(idProduct, idProductAttribute, false, this, minimalQuantity);

Quantities are added correctly to cart but combinations are added stock always. Not those in wishlist. 


Edited by Evgeny Oleinikov (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...