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!!
-
why don't you just change the out of stock line in your html and put the h3 tags the way you want and just check Out of Stock on the product page. Or are you not having Sp manage inventory?
0 -
Im pretty sure we do inventory. The overall goal is to display an message on the product page, preferably replacing the add cart button with the out of stock message. The availability message should only be displayed when out of stock.
0 -
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?
0 -
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
0
Please sign in to leave a comment.
Comments
4 comments