wishlist_mv: function(e){
        var tr = $(e.currentTarget).parents('tr');
        var product = tr.data('product-id');

        $('#my_cart').removeClass('hidden');
        website_sale_utils.animate_clone($('#my_cart'), tr, 25, 40);
        var adding_deffered = this.add_to_cart(product, tr.find('qty').val() || 1);
        this.wishlist_rm(e, adding_deffered);
    },
    wishlist_add: function(e){
        var tr = $(e.currentTarget).parents('tr');
        var product = tr.data('product-id');

        // can be hidden if empty
        $('#my_cart').removeClass('hidden');
        website_sale_utils.animate_clone($('#my_cart'), tr, 25, 40);
        this.add_to_cart(product, tr.find('qty').val() || 1);
    },
Esempio n. 3
0
    _addOrMoveWish: function (e) {
        var tr = $(e.currentTarget).parents('tr');
        var product = tr.data('product-id');
        $('#my_cart').removeClass('d-none');
        wSaleUtils.animateClone($('#my_cart'), tr, 25, 40);

        if ($('#b2b_wish').is(':checked')) {
            return this._addToCart(product, tr.find('qty').val() || 1);
        } else {
            var adding_deffered = this._addToCart(product, tr.find('qty').val() || 1);
            this._removeWish(e, adding_deffered);
            return adding_deffered;
        }
    },
Esempio n. 4
0
            ).then(function (productId) {
                productId = parseInt(productId, 10);

                if (!productId) {
                    return;
                }

                self._addNewProducts(productId);
                website_sale_utils.animateClone(
                    $('#comparelist .o_product_panel_header'),
                    $elem.closest('form'),
                    -50,
                    10
                );
            });
Esempio n. 5
0
 $('.oe_website_sale .o_add_compare, .oe_website_sale .o_add_compare_dyn').click(function (e){
     if (self.comparelist_product_ids.length < self.product_compare_limit) {
         var prod = $(this).data('product-product-id');
         if (e.currentTarget.classList.contains('o_add_compare_dyn')) {
             prod = $(this).parent().find('.product_id').val();
             if (!prod) { // case List View Variants
                 prod = $(this).parent().find('input:checked').first().val();
             }
             prod = parseInt(prod, 10);
         }
         self.add_new_products(prod);
         website_sale_utils.animate_clone($('#comparelist .o_product_panel_header'), $(this).closest('form'), -50, 10);
     } else {
         self.$('.o_comparelist_limit_warning').show();
         self.show_panel(true);
     }
 });
 }).then(function () {
     self.wishlist_product_ids.push(product_id);
     self.update_wishlist_view();
     website_sale_utils.animate_clone($('#my_wish'), $el.closest('form'), 25, 40);
     $el.prop("disabled", true).addClass('disabled');
 });
Esempio n. 7
0
 }).then(function () {
     self.wishlistProductIDs.push(productId);
     self._updateWishlistView();
     wSaleUtils.animateClone($('#my_wish'), $el.closest('form'), 25, 40);
 }).guardedCatch(function () {