Do not generate page if "Quantity on Hand:" is (0)

General ShopSite user discussion

Do not generate page if "Quantity on Hand:" is (0)

Postby dmsid » Thu Dec 07, 2006 7:25 am

What template code would I use and where would I place it if I would like to have ShopSite NOT generate a page if the Quantity on Hand: was equal to zero.

We do not want to even display products that are not in-stock, but think having to remove a product from all pages, etc is not a good use of our time. We would have to remember what pages it was on, etc. Then the next day we would have to add it back to all the pages we took it off from, etc. Doing that with 100's of products is not a solution.

We would just like to import a XLS sheet with product inventory levels and then just regenerate the site. If the Product inventory was zero, the page would not be created. Simple. It would work well for us and maybe you.

I understand that if the quantity falls to zero on the item while on the sever the page will display until the next time we generate the store. We have no problem with that, as we generate often.

We have asked ShopSite for several years to add a simple feature to the software that would do just this, but it is never added.

[ ] Do not display product if quantity zero.

Thanks for the help in advance.

P.S. Barney, thanks we do not need OrderManager at this time. :D
dmsid
 
Posts: 29
Joined: Tue Aug 29, 2006 10:15 am

Postby Jim » Thu Dec 07, 2006 9:01 am

Simple to do in a custom template. In the product template put code like this

[-- if product.quantityonhand 0 --]
# don't do anything
[-- else --]

put your current product template code here

[-- end_if --]

I have seen sites that change the add to cart button to an Out of Stock image using something like the above around the add to cart code. That way people still can tell you carry the product but that it is currently unavailable.

If you are using moreinfo pages any existing page would not be deleted so you would want to have the moreinfo page regenerated with a message saying the product is temporairly not available. This could also be done using code like that above in the moreinfo section of the product template.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Thanks. Specific File

Postby dmsid » Thu Dec 07, 2006 9:56 am

Thank you very much. :)

We are new to editing ShopSite template files, but not new to coding other things.

Can you please tell me the specific file to edit in the cgi-bin/sc/templates area.

Once we get to the file we should be able to take it from there. :shock:

All the best,
-Jon
dmsid
 
Posts: 29
Joined: Tue Aug 29, 2006 10:15 am

Postby Jim » Thu Dec 07, 2006 10:57 am

DO NOT EDIT TEMPLATES IN THE cgi-bin/sc/templates area. Those templates will be overwritten when your store is upgraded to a new version of ShopSite.

Go to the Merchandising > Custom templates area in the backoffice of the store and make a copy of the ShopSite template and edit that template. As to which one needs to be edited that depends on the template you are using. You may also need to edit several files since some sections of the product templates come from "include" files. You can determine which template needs to be modified by seeing which template is assigned to your products under Products >Edit Product Layout.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Thanks

Postby dmsid » Thu Dec 07, 2006 10:58 am

Thanks. Will give it a try!
dmsid
 
Posts: 29
Joined: Tue Aug 29, 2006 10:15 am

Works great. Added another feaure.

Postby dmsid » Thu Dec 07, 2006 1:10 pm

Thanks for the help.

Also created a master on/off switch for the product using an extra database field. If this field is not set to 1 then the product will not display no matter what the inventory is.

# CHECK FOR ACTIVE PRODUCT
[-- IF PRODUCT.Field1 1 --]

current product template code here

[-- END_IF --]
dmsid
 
Posts: 29
Joined: Tue Aug 29, 2006 10:15 am

Close but not close enough

Postby dmsid » Thu Dec 07, 2006 10:56 pm

OK, I get the products not to list, but they still leave gaps on the pages.

I have a six page listing with one item on the first page, two blank pages of lists and then a page with a listing, etc.

So it is not listing the product information on the page, but it is still make room for the product on the page with blanks and counts them for the page breaks.

Work around, or code not in the right place, or just no real way to do this.

I can not understand why this software does not have an active / unactive button for each product. Miva and other software have it. Have asked ShopSite for years on this one point. :cry:
dmsid
 
Posts: 29
Joined: Tue Aug 29, 2006 10:15 am

Postby Jim » Fri Dec 08, 2006 6:46 am

Need more info.
What do you mean by gaps? Is this a page in your store or a search results page?
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 87 guests

cron