Based on subsider how to set the delivery method from the customer record

UK subsidiary when not selected any delivery Method it should show all the values in the shipping Method and when selected any option from customer record need to show only selected record in the webstore.


                _.extend(OrderWizardModuleShipmethod.prototype, {
                    template: jj_deliverymethoduk_deliverymethoduk_tpl,
                    getContext: _.wrap(OrderWizardModuleShipmethod.prototype.getContext, function(fn) {
                        var context = fn.apply(this, _.toArray(arguments).slice(1));
                        var profile = ProfileModel.getInstance();
                        var subsidiary = profile.get('subsidiary');
                        var shippingMethod = this.model.attributes.shipmethod

                        if (subsidiary == 12) {
                            console.log("context", context.shippingMethods);
                            var shippingMethodOptions = context.shippingMethods;

                            // Sort the array based on isActive status (true before false)
                            shippingMethodOptions.sort(function(a, b) {
                                if (a.isActive && !b.isActive) {

                            if (selectedoption.length > 0) {
                                context.shippingMethods = selectedoption;
                            }
                            console.log('KJDSAFKJHAUDhf ADHF', context);
                        } else {
                            console.log("Handle logic for non-subsidiary 12");
                            console.log("Error",Error);
                        }
                        // context.shippingMethodOptions = selectShippingOptions;
                        return context;

                    })
                })
          

Leave a comment

Your email address will not be published. Required fields are marked *