Free Shipping Badge

In this extension, we need to create a checkbox for a free shipping badge. if it is checked then need to show it UI otherwise not

If we need to show a free shipping badge on PLP, Then we need to extend the facetitemcellview.

var originalRet = fn.apply(this, _.toArray(arguments).slice(1));
	originalRet.badge = this.model.attributes.custitem3
	return originalRet;

Create a view for showing the badge in template

if (PLP) {

					var pricing = PLP.getItemInfo();
					PLP.addChildView('mapprice', function () {
						return new MapPriceView({
							PLP: PLP,

						});
					});
				}

We can simple call the data view in template as

<div data-view=”mapprice”></div>

Leave a comment

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