Jump to content

Edit History

Hadrien

Hadrien


Resolved

Hello,

Thank for your response @elboletaire 

I have a question

with the custom js like you explain, it show the error message and doesn't show the modal popup, perfect !

But when I have no error on my hookActionCartUpdateQuantityBefore, and the product is well added to the cart, the modal popup doesn't appear either

is this the normal behavior? how can I do to display the modal popup if I have no error on my hookActionCartUpdateQuantityBefore please ?

If I delete this code :

    prestashop.blockcart.showModal = function (modal) {
        // if we're getting errors, do not show the modal
        if (errors.length) {
            return;
        }

        var $body = $('body');
        $body.append(modal);
        $body.one('click', '#blockcart-modal', function (event) {
            if (event.target.id === 'blockcart-modal') {
                $(event.target).remove();
            }
        });
    }

Then the modal popup is well appear if no error on hookActionCartUpdateQuantityBefore  , but appear too if I have error on hookActionCartUpdateQuantityBefore  

Thank you

Autoresponse : by adding 'hasError' => true, it works without adding the custom js

Hadrien

Hadrien

Hello,

Thank for your response @elboletaire 

I have a question

with the custom js like you explain, it show the error message and doesn't show the modal popup, perfect !

But when I have no error on my hookActionCartUpdateQuantityBefore, and the product is well added to the cart, the modal popup doesn't appear either

is this the normal behavior? how can I do to display the modal popup if I have no error on my hookActionCartUpdateQuantityBefore please ?

If I delete this code :

    prestashop.blockcart.showModal = function (modal) {
        // if we're getting errors, do not show the modal
        if (errors.length) {
            return;
        }

        var $body = $('body');
        $body.append(modal);
        $body.one('click', '#blockcart-modal', function (event) {
            if (event.target.id === 'blockcart-modal') {
                $(event.target).remove();
            }
        });
    }

Then the modal popup is well appear if no error on hookActionCartUpdateQuantityBefore  , but appear too if I have error on hookActionCartUpdateQuantityBefore  

Thank you

Hadrien

Hadrien

Hello,

Thank for your response @elboletaire 

I have a question

with the custom js like you explain, it show the error message and doesn't show the modal popup, perfect !

But when I have no error on my hookActionCartUpdateQuantityBefore, and the product is well added to the cart, the modal popup doesn't appear either

is this the normal behavior? how can I do to display the modal popup if I have no error on my hookActionCartUpdateQuantityBefore please ?

Thank you

×
×
  • Create New...