This extension is used to show the description under the specific commerce category pages.
When we create a custom category record might be shown on the configuration table and we can get the data easily by config data(it depends on the sca version)
Other cases we need to load the category in script side and get the value and pass to the frontend
Sample for loading:
try {
// nlapiLogExecution('DEBUG', 'details us', details);
var internal_id = JSON.stringify(details.data);
// nlapiLogExecution('DEBUG', 'bottom us', internal_id);
var parsedid = JSON.parse(internal_id);
var rec = nlapiLoadRecord('commercecategory', parsedid)
var bootomid = rec.getFieldValue('custrecord_bottom_description')||""
return bootomid
} catch (e) {
console.log(e);
}
For showing it on frontend
var model = new BottomDescriptionModel();
if (cate != undefined) {
var internalcategory = cate.internalid;
var self = this;
model.fetch({ data: { internalcategory: internalcategory } }).done(function(result) {
self.bottomresult = result
self.render()
});