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!
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityIs 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!
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.