Добрый день! Просмотрел уже весь интернет, так и ничего не нашел подходящего. Работает, но с костылями...
Имеется стандартный wishlist, добавляю кнопку в файл таким кодом
themes/your_template/modules/blockwishlist/views/templates/front/managewishlist.tpl
<a class="exclusive button ajax_add_to_cart_button add-to-cart-in-wl" href="{$link->getPageLink('cart', true, NULL, "qty={$product.quantity|intval}&id_product={$product.id_product|intval}&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>
Далее прописываю код в файле
themes/your_template/js/modules/blockcart/ajax-cart.js
событию .ajax_add_to_cart_button
$(document).off('click', '.ajax_add_to_cart_button').on('click', '.ajax_add_to_cart_button', function(e){
e.preventDefault();
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);
});
Кнопка добавляется. При нажатии на нее добавляется товар без проблем в корзину, даже количество сохраняется. НО вот комбинация товара добавляется стоковая. Подскажите, пожалуйста что не так? заранее спасибо!