Announcement

Collapse
No announcement yet.

x items remaining - really useful feature

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

    x items remaining - really useful feature

    I have a problem at the moment whereby when I have, say, 5 items left in stock some bugger will come along and order 10!

    I realise the stock control system isn't realtime or integrated into the site, and that the only way it handles things is to update the page with the text "out of stock" if the item is out of stock, but is there a way of doing the following (and if not then can this be added to the wish list as it would be a really useful feature!) -

    When the stock drops below the warning level, actinic updates the product on the page with the text "5 items in stock" (for example).

    I realise that this still wouldn't be real-time, but at least it would give the customers a better clue as to how many they can order and cut down on the number of e-mails I have to send out explaining that while we weren't "out of stock" we weren't quite that "in stock" either...

    With this and the 'auto update' utility running it would give a much better stock control system.

    Just a thought...
    John

    #2
    See page 17 of the advanced users guide. Use the javascript sample to display the stock only when it is low.
    Bob Ladden

    Comment


      #3
      wow, is there nothing you don't know?

      I should just give up using the board and just e-mail my questions direct to you...

      in the example shown is there a variable for the product warning level that could be used in the place of "10"? Obviously, I would want this number to differ depending on how fast I go through the various items - 3 might be appropriate for expensive slow moving items, while 30 might be more appropriate for cheaper fast moving items that can sell in bulk...
      John

      Comment


        #4
        for my tuppenth worth

        it surely would be better if on creation of an receipt, i.e. purchase has gone through, that some file in the cgi-bin would write to the cat file or whatever it is that holds a products details, that there were x amount of the product less...

        must admit, we recently had to turn down the prospext of a lovely big massive site because the realtime stock monitoring in actinic let it down...get this, they only contacted us because they liked actinic sites, and i had to say that the stock control wasnt really stock control....if they got orders for products that were not really available it would cause chaos...

        i wont even tell you the kind of figures we talked about for the building of the site save to say it almost made me cry..

        i am actually going to ask my sql guy if he can overcome this somehow...unless actinic or some clever soul works out how to be accurate online with stock control..it would really make a HUGE difference to the calibre of the product..

        best as ever..

        steve q
        harlequin domains
        www.harlequindomains.com
        0800 0832077

        Comment


          #5
          it surely would be better if on creation of an receipt, i.e. purchase has gone through, that some file in the cgi-bin would write to the cat file or whatever it is that holds a products details, that there were x amount of the product less...
          That would certainly help with stock control in general, but would not be any help when the order quantity is greater than the current stock level...
          John

          Comment


            #6
            then it simply wouldnt accept the order and remind the customer there were only x amount in stock...

            Comment


              #7
              I would hate to have a large array in javascript of minimum quantities for each product, but you can do that. Or you can base the minimum on price. Or you can create a customvar that gets into a hidden field in the template that javascript can access.

              The two gaping holes in Actinic V6 is the lack of offline ordering and minimal stock management. But I think they knew that.

              And John, my humility prevents me from acknowledging your perceptiveness.
              Bob Ladden

              Comment


                #8
                there is a variable called STOCKLEVEL but is there one for the stock warning level?

                for some reason STOCKLEVEL doesn't seem to be listed in the appendices of the manuals or the nqv variables list...?
                John

                Comment


                  #9
                  for some reason STOCKLEVEL doesn't seem to be listed in the appendices of the manuals or the nqv variables list...?
                  Yep - that (and other issues) are being addressed by a documentation revamp over the next few months.

                  Comment


                    #10
                    so is there a variable for the stock warning level, documented or not?
                    John

                    Comment


                      #11
                      Sorry - missed that bit.

                      No there is not a variable for the stock warning level.

                      Comment


                        #12
                        ok then. I'll add a custom variable to each product called STOCKWARNINGLEVEL and modify the java script on page 17 of the advanced manual, like so -

                        [to go in the act_primary file]

                        <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
                        function StockLevels(pWarnLevel, pCurrentStock)
                        <!--
                        {
                        var strIDs = 'Stock Message: '
                        {
                        if (pCurrentStock > 0) and (pCurrentStock <= pWarnLevel)
                        {
                        strIDs = 'Only '+pCurrentStock+' remaining'
                        }
                        else
                        {
                        strIDs = ''
                        }
                        }
                        return strIDs
                        }
                        //-->
                        </script>

                        [to go in the act_product line file]
                        <script language="Javascript">
                        document.write(StockLevels(CUSTOMVAR:STOCKWARNINGLEVEL,NETQUOTEVAR:STOCKLEVEL))
                        </script>

                        The desired effect is that if there is stock, but it's less than the custom warning level it will say how many items are actually in stock, but if there is NO stock, or plenty of stock left it will display an empty string.

                        However, I have no clue how Java works, and don't have a java compiler (if there is such a thing) or any kind of syntax checker... and the javascripts don't work in preview mode...and I don't want to test this on my live site... so are there any java people out there who can tell if my code would work? or actinic people who can tell if the concept will work?

                        I suspect this bit wont
                        strIDs = 'Only '+pCurrentStock+' remaining'
                        is there a number to string function in java?
                        John

                        Comment


                          #13
                          It's JavaScript not Java. These are two completely different languages. Anyway what you want to try should work in Preview pages so why not give it a go.

                          There are a couple of errors in your posted code.

                          Code:
                          the Act_Primary.html bit
                          
                          <script language="Javascript">
                          <!--
                          function StockLevels(pWarnLevel, pCurrentStock)  {
                            var strIDs = 'Stock Message: '
                            if (pCurrentStock > 0) && (pCurrentStock <= pWarnLevel)
                              {
                              strIDs = 'Only '+pCurrentStock+' remaining';
                              }
                            else
                              {
                              strIDs = '';
                              }
                          return strIDs;
                          }
                          //-->
                          </script>
                          
                          
                          
                          The Act_productLine.html bit
                          
                          <script language="Javascript">
                          <!--
                          document.write(StockLevels(CUSTOMVAR:STOCKWARNINGLEVEL,NETQUOTEVAR:STOCKLEVEL));
                          //-->
                          </script>

                          As to your question about converting numbers to strings that is done automatically in JavaScript depending on context.
                          e.g. var x = "abc" + 123;
                          will set x to be "abc123"
                          A JavaScript book is best if you're going to us it a lot. I use the O'Reilly "JavaScript The Definitive Guide". As well as being easy to read it has a nice picture of a Rhino on the cover.

                          A final word. Your best frriend when tinkering is the alert() function. This will pop-up a message whenever executed. For example, in your
                          NormanStockLevels function if you add the line

                          alert('Warning level ' + pWarnLevel + ' Stocklevel ' + pCurrentStock);

                          you'll get some nice diagnostic information popping out.

                          A final final word. Test under Netscape. This has MUCH better JavaScript error reporting tools than IE. E.g. In NN7 go to Tools / Web Development / JavaScript Console and you'll get a useful diagnostic window.
                          Norman - www.drillpine.biz
                          Edinburgh, U K / Bitez, Turkey

                          Comment


                            #14
                            I think only the && error was mine, the others were from the advanced user guide...
                            John

                            Comment


                              #15
                              I updated while you were replying. Have a look above. Also note that you can test simple JavaScript by typing it straight into the Address bar of IE and hitting Enter.

                              I.e. type javascript:alert(Math.floor(12.34));

                              and a box containin the result 12 will pop up.

                              Norman
                              Norman - www.drillpine.biz
                              Edinburgh, U K / Bitez, Turkey

                              Comment

                              Working...
                              X