Availability conditional statement
Im looking to show the $$AVAILABILITY$$ of a product only if it is out of stock.
I tried to create a conditional but so far no good.
##SET[var=##AVAILABILITY##]##
##IF[var=false]##
<h3>Out of Stock</h3>
##ELSE##
##ENDIF##
I'm new to this system and I don't quite understand how to do this. Please help!!
-
Im really looking to do something like this:
##SET[PStatus=##PRODUCTSTATUS##]##
##IF[PStatus=TRUE]## <h3>out of stock</h3>##ELSE## $$ADDTOCART$$ ##ENDIF##but its not working. Im missing a bunch of stuff, but I dont know how to implement it. How do i set it so that when PRODUCTSTATUS is out of stock the message appears and the cart add cart is not visible?
-
Hey Adam,
You may not need the merge codes at all. Looks like you're trying to hide the add to cart button if the product is out of stock. This can be done by editing the out of stock status in Settings > Catalog > Product Statuses, and checking "Unavailable". This will remove the add to cart button for out of stock products.
I think what you're probably wanting to do with the merge codes is this:
##SET[PStatus=##PRODUCTSTATUS##]##
##IF[PStatus=Out of Stock]##
<h3>out of stock</h3>
##ELSE##
$$ADDTOCART$$
##ENDIF##
Cheers,
Austin
SPOS Support
Please sign in to leave a comment.
Comments
4 comments