How to get the data specification pdf link from item record and show it under the download subtab in the PDP page

we can achieve this by get the field value from item record and then need to display it in the pdp page by using this method we can display the it in pdp page.

To get the field value from item record and then to display it in the pdp page, we used the below code.
_.extend(ProductDetailsFullView.prototype, {
getContext: _.wrap(ProductDetailsFullView.prototype.getContext, function(fn) {
var originalRet = fn.apply(this, _.toArray(arguments).slice(1));
var downloadTrue;
var info = originalRet.model.attributes.item.id;
var download1 = this.model.get('item').get('custitem_jj_spec_sheet_1');
var download2 = this.model.get('item').get('custitem_jj_spec_sheet_2');
var download3 = this.model.get('item').get('custitem_jj_spec_sheet_3');
var download4 = this.model.get('item').get('custitem_jj_spec_sheet_4');

if (download1 || download2 || download3 || download4){
downloadTrue = true;
}
else{
downloadTrue = false;
}
originalRet.download1 = download1;
originalRet.download2 = download2;
originalRet.download3 = download3;
originalRet.download4 = download4;
originalRet.downloadTrue = downloadTrue;

return originalRet;
})
});

Leave a comment

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