문제

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