Вопрос

I keep getting a JS error in my site, it's an ajax get request to http://domain.com/customer/section/load/?sections=instant-purchase&update_section_id=false&_=1517327157790 which results in a "code 400 Bad request".

It gets called by the Instant Purchase module - which is disabled in my Magento 2.2.2 site.

What could cause this?

My understanding is that the sections.xml file does this, but if the module is disabled, it should stop, right?

What am I missing?

Это было полезно?

Решение

See my answer for a different question concerning similar issues:

https://magento.stackexchange.com/a/213550/14403

I believe this will work for you concerning instant-purchase as well.

Другие советы

Fixed this using window on load:

    <script type="text/javascript">
require([
        'jquery'
    ],
    function($) {
        $(window).on("load", function() {
            require([
                'Magento_Checkout/js/model/cart/totals-processor/default',
                'Magento_Customer/js/customer-data',
                'Magento_Checkout/js/model/quote',
                'Magento_Checkout/js/model/shipping-rate-processor/new-address',
                'Magento_Checkout/js/model/shipping-rate-processor/customer-address',
                'Magento_Checkout/js/model/shipping-rate-registry'
            ], function(defaultTotal, customerData, quote, defaultProcessor, customerAddressProcessor, rateRegistry) {
                $(document).ready(function() {

                    /** Do your code here */
                });

            });
        });
    });
</script>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top