Add Qty input box to subproducts

Questions and answers about ShopSite Custom Templates

Add Qty input box to subproducts

Postby shpste » Wed Oct 10, 2018 12:42 pm

Currently products that do not contain sub-products have Qty: with an input box next to it, followed by an Add to Cart button.

I'd like for products that contain multiple sub-products to show the Qty: with the input box next to each sub product.

I've dug through the forums here, but I'm having trouble finding a solution.

Running ShopSite® Pro 14.0 r2 using the theme/template page BB-ProductPageContent-WithMenus.sst

Any help would be appreciated. Thanks!
shpste
 
Posts: 5
Joined: Wed Oct 10, 2018 12:33 pm

Re: Add Qty input box to subproducts

Postby cyoung » Thu Oct 25, 2018 9:41 am

You would need to edit the DEFINE SUBPRODUCT section in whichever template your subproducts are using. Typically the template the subproducts are using is the same template that all products are using, however with custom templates or specialty templates that are built into ShopSite a different subproduct template is specified. The BB-** themes have variables in their product templates to display the subproducts with either radio buttons, checkboxes or in a pull down menu. Most themes display the subproducts with radio buttons by default. If your subproducts are displayed with radio buttons currently, then you will want to edit the BB-Product.sst template (this is the default BB product template which has the default subproduct display). To edit this template go to Merchandising > Custom Templates > Page/Product > Copy ShopSite Template. Make a copy of the BB-Product.sst template, name it whatever you want. Save. Then make a copy of your copy and rename it the exact same name as the original. This will make it so that your copy overrides the original. Now you can edit the template.

In the template, on the 5th line of so, you will see the following code.

[-- ELSE --]<span class="bb-sub"><input type="[-- VAR.SubProductType --]" name="itemnum" value="[-- PRODUCT.RecordNumber --]"> .... then a whole bunch more code after this.


Add in the code in bold-blue below.

[-- ELSE --]<span class="bb-sub"><input type="[-- VAR.SubProductType --]" name="itemnum" value="[-- PRODUCT.RecordNumber --]"> Qty: <input type="text" value="1" name="[-- PRODUCT.RecordNumber --]:qnty">
cyoung
 
Posts: 134
Joined: Wed Nov 09, 2016 11:01 am

Re: Add Qty input box to subproducts

Postby shpste » Fri Oct 26, 2018 7:19 am

Thanks for your help, that worked great!!

cyoung wrote:You would need to edit the DEFINE SUBPRODUCT section in whichever template your subproducts are using. Typically the template the subproducts are using is the same template that all products are using, however with custom templates or specialty templates that are built into ShopSite a different subproduct template is specified. The BB-** themes have variables in their product templates to display the subproducts with either radio buttons, checkboxes or in a pull down menu. Most themes display the subproducts with radio buttons by default. If your subproducts are displayed with radio buttons currently, then you will want to edit the BB-Product.sst template (this is the default BB product template which has the default subproduct display). To edit this template go to Merchandising > Custom Templates > Page/Product > Copy ShopSite Template. Make a copy of the BB-Product.sst template, name it whatever you want. Save. Then make a copy of your copy and rename it the exact same name as the original. This will make it so that your copy overrides the original. Now you can edit the template.

In the template, on the 5th line of so, you will see the following code.

[-- ELSE --]<span class="bb-sub"><input type="[-- VAR.SubProductType --]" name="itemnum" value="[-- PRODUCT.RecordNumber --]"> .... then a whole bunch more code after this.


Add in the code in bold-blue below.

[-- ELSE --]<span class="bb-sub"><input type="[-- VAR.SubProductType --]" name="itemnum" value="[-- PRODUCT.RecordNumber --]"> Qty: <input type="text" value="1" name="[-- PRODUCT.RecordNumber --]:qnty">
shpste
 
Posts: 5
Joined: Wed Oct 10, 2018 12:33 pm


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 6 guests

cron