2

Is there a way to update the shipping methods when clicked on my custom checkbox attribute? When I change the city or the postal code the shipping method reloads but not with my custom checkbox.

Thanks!

I

  • Hello, Please give me your attribute name. – Tushar May 9 '19 at 4:12
0

Hello Please follow below path and add your custom attribute add in this js file.

vendor/magento/module-offline-shipping/view/frontend/web/js/model/shipping-rates-validation-rules/tablerate.js

/** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */

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

    return {
        /**
         * @return {Object}
         */
        getRules: function () {
            return {
                'postcode': {
                    'required': true
                },
                'country_id': {
                    'required': true
                },
                'region_id': {
                    'required': true
                },
                'region_id_input': {
                    'required': true
                },
                'attribute_name':{
                  'required': true
                }
            };
        }
    };
});

After a change in this file please override in your module and please change add in pub static file.

| improve this answer | |
  • Thanks Tushar but this doesn´t make my shipping methods reload :( – Gonzalo Gutiérrez May 9 '19 at 22:52

Your Answer

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

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