This topic contains 2 replies, has 2 voices, and was last updated by  famp 8 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • example Shopping Cart #85665

    famp
    Participant

    Hello , it is possible to give product also click on add to cart.

    I added this code , but without success.

     $('.draggable-demo-product').on('click', function (event) {
                        onCart = true;
                        var tshirt = $(this).find('.draggable-demo-product-header').text(),
                            price = $(this).find('.draggable-demo-product-price').text().replace('Price: €', '');
                        $('#cart').css('border', '2px solid #aaa');
                        price = parseInt(price, 10);
                        $(this).jqxDragDrop('data', {
                            price: price,
                            name: tshirt
                        }); 
                         if (onCart) { addItem({ price: event.price, name: event.name });
                             onCart=false;
                         }
                        
                    });
    example Shopping Cart #85669

    Dimitar
    Participant

    Hello famp,

    Here is how to implement your requirement:

    $('.draggable-demo-product').on('click', function (event) {
        var children = $(this).children(),
            price = $(children[1]).text().slice(8),
            name = $(children[0]).text();
    
        addItem({ price: parseFloat(price), name: name });
    });

    We hope this solution is helpful to you.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    example Shopping Cart #85695

    famp
    Participant

    thank you very much , perfect

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.