質問

I want to add loading effect before ajax call of remove product from the mini cart.

Right now when I remove the product from the cart, It takes 4-5 seconds to delete but user cannot identify whether the process is going on or not.

I tried to find JS file for the responsible code but not able to find it.

Does anyone have an idea which JS file contains code to call AJAX to remove the product from the cart?

enter image description here

役に立ちましたか?

解決

You can check below file

/vendor/magento/module-checkout/view/frontend/web/js/sidebar.js

it has events on click, can find something like _removeItem

If you are using any custom theme, it may be there under Magento_Checkout modules directory

他のヒント

I override below file in my custom theme

/vendor/magento/module-checkout/view/frontend/web/js/sidebar.js

In place of _removeitem I put in _ajax method.

I show loading effect in beforeSend of that method and hide in complete

ライセンス: CC-BY-SA帰属
所属していません magento.stackexchange
scroll top