Announcement

Collapse
No announcement yet.

stock level indication

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

    stock level indication

    We are using the javascript laid out in the "Advance User Guide" to include stock levels within the site.

    For items that are in stock it displays the message "Delivery 1-3 days"

    For other non-stocked items it displays "Usually despatched in 5-7 days." This is fine as the majority of these items are delivered next day by our suppliers, so we will beat this estimate.

    However, there are a few non-stocked lines that take a lot longer and 5-7 days is a bit misleading.

    Is there a way of separating these non-stocked items within the javascript even though they both share the same value of zero? Ideally it would be best to have a third message "Usually despatched within 10-14 days".

    Many thanks in advance.

    John


    <!--
    {
    var strIDs = 'Stock Message: '
    {
    if (pItem >= 1)
    {
    strIDs = 'Delivery 1-3 days'
    }
    else
    {
    strIDs = 'Usually despatched within 5-7 days'
    }
    }
    return strIDs
    }
    //-->
    www.homecreations.co.uk - www.wastedisposershop.com - www.wastemaidshop.co.uk -

    #2
    You could use NETQUOTEVAR:PRODUCTREFERENCE (assuming this code is in a Product Template) and have some part of the product reference that indicates the delivery period.

    e.g. If our product reference contains "-xd" then it's a slow one.

    Code:
    var thisprod = "NETQUOTEVAR:PRODUCTREFERENCE";
    if ( thisprod.indexOf("-xd") != -1 )
      {
      strIDs = "Usually despatched within 10-14 days";
      }

    Alternatively you could define a CUSTOMVAR containing the slow delivery prompt and use it instead of the standard one:-

    Code:
    var thismesg = "CUSTOMVAR:SLOWDELIVERY";
    if ( thismesg )
      {
      strIDs = thismesg;
      }
    or as a one-liner
    Code:
    if ("CUSTOMVAR:SLOWDELIVERY") strIDs = "CUSTOMVAR:SLOWDELIVERY";

    This method lets you tailor the message to each product.

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

    Comment


      #3
      Hi Norman,

      I've been away and just got back to your reply.

      I think your 2nd or 3rd suggestion would be more appropriate but I'm not sure how to incorporate

      if ("CUSTOMVAR:SLOWDELIVERY") strIDs = "CUSTOMVAR:SLOWDELIVERY";

      into the original javascript.

      I seem to get every product displaying 10-14 days or every product displaying 5-7 days.

      Thanks

      John
      www.homecreations.co.uk - www.wastedisposershop.com - www.wastemaidshop.co.uk -

      Comment

      Working...
      X