1

I have a custom field and customScope added with LayoutProcessor which works fine!

But I need to add custom validation stop submission if my custom doesn't meet the requirements :

Is just trowing amazon error for some reason:

Uncaught TypeError: setShippingInformationAction(...).done is not a function
    at setShippingInformationAmazon (shipping.js:60)
    at UiClass.setShippingInformation (shipping.js:76)
    at HTMLFormElement.<anonymous> (knockout.js:4640)
    at HTMLFormElement.dispatch (jquery.js:5232)
    at HTMLFormElement.elemData.handle (jquery.js:4884) 

no matter where I stop the form from submitting either Vendor_Module/js/action/set-shipping-information-mixin:

/*jshint browser:true jquery:true*/
/*global alert*/
define([
    'jquery',
    'mage/utils/wrapper',
    'Magento_Checkout/js/model/quote'
], function ($, wrapper, quote) {
    'use strict';

    return function (setShippingInformationAction) {

        return wrapper.wrap(setShippingInformationAction, function (originalAction) {
            var shippingMethod = quote.shippingMethod();
            if(shippingMethod['method_code'] === 'vendor_shipping') {
               console.log('vendor_shipping');
               return false;
            }
            return originalAction();
        });
    };
});

Or Vendor_Module/js/model/shipping-save-processor/default:

....
  return {
            saveShippingInformation: function () {
                console.log('OVER HERE');
                var payload;

                if($('select[name="vendor_selector_drop_down"]').val() === '') {
                    console.log('invalid here');
                    return false;
                }
                if (!quote.billingAddress()) {
                    selectBillingAddressAction(quote.shippingAddress());
                }
       ...

Why is Amazon interfering with it I haven't enable it ? Could this be a bug anyone else doing something similar and have seem this and any advice appreciated thanks!

1 Answer 1

0

@Juliano Vargas Have you got the answer for this above issue, currently I'm faced the same issue in magento V2.4.5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.