0

I want users to accept some terms and conditions for every product before adding to cart. That's why I want to add popup of terms and condition, this popup will open when user click add to cart or buy now button on PDP then if user accept it then only add to cart or buy now will happen otherwise do nothing. I tried adding popup like this for buy now but it's not working

require([ 'jquery', 'jquery/ui', 'Magento_Ui/js/modal/confirm'], function($, confirmation){
    $('#product-buynow-button').on("click", "#product-buynow-button", function() {
        confirmation({
            title: $.mage.__('Some title'),
        });
    });
});

Any help will be appreciated!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.