Announcement

Collapse
No announcement yet.

Stock Level "More than 5 in stock"

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

    Stock Level "More than 5 in stock"

    Hi there
    I looked for an answer on the forum but didn't find one. For online stock figures, is there a way of saying "More than 5 in stock", rather that the actual figure?

    For some of our stock we may have several hundred and we do not really want to advertise this actual amount. We would rather say "More than 5 in stock".

    Has anyone achieved this ?

    Cheers.

    #2
    Assuming you mean real-time stock, then edit actinicextras.js (in your Site folder) and look for:
    Code:
    arrStockElems[nIndex].innerHTML = mapStockByRef[sProdRef];
    Replace with:
    Code:
    arrStockElems[nIndex].innerHTML = mapStockByRef[sProdRef] > 5 ? 'More than 5' : mapStockByRef[sProdRef];
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Hi this has been working well for us for a long time, but I would like to enhance it a bit.

      We sometimes allow back-ordering: when we know stock is 'on the way' we would allow customers to pre-order.

      I know I can change the field "Suspend Orders If Below" to be, say -50 if I know 50 are on the way - but the problemette is that the stock message says "50 in stock" which is a little mis-leading

      I would like it to say " Stock is on the way - you can Pre-Order" if it detects that the stock figure is actually in negative.

      How can I do this ?

      Comment


        #4
        Go to Design / Library / Layouts / Real Time Stock Display.
        Edit layout Display Stock Quantities.
        Replace:
        Code:
                <span id="StockLevel_<actinic:variable name="ProductReference" selectable="false" />" class="ActinicRTS" style="display: inline;"></span>&nbsp;in stock.
        With:
        Code:
                <span data-stocklevel="<actinic:variable name="StockLevel" selectable="false" />" id="StockLevel_<actinic:variable name="ProductReference" selectable="false" />" class="ActinicRTS" style="display: inline;"></span>
        Edit actinicextras.js (in your Site folder) and Replace:
        Code:
                            arrStockElems[nIndex].innerHTML = mapStockByRef[sProdRef] > 5 ? 'More than 5' : mapStockByRef[sProdRef];
        With:
        Code:
                            var currentStock = mapStockByRef[sProdRef];
                            var stockLevel = arrStockElems[nIndex].getAttribute("data-stocklevel") - 0;
                            var stockMsg = '';
                            if ( stockLevel <= 0 )
                                {
                                stockMsg = 'Stock is on the way - you can Pre-Order.';
                                }
                            else if ( stockLevel > 5 )
                                {
                                stockMsg = 'More than 5 in stock.';
                                }
                            else
                                {
                                stockMsg = stockLevel + ' in stock.';
                                }
                            arrStockElems[nIndex].innerHTML = stockMsg;
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Hi
          Many thanks for the super swift reply. I put it in, example
          https://www.nicestuff.co.uk/acatalog...Z.html#SID=114

          But with Estimated Stock in Hand set to -5, and Suspend If Below set to -10, it still says I have 5 in stock. The new message did not kick in.
          Any ideas ?

          Comment


            #6
            Looks like SellerDeck treats the difference between the suspend level and current stock as being available.
            Getting what you want looks more complicated than a single line change. I've amended my post #4 to use the current Stock Level instead of the computed one.

            This won't be fully dynamic. It will only get a new Stock Level when you download orders and update the site. Try it and see.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Hi many thanks that seems to work very well. Nice one.

              Comment

              Working...
              X