Customizing checkout steps

In case of a domain have both customer and dealer login. For dealer we have to show the single page checkout having the payment page and review page but for the customer we have to show the standard checkout page.

In this scenario we can select the standard checkout on the configuration to display the standard checkout for the customers

In case of the dealers, we required to perform the customization on the checkout steps, we can extend the WizardStepNavigationView to perform the functionality

_.extend(WizardStepNavigationView.prototype, {
getContext: _.wrap(WizardStepNavigationView.prototype.getContext, function (fn) {
var originalRet = fn.apply(this, _.toArray(arguments).slice(1));
console.log("step group",originalRet);
var array = originalRet.stepGroups;
for (var i = 0; i < array.length; i++) {
if (originalRet.stepGroups[i].name ===". Shipping Address" ) {
array = _.reject(array, function (method) {
return method.name == originalRet.stepGroups[i].name;
});

}
if (originalRet.stepGroups[i].name ===". Billing Address" ) {
array = _.reject(array, function (method) {
return method.name == originalRet.stepGroups[i].name;
});
}
}
for (var i = 0; i < array.length; i++) {
array[i].counter = i + 1;
}
originalRet.stepGroups=array;
console.log("after removing step group",originalRet);
return originalRet;
}),
})

Leave a comment

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