Out of stock message on product page

General ShopSite user discussion

Out of stock message on product page

Postby johnbiggscr » Fri Jan 13, 2012 8:04 am

We have to temporarily stop selling a product on one of our sites. We don’t know if this is a permanent thing or not and so we just want to state the product is out of stock rather than no longer available. I can get the site to come up with an out of stock message on the cart screen when a person adds to cart but is there an easy way to slap an out of stock tag/label/whatever on the product page itself so that people won’t try to put it into the cart in the first place?
Our site uses a matrix layout and we just want two of the products to now say out of stock. We also do not use the inventory stock system in general as a lot of our products are drop shipped. I would love it if we could just have a box on the product that says ‘mark as out of stock’ and it would replace the quantity cell with that info or something.

Anyone have any suggestions?





(We are using pro v11)
johnbiggscr
 
Posts: 68
Joined: Mon Mar 01, 2010 12:41 pm
Location: Cedar Rapids

Re: Out of stock message on product page

Postby Jim » Fri Jan 13, 2012 9:45 am

You could modify the product template so that it checks some field for a value and if that value is present then output an out of stock image instead of the normal add to cart code. For example, use the product Extra Field 1 to contain the indicator that the item is out of stock, "Out of Stock".
Code: Select all
[-- if product.field1 "Out of Stock" --]
    [-- OUTPUT_DIRECTORY_URL --]/media/outofstock.gif
[-- else --]
    [-- PRODUCT.OrderCheckout --]
[-- end_if --]

You code will probably be more complicated than that but basically you just add an IF statement around the add to cart code and test for the variable and if it is set out put the image otherwise output the normal add to cart code.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Out of stock message on product page

Postby johnbiggscr » Fri Jan 13, 2012 10:26 am

Actually that suggestion led me in a similar direction but I used the actual quantity field in shopsite instead with the following code:


[-- if PRODUCT.QuantityOnHand "0" --]
<img src="[-- OUTPUT_DIRECTORY_URL --]/media/design/outofstock.jpg">
[-- else --]
<input type="submit" value="[-- ADDTEXT --]">
[-- end_if --]

It seems to work perfectly so thank you for your original idea, it helped guide me.
johnbiggscr
 
Posts: 68
Joined: Mon Mar 01, 2010 12:41 pm
Location: Cedar Rapids


Return to User Forum

Who is online

Users browsing this forum: No registered users and 113 guests

cron