Announcement

Collapse
No announcement yet.

Stock Level Indicators

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

    Stock Level Indicators

    Hi

    I have had a search about, but can only find topics relating to showing a stock quantity.

    What I want to do is put a simple in, out, or on order gif related to the product availability.

    I can add html to each product, but it is a bit of a long process.

    Thanks for any help

    Mick

    #2
    Hi Mick,

    I'm afraid there is no variable for the stock level indicator in Actinic. Rather than having to put in the html code within the product, you could edit the "Act_Productline.html" and save it as two files "Act_ProductLineStockOn.html" (which has the in order gif) and "Act_ProductlineStockoff.html" (which has the off order gif). For the product you wish to associate the stocks on, they could use either one of these templates.

    Kind Regards
    Nadeem Rasool
    SellerDeck Development

    Comment


      #3
      There is some javascript around that will display the actual stock levels for your products.

      I wouldn't have thought it would take too much to change it so that (for example) if stock = 0 display out of stock image, if stock > 0 display in stock image, if stock =1000 (or something) display on order image.

      Sadly I'm not your man for writing javascript.

      Mike
      -----------------------------------------

      First Tackle - Fly Fishing and Game Angling

      -----------------------------------------

      Comment


        #4
        Hi Mick,

        Whoops, Thanks for that Mike. Sorry Mick you can do the following, its in the advance user guide

        Edit your Act_Primary.html and put the following code after
        <SCRIPT LANGUAGE="JavaScript" SRC="actinicextras.js" TYPE="text/javascript"></SCRIPT>
        Code:
        <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
        function StockLevels(pItem)
        <!--
        	{
        	var strIDs = 'Stock Message: '
        	{
        	if (pItem >= 1)
        		{
        		strIDs = '<img src="stockon.gif"> Stock in Hand'
        		}
        	else
        		{
        		strIDs = '<img src="stockout.gif"> Out of Stock'
        		}
        	}
        	return strIDs
        }
        //-->
        </script>
        Now edit your "Act_Productline.html" and put in the following code

        Code:
        <script language="Javascript">
        	document.write(StockLevels(NETQUOTEVAR:STOCKLEVEL)) 
        </script>
        This will allow you to have a stock on picture if the stock level is greater than one.

        Kind Regards
        Nadeem Rasool
        SellerDeck Development

        Comment


          #5
          Thanks both

          Thats great, and thanks for the code Nadeem

          Will try it & let you know

          Mick

          Comment


            #6
            Getting a script error

            Line 86, character 9

            Error Expected')'

            Act_Primary entered code here

            <SCRIPT LANGUAGE="JavaScript" SRC="actiniccore.js" TYPE="text/javascript"></SCRIPT>
            <SCRIPT LANGUAGE="JavaScript" SRC="actinicextras.js" TYPE="text/javascript"></SCRIPT>

            <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
            function StockLevels(pItem)
            <!--
            {
            var strIDs = 'Stock Message: '
            {
            if (pItem >= 1)
            {
            strIDs = '<img src="in.gif> Stock in Hand'
            }
            else
            {
            strIDs = '<img src="out.gif> Out of Stock'
            }
            }
            return strIDs
            }
            //-->
            </script>

            <!-- Placeholder of cookie checking javascript code. Do not remove it! -->
            <Actinic:COOKIECHECK/>

            Is there a specific place to add the other code to the Act_Productline?

            Thanks

            Mick

            Comment


              #7
              Hi Mick

              Sorry, edited my previous example, you need to close the gif file image, so change
              Code:
              strIDs = '<img src="in.gif> Stock in Hand'
              to
              Code:
              strIDs = '<img src="in.gif"> Stock in Hand'
              and do the same for the other. Also make sure in "Advance | Additional Files" that both in.gif and out.gif are in there.

              Kind Regards
              Nadeem Rasool
              SellerDeck Development

              Comment


                #8
                Thanks Nadeem

                I am getting the message showing in offline preview, but they are showing at the top of the image, and muliplied by the number of products in that section.

                ie if there are 4 items in the section, there are 4 stock indicators at the top of the image of the first product.

                As you can tell I am expert at this script stuff

                Thanks

                Mick

                Comment


                  #9
                  The bit of code that says:

                  <script language="Javascript">
                  document.write(StockLevels(NETQUOTEVAR:STOCKLEVEL))
                  </script>
                  has to be in the product template somewhere within the table <td> </td> tags. If the're not within a table cell (i.e. within the tags) then they'll be rendered right at the top of the table (if your lucky)

                  Mike
                  -----------------------------------------

                  First Tackle - Fly Fishing and Game Angling

                  -----------------------------------------

                  Comment


                    #10
                    Perfect Mike-thank you very much

                    I had that code outside the tags, I have quickly edited & it seems to work perfectly.

                    I will upload it now & let you know

                    Thanks

                    Mick

                    Comment


                      #11
                      Getting there

                      I am getting the indicator in the right place now, but still getting them showing above the image of the first product as well


                      <!-- Primary HTML begin -->
                      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
                      <HTML>
                      <HEAD>
                      <TITLE>
                      NETQUOTEVAR:PAGETITLE
                      </TITLE>
                      <Actinic:BASEHREF VALUE="NETQUOTEVAR:BASEHREF"/>
                      <META NAME="ACTINICTITLE" CONTENT="NETQUOTEVAR:PAGEHEADER">
                      <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
                      <!--@act NETQUOTEVAR:HEADERMETA -->
                      <!--@act NETQUOTEVAR:LOADFUNCTION -->
                      <!--@act NETQUOTEVAR:SUBMITFUNCTION -->
                      <!--@act NETQUOTEVAR:P3PFULLPOLICYLINK -->
                      <LINK REL=STYLESHEET HREF="actinic.css">


                      <SCRIPT LANGUAGE="JavaScript" SRC="actiniccore.js" TYPE="text/javascript"></SCRIPT>
                      <SCRIPT LANGUAGE="JavaScript" SRC="actinicextras.js" TYPE="text/javascript"></SCRIPT>

                      <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
                      function StockLevels(pItem)
                      <!--
                      {
                      var strIDs = 'Stock Message: '
                      {
                      if (pItem >= 1)
                      {
                      strIDs = '<img src="in".gif> Stock in Hand'
                      }
                      else
                      {
                      strIDs = '<img src="out".gif> Out of Stock'
                      }
                      }
                      return strIDs
                      }
                      //-->
                      </script>


                      Act_Productline-I have dropped the code in here


                      NETQUOTEVAR:CARTERRORXMLNETQUOTEVAR:PRODUCTQUANTITY<br>
                      <Actinic:ACTIONS>NETQUOTEVAR:ADDTOCARTBUTTON</Actinic:ACTIONS>
                      </span>
                      NETQUOTEVAR:TEMPLATEENDXML
                      </td>
                      <script language="Javascript">
                      document.write(StockLevels(NETQUOTEVAR:STOCKLEVEL))
                      </script>
                      </tr>
                      NETQUOTEVAR:PRODUCTFORMEND
                      NETQUOTEVAR:NEXT


                      <!-- Insert HTML for the bottom of the individual product -->
                      <!-- ProductLine HTML end -->


                      Anything leap out & grab you?

                      Thanks

                      Mick

                      Comment


                        #12
                        Yep, just move the </td> in the product template to be after the javascript, not before it.

                        Mike
                        -----------------------------------------

                        First Tackle - Fly Fishing and Game Angling

                        -----------------------------------------

                        Comment


                          #13
                          Thanks again Mike

                          One small problem left-sorry to be a pain

                          I have 2 stock indicators-one after the price, and one below the add to cart

                          I would like to keep the one after the price as the position is better.

                          Thanks

                          Mick

                          Comment


                            #14
                            You must have the javascript appearing twice within the template.

                            The one you just moved the </td> to be after is the one that appears after the add to cart button. Deleting the javascript there should remove the extra stock image.

                            Mike

                            NB: This currently only does the in-stock/out of stock bit. There's no third 'on order' or whatever image.
                            -----------------------------------------

                            First Tackle - Fly Fishing and Game Angling

                            -----------------------------------------

                            Comment


                              #15
                              Right again Mike

                              I had it duplicated in the Act_Productline

                              NB: This currently only does the in-stock/out of stock bit. There's no third 'on order' or whatever image.
                              Thats my next trick

                              Thanks for your time-much appreciated

                              Mick

                              Comment

                              Working...
                              X