0

If Free Shipping Method is selected change validation E.G:'validation' => ['required-entry' => false],

...
'custom_field' => [
    'component' => 'Vendor_Module/js/custom-field-component',
    'config' => [
        'customScope' => 'shippingAddress.custom_attributes',
        'template' => 'ui/form/field',
        'elementTmpl' => 'Vendor_Module/fields/select',
        'options' => $this->getOptions(),
        'id' => 'custom_field'
    ],
    'dataScope' => 'custom_scope.custom_field',
    'label' => 'Select Option',
    'provider' => 'checkoutProvider',
    'visible' => true,
    'validation' => ['required-entry' => true],
    'sortOrder' => 20,
    'id' => 'custom_field'
]
...

enter image description here

I have added a mixin for select shipping method :

define([
    'jquery'
], function ($) {
    'use strict';

    return function (target) {
        return function (shippingMethod) {
            //Add Remove Validation Logic Goes Here.
            // call original method
            target(shippingMethod);
        };
    }
});

Any ideas how to achieve this? Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.