No announcement yet.

How to create an out of stock badge?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to create an out of stock badge?

    I would like to create an out of stock badge that pops up over the upper right hand corner of the thumbnail when browsing items.

    Does anyone know if this is possible? I am comfortable editing the category.html file, I just don't know what bit of code I need to put in.

  • #2
    In order to do that, you would have to be able to access the database on the category page, for the products. This is not something that would be easy and would require custom programming on our part. The quicker solution would be to upload a new product thumbnail where you have included that graphic as part of the image


    • #3
      Does the product detail page have database access, for example via javascript? Not an attempt to solve the OP's question, but part of my quest to get a feel for how flexible the platform is.


      • #4
        So it turns out it was pretty easy to get "in stock" or "out of stock" to show up on the category page:

        PHP Code:
        div id="availability">[availability]</div>
        Is there anyway I can modify this code so that if its "in stock" nothing shows up, and if its out of stock something shows up? If i can get that far, then i can use CSS to place my out of stock .png file as the background of the "availability" div.

        Hold on! i just thought of something while typing this... the "put me on a waiting list" button only shows up if the item is out of stock... so i can look at that code and see if i can steal the bits i need... ill report back.