Wednesday, June 26, 2019

WSDK > Item Stock Status Script > Display Text such as "In Stock" Instead of the Item Stock Status

When setting up item pages for an External Catalog Site, a user goes to Setup > Site Builder > Preview Web Site > HTML and URLs for querying items > Item Script Page to copy the scripts provided to integrate the items with NetSuite.  A sample Item Stock Status Script is by default set to:

 

where,

c  = Account Number/Company ID
n  = Site ID if Multiple Website is enabled
id = Internal Id of the item
outofstocktext = message displayed when the item's stock status is zero or less
prefixtext and suffixtext = creates a phrase containing the quantity on hand

The script above will display "Out of stock" when the item has no quantity available and will display "We have 999 left" when in stock with the actual quantity available for the item shown.

To display just a message without the stock quantity when items are in stock, users can make use of the instocktext parameter to set the in-stock text or message:

The above script will display "In stock" when the item has quantity available.

No comments:

Post a Comment