Showing of Specification on PDP page for Matrix items.

When the options of matrix item selected (here color is selected), then corresponding details of that child item also show in the website.  

Create a custom field in NetSuite by using follow steps
1. Go to Customization > Lists, records & Fields > item fields > New

2. Enter a Label ” Specification data” for the field that will be displayed on the website.

3. Choose the field type “Rich text”.

4. Added the description to show specification details in the website while selecting item option.

5. On the New Entity Field page, select inventory, non inventory item, service, kit/package under the “Applies To” section.

6. Added the field help content “Add the specification of the item to show it in the website“.

6.Click the Save button to create the field.

in .js file

_.extend(ProductLineSkuView.prototype, {
				getContext: _.wrap(ProductLineSkuView.prototype.getContext, function (fn) {
					var context = fn.apply(this, _.toArray(arguments).slice(1));
					console.log("context ", context);
					console.log("this ", this);
					var currentchild = context.sku;
					var self = this;
					_.each(this.model.get("item").get("matrixchilditems_detail"), function (matrixitemss) {
						console.log("matrixitemss", matrixitemss)
						console.log("currentchild", currentchild)
						if (currentchild == matrixitemss.itemid) {
							console.log("matches the itemids", matrixitemss.custitem_jj_specification_data)
							var currentspecificvalue = matrixitemss.custitem_jj_specification_data;
							context.specificvalue = currentspecificvalue;
							console.log('currentspecificvalue', currentspecificvalue);
							// self.model.set('currentcleerlinevalue', currentcleerlinevalue);							
						}
						
					})
					
					console.log('context4',context);
					return context;
				}),
				childViews: _.extend(ProductLineSkuView.prototype.childViews, {
					'ProductPersonalization.Options': function () {
						console.log("this of my childview", this)
					}
				})
			})

update in .tpl file

<div class="product-specific-value">
		<span class="product-line-specific-label">
			<br><h3>{{translate 'Specification data: '}}</h3>
			
		</span>
		<span class="product-line-specific-value" itemprop="sku">
			{{specificvalue}}
		</span>
	</div>

Leave a comment

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