Announcement

Collapse
No announcement yet.

Problem with out of stock items...

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

    Problem with out of stock items...

    Hi all...

    I have a number of products which I do not hold in stock and have to order in specially....however I'd like my customers to be able to order these via my shopping cart and to see a message telling them what the approx delivery will be... i.e. Item in stock - shipped within 24 hours.... Item out of stock - shipped within 7-10 days...

    I've tried using the solution found in the AUG but have been unable to get it work - message doesn't appear and the look of shopping cart is screwed up (changed typefaces, layout etc.)... here's the code I use:

    <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
    function StockLevels(pItem)
    <!--
    {
    var strIDs = 'Stock Message: '
    {
    if (pItem >= 1)
    {
    strIDs = 'In Stock - Normally Ships within 24 Hours. '
    }
    else
    {
    strIDs = 'Normally Ships within 10 days. '
    }
    }
    return strIDs
    }
    //-->

    I'm an absolute beginner and probably being really dense here, but can anyone give me a step by step guide to getting this to work?

    Thanks
    Phil

    #2
    The code you quote there needs to go into the Default Overall Layout template - which you can access by clicking the 'Edit' button in 'Design | Options | Layouts'.

    Put it in just before the </HEAD> tab in the template.

    Then, click the 'Edit' button next to the 'Default Product Layout' field and enter the following code just after NETQUOTEVAR:PRODUCTDESCRIPTION:

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

    It should work.

    Comment


      #3
      Thanks for the help, Chris....I've tried your suggestion on my dev pc and unfortunately it still doesn't work....in fact I've now also lost the header bar from the catalog pages...

      I've zipped up the two offending files and attached them to this post... if you get chance can you take a look and see what stupid error I've made to screw this up....

      Thanks

      Phil
      Attached Files

      Comment


        #4
        On your first post the

        </script>

        tag is missing. It should be the last item (on a new line immediately after //-->).

        Leaving out that tag will definitely break your page as subsequent code (until another </script> turns up) will be gobbled by the JavaScript interpreter and not rendered on the page.

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

        Comment


          #5
          Good catch Norman.

          Can't believe I missed that one!

          Comment


            #6
            Norman.... your a star!! Just tried it and it works as planned....

            Just like to say thanks to you and Chris for your help with this....very much appreciated and you've probably saved the life of my pc, which was going to end up in the pond later today if I couldn't get it working... :-)

            Thanks again.

            Phil

            Comment

            Working...
            X