Submit a request

Availability conditional statement

Comments

4 comments

  • Avatar
    Paul Ackley

    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?

  • Avatar
    adam gonia

    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. 

  • Avatar
    adam gonia

    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?

  • Avatar
    AmeriCommerce Developer

    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.

We're Here To Help


Standard Support Hours: Monday-Friday 8AM-6PM CST
Looking for Premium Support? Just ask!

Speak to a live person
1 (800) 936-9006
Submit A Support Ticket
Submit Your Ticket Here