必须单击两次将产品添加到jquery中的购物车(带有woocommerce产品网址)?

时间:2018-09-14 23:40:21

标签: jquery wordpress url woocommerce

当用户单击保留在同一页面(带有jquery)的按钮时,我正在将产品添加到购物车,但是用户必须单击两次才能将产品放入购物车。

如何仅单击一次并将产品添加到购物车?我在这里想念什么?

("#context-menu-addcart").click(function(event) {

        event.preventDefault();

        //url to the selected product (i.e. http://mystore.com/?add-to-cart=123)
        var wnd = window.open(selectedItem.metadata.productId);

        wnd.close();

        alert(selectedItem.metadata.itemName + " added to your cart.");

    });

0 个答案:

没有答案
相关问题