Announcement

Collapse
No announcement yet.

Stock Indicator (In / Out of stock)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Stock Indicator (In / Out of stock)

    I'm trying to get the stock indicator to work. I want to display text or a GIF / BMP depending if the item is 'In Stock' or 'Out of Stock'.

    I have set up/populated the required fields relating to the product and I think I have turned on everything that I should have.

    Looking at the HTML pages I cannot find NETQUOTEVAR:OUTOFSTOCK (I think this is the correct code) on any of the product templates. If I add it and then upload the site the NETQUOTEVAR:OUTOFSTOCK is displayed on the screen as text. Should this have something in front of it?

    Any help would be much appreciated

    #2
    If you can use that variable then you will need to wrap it in <TAGS> as if it were a piece of text you wanted to display
    Owner of a broken heart

    Comment


      #3
      I've tried inserting the netq outofstock in two ways but it still displays netq outofstock as text on the screen.

      Please see below:-

      <NETQUOTEVAR:OUTOFSTOCK>
      NETQUOTEVAR:ADDTOCARTBUTTONNETQUOTEVAR:TEMPLATEENDXML

      NETQUOTEVAR:OUTOFSTOCK
      NETQUOTEVAR:ADDTOCARTBUTTONNETQUOTEVAR:TEMPLATEENDXML

      Comment


        #4
        Here's another approach (adapted from the Advanced User Guide)

        Include the following script function into the <HEAD> section of the Overall Layout template(s) for your store (normally Act_Primary.html):

        <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
        function StockLevels(pItem)
        <!--
        {
        var strIDs = 'Stock Message: '
        {
        if (pItem >= 10)
        {
        strIDs = '<img src=instock.gif>'
        }
        else
        {
        strIDs = '<img src=nostock.gif>'
        }
        }
        return strIDs
        }
        //-->
        </script>

        Note: Change the figure of '10' to whatever your stock threshold is. You can also change the stock message code to suit your requirements.

        Then, add the following code into your Product Layout template(s) (normally Act_Productline.html) where you want your stock messages to appear.

        <script language="Javascript">
        document.write(StockLevels(NETQUOTEVAR:STOCKLEVEL))
        </script>

        Note, you will need to add your images to the 'Advanced | Additional Files' list and also copy them into the 'PreviewHTML' folder on your PC.

        Comment

        Working...
        X