Saurabh More
Saurabh More

Reputation: 413

SuiteCommerce - show item inventory quantity on product page

I want to show the quantity available on the website's product page. I checked the web-store tab of the NetSuite item record but there seems no such field where I can populate this. Basically, I am trying to populate the stock's quantity available field.

Do I have to modify the code in tpl file for this? But the file is locked and there is read-only access to it.

Upvotes: 0

Views: 200

Answers (1)

bknights
bknights

Reputation: 15367

The general process is to create a custom_modules folder at the same level as the project's SuiteCommerce folder and then tell the project about that folder by including it in the distro.json file and building and publishing the project

In the custom_modules folder you create a section folder (in my example named [email protected])

and in that a Templates folder for your overrwritten template and also a ns.package.json where you tell SC about your overrides.

so in /custom_modules/[email protected]/ I have

ns.package.json

{
    "gulp": {
        "javascript": [
            "JavaScript/*"
        ],
        "sass": [
            "Sass/*.scss"
        ],
        "templates": [
            "Templates/*"
        ]
    }
    ,"overrides": {
    "suitecommerce/[email protected]/Templates/item_views_stock.tpl": "Templates/item_views_stock.tpl",

    }
}

and Templates/.

in /custom_modules/[email protected]/Templates I have, amongst other things not shown and paraphrased due to NS copyright,:

        <p class="">
            {{stockInfo.stock}}
        </p>

final piece is the distro.json folder where all your custom modules are at

{
...
    "modules":{
        ... maybe other custom modules
        "custom_modules/CustomItemViews": "1.0.2",
        ... suitecommerce modules
    }
}

Upvotes: 0

Related Questions