Disable ordering for a subproduct when using qty input box

Questions and answers about ShopSite Custom Templates

Disable ordering for a subproduct when using qty input box

Postby shpste » Thu May 13, 2021 11:31 am

I have a product with several sub products and I need to disable add to cart/ordering etc to some of the subproducts.

I have price toggle, display order quantity, display quantity pricing, display ordering options all unchecked, and display add to cart set to Not Displayed, but the sub product still shows up with a checkbox and qty box.

Any idea how to just list the sub product without the checkbox and qty for a particular sub product?

Here's what I currently have for the sub product area of the template BB-Product.sst

[-- DEFINE SUBPRODUCT --][-- IF VAR.SubProductType "select" --]<option value="[-- PRODUCT.RecordNumber --]">[-- IF PRODUCT.DisplayName --][-- PRODUCT.Name REMOVE_HTML --] [-- ELSE_IF PRODUCT.DisplaySku --][-- IF PRODUCT.Sku --][-- PRODUCT.Sku --][-- END_IF --][-- END_IF --][-- IF PRODUCT.DisplayPrice --] [-- IF PRODUCT.SaleAmount --][-- IF PRODUCT.SaleOn --]([-- PRODUCT.SaleAmount --] [-- STORE.OnSaleText --])[-- ELSE --]([-- PRODUCT.Price --])[-- END_IF --][-- ELSE --]([-- PRODUCT.Price --])[-- END_IF --][-- END_IF --]</option>
[-- ELSE --]<span class="bb-sub"><input type="[-- VAR.SubProductType --]" name="itemnum" value="[-- PRODUCT.RecordNumber --]"> Qty: <input type="text" size="3" value="1" name="[-- PRODUCT.RecordNumber --]:qnty">[-- IF PRODUCT.MinimumQuantity GE "1" --]<input type="hidden" name="[-- PRODUCT.RecordNumber --]:qnty" value="[-- PRODUCT.MinimumQuantity --]">[-- END_IF --][-- IF PRODUCT.DisplayName --][-- PRODUCT.Name REMOVE_HTML --] [-- ELSE_IF PRODUCT.DisplaySku --][-- IF PRODUCT.Sku --][-- PRODUCT.Sku --][-- END_IF --][-- END_IF --][-- IF PRODUCT.DisplayPrice --][-- IF PRODUCT.SaleAmount --][-- IF PRODUCT.SaleOn --]<span class="bb-prodprcreg">[-- PRODUCT.Price --]</span> <span class="bb-prodprcsale bb-subprcsale">[-- PRODUCT.SaleAmount --]</span>[-- ELSE --]<span class="bb-subprc [-- PRODUCT.PriceStyle --] [-- PRODUCT.PriceSize --]">[-- PRODUCT.Price --]</span>[-- END_IF --][-- ELSE --]<span class="bb-subprc [-- PRODUCT.PriceStyle --] [-- PRODUCT.PriceSize --]">[-- PRODUCT.Price --]</span>[-- END_IF --][-- END_IF --]</span>
[-- END_IF --][-- END_DEFINE SUBPRODUCT --]
shpste
 
Posts: 5
Joined: Wed Oct 10, 2018 12:33 pm

Re: Disable ordering for a subproduct when using qty input b

Postby ShopSite Lauren » Mon May 17, 2021 6:39 pm

You should be able to have code similar to the following, then go to Products > Edit Product Layout (for the subproduct items you don't want the checkbox displayed for) and change the "Display Add To Cart" setting to "Not Displayed".

Code: Select all
[-- DEFINE SUBPRODUCT --][-- IF VAR.SubProductType "select" --]<option value="[-- PRODUCT.RecordNumber --]"[-- IF PRODUCT.DisplayAddtoCart "Not Displayed" --] disabled[-- END_IF --]>[-- IF PRODUCT.DisplayName --][-- PRODUCT.Name REMOVE_HTML --] [-- ELSE_IF PRODUCT.DisplaySku --][-- IF PRODUCT.Sku --][-- PRODUCT.Sku --][-- END_IF --][-- END_IF --][-- IF PRODUCT.DisplayPrice --] [-- IF PRODUCT.SaleAmount --][-- IF PRODUCT.SaleOn --]([-- PRODUCT.SaleAmount --] [-- STORE.OnSaleText --])[-- ELSE --]([-- PRODUCT.Price --])[-- END_IF --][-- ELSE --]([-- PRODUCT.Price --])[-- END_IF --][-- END_IF --]</option>
[-- ELSE --]<span class="bb-sub">[-- IF PRODUCT.DisplayAddtoCart "Not Displayed" --][-- ELSE --]<input type="[-- VAR.SubProductType --]" name="itemnum" value="[-- PRODUCT.RecordNumber --]"> Qty: <input type="text" size="3" value="1" name="[-- PRODUCT.RecordNumber --]:qnty">[-- IF PRODUCT.MinimumQuantity GE "1" --]<input type="hidden" name="[-- PRODUCT.RecordNumber --]:qnty" value="[-- PRODUCT.MinimumQuantity --]">[-- END_IF --][-- END_IF --][-- IF PRODUCT.DisplayName --][-- PRODUCT.Name REMOVE_HTML --] [-- ELSE_IF PRODUCT.DisplaySku --][-- IF PRODUCT.Sku --][-- PRODUCT.Sku --][-- END_IF --][-- END_IF --][-- IF PRODUCT.DisplayPrice --][-- IF PRODUCT.SaleAmount --][-- IF PRODUCT.SaleOn --]<span class="bb-prodprcreg">[-- PRODUCT.Price --]</span> <span class="bb-prodprcsale bb-subprcsale">[-- PRODUCT.SaleAmount --]</span>[-- ELSE --]<span class="bb-subprc [-- PRODUCT.PriceStyle --] [-- PRODUCT.PriceSize --]">[-- PRODUCT.Price --]</span>[-- END_IF --][-- ELSE --]<span class="bb-subprc [-- PRODUCT.PriceStyle --] [-- PRODUCT.PriceSize --]">[-- PRODUCT.Price --]</span>[-- END_IF --][-- END_IF --]</span>
[-- END_IF --][-- END_DEFINE SUBPRODUCT --]
- ShopSite Lauren
Contact me for help with any of your
custom ShopSite template questions.
ShopSite Lauren
 
Posts: 887
Joined: Fri Aug 11, 2006 1:35 pm
Location: Orem, UT

Re: Disable ordering for a subproduct when using qty input b

Postby shpste » Tue May 18, 2021 6:18 am

Thanks so much! I'll give this a try.
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 9 guests

cron