Chào mừng đến với nhà thuốc Phúc Vinh
Thanh toán
” ); $ .each (cart.items, function (i, item) clone_item (item); ); }); }; function clone_item (product) var item_product = $ (‘# clone-item .item_2’); item_product.find (‘img’). attr (‘src’, product.image); item_product.find (‘a: not (.remove-cart)’). attr (‘href’, product.url); item_product.find (‘. text_cart> h4> a’). html (product.title); var biến thể = ”; $ .each (product.variant_options, function (i, v) biến thể = biến thể + ” + v; ); item_product.find (‘. remove-cart’). attr (‘data-id’, product.variant_id); item_product.find (‘. variant’). html (variant); item_product.find (‘. price-line .new-price’). html (Haravan.formatMoney (product.price, “amount ₫”) + “x” + product.quantity + “”); item_product.clone (). removeClass (‘hidden’). prependTo (‘# view-cart’); $ (document) .on (“click”, “. remove-cart”, function () var index_view_cart = $ (this). parent (‘. item-cart’). index () – 1; $ (this). parent (‘. item-cart’). remove (); var variant_id = $ (this) .attr (‘data-id’); var params = gõ: ‘POST’, url: ‘/cart/change.js’, dữ liệu: ‘số lượng = 0 & id =’ + variant_id, dataType: ‘json’, thành công: function (giỏ hàng) nếu (cart.item_count> 0) $ (‘. ajax_cart_quantity’). html (cart.item_count); if (window.location.pathname == ‘/ cart’) $ (‘# total-carts’). html (Haravan.formatMoney (cart.total_price, “amount ₫”)); $ (‘# cartformpage tr.list-carts’). eq (index_view_cart) .remove (); ; $ (‘. cart_block_total’). html (Haravan.formatMoney (cart.total_price, “amount ₫”)); khác if (window.location.pathname == ‘/ cart’) $ (‘# cartformpage’). remove (); $ (‘# layout-page’). append (“
Không có sản phẩm nào trong giỏ hàng!
Tiếp tục mua hàng
“); $(‘.ajax_cart_quantity’).html(cart.item_count); $(‘#view-cart > div:not(#clone-item)’).remove(); $(‘#view-cart’).append(“”); , error: function(XMliên hệttpRequest, textStatus) Haravan.onError(XMliên lạcttpRequest, textStatus); ; jQuery.ajax(params); );
Các bài viết liên quan đến