Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
 
How can out of stock items be made to not show as available?
Posted: 16 March 2011 08:06 AM   [ Ignore ]
Circled in the Yearbook
RankRankRank
Total Posts:  701
Joined  2010-04-08

CT: 2.0293

Im my demo the box quantity of 150 has an inventory of zero, but is still showing in the drop down as available. It’s not till you try and add it to the cart that an error message say the item is out of stock.

Demo: http://www.ecommerceblogger.com/index.php/screws/detail

[ Edited: 19 March 2011 11:14 AM by Rob Sanchez ]
Profile
 
 
Posted: 16 March 2011 01:39 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

You should be able to use a template conditional like this:

{if product_inventory 0}
   ADD ITEM
{if
:else}
    ITEM OUT OF STOCK
{
/if} 
Profile
 
 
Posted: 16 March 2011 01:51 PM   [ Ignore ]   [ # 2 ]
Circled in the Yearbook
RankRankRank
Total Posts:  701
Joined  2010-04-08

Yes but the quantity is displayed in a select, like:

Box quantity: {item_options:select:box_quantity}

Profile
 
 
Posted: 16 March 2011 01:52 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

quantity and inventory are two separate things. What I’d do is place your entire add_to_cart_form inside a conditional checking for product_inventory > 0.

Profile
 
 
Posted: 16 March 2011 02:07 PM   [ Ignore ]   [ # 4 ]
Circled in the Yearbook
RankRankRank
Total Posts:  701
Joined  2010-04-08

quantity and inventory are two separate things.

Isn’t inventory depleted when a quantity is purchased?

box_quantity is a modifier field which is set as the “Product Inventory Field Name” so that inventory can be managed per option. With inventory set at zero for option_name 150, I was expecting it not to show in the select.

Image Attachments
field.pngquantity.png
Profile
 
 
Posted: 16 March 2011 02:13 PM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

I see what you’re saying now. No it doesn’t do that automatically, but you should be able to make it a tag pair and then:

{item_options:select:box_quantity}
{if inventory 
0}
<option value="{option_value}"{selected}>{option_name}</option>
{/if}
{
/item_options:select:box_quantity} 
Profile
 
 
Posted: 16 March 2011 02:21 PM   [ Ignore ]   [ # 6 ]
Circled in the Yearbook
RankRankRank
Total Posts:  701
Joined  2010-04-08

Thanks for the code, working nicely. Be nice if it was a built in feature though and the if wasn’t needed.

Profile