Announcement

Collapse
No announcement yet.

Join the waiting list

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

  • Join the waiting list

    Hi - First post here.

    My site is currently hiding Out of Stock Inventory. I'd like to switch to allow users to Join the Waiting List and be alerted when the product comes back in stock.

    When I enabled the Waiting List, all products (In and Out of Stock) show a Buy button on the Category Page. I want the Waiting List button to replace the Buy when the item is out of stock. It does this automatically on the Product detail page, but I couldn't figure out by looking at the code how to make it work in my category listing page too.

    Does anyone know what the code would be so that the waiting list button appears dynamically instead of the buy button at the category level?

  • #2
    You'd probably need to open up your Listing Template, find the code that sits within the areas that show:
    Code:
    <!--START: waitinglist-->
    (code in here)
    <!--END: waitinglist-->
    Copy that and then work it into your Category Template within the table layout used there. You're primarily interested in the input tag code, but don't forget to put that start and end code (shown above) in there too.

    Comment


    • #3
      Interesting concept, I wish I came up with it!

      At first I was concerned about not being able to view the listing page but the title and image will keep that door open.

      The code would need to go in the "template 0 section" of the category page.

      I am not at the office today and am unable to finish the statements but this is what I would try.
      Code:
      if stock is less then 1
                <tr>
                  <td colspan="2"><img src="assets/templates/common/images/spacer.gif" border="0" alt="" height="12"></td>
                </tr>
                <tr>
                  <td class="item" align="left" colspan="2"><input type="button" value="Put me on the Waiting List" class="btn" onClick="javascript:window.open('notify.asp?catalogid=[catalogid]','popup','height=350,width=540,location=no,' + 'scrollbars=no,menubars=no,toolbars=no,resizable=yes');" onMouseOver="this.className='btn_over'" onMouseOut="this.className='btn'"></td>
                </tr>
      Else
                <tr>
                          <td class="item" align="center" valign="middle"><input  type="button" value="[category_buyitlink]" onClick="window.location='add_cart.asp?quick=1&item_id=[catalogid]'" class="btn" onMouseOver="this.className='btn_over'" onMouseOut="this.className='btn'"></td>
                        </tr>
      The part in red is the missing code but if someone else would like to finish this idea, that would be fine as I am out of town and unable to access my notes.
      .
      Clayton
      Go Live Industries

      Comment


      • #4
        OK Here is a java solution
        Code:
        <script type="text/javascript">
        var inventory = [stock];
        
        if (inventory < 1) 
        {
        <tr>
                    <td colspan="2"><img src="assets/templates/common/images/spacer.gif" border="0" alt="" height="12"></td>
                  </tr>
                  <tr>
                    <td class="item" align="left" colspan="2"><input type="button" value="Put me on the Waiting List" class="btn" onClick="javascript:window.open('notify.asp?catalogid=[catalogid]','popup','height=350,width=540,location=no,' + 'scrollbars=no,menubars=no,toolbars=no,resizable=yes');" onMouseOver="this.className='btn_over'" onMouseOut="this.className='btn'"></td>
                  </tr>
        
        }
        else
        {
        <tr>
                            <td class="item" align="center" valign="middle"><input  type="button" value="[category_buyitlink]" onClick="window.location='add_cart.asp?quick=1&item_id=[catalogid]'" class="btn" onMouseOver="this.className='btn_over'" onMouseOut="this.className='btn'"></td>
                          </tr>
        }
        </script>
        .
        Clayton
        Go Live Industries

        Comment


        • #5
          Originally posted by piaf View Post
          You'd probably need to open up your Listing Template, find the code that sits within the areas that show:
          Code:
          <!--START: waitinglist-->
          (code in here)
          <!--END: waitinglist-->
          Copy that and then work it into your Category Template within the table layout used there. You're primarily interested in the input tag code, but don't forget to put that start and end code (shown above) in there too.
          Thanks for the reply.

          I tried this, but I ended up with both buttons showing on my category page, regardless of stock. I also tried massing it around by moving the <!--END: waitinglist--> after the <!--END: addtocart-->, but the result was the same.
          Code:
           <!--START: waitinglist-->
                    <tr>
                      <td colspan="2"><img src="assets/templates/common/images/spacer.gif" border="0" alt="" height="12"></td>
                    </tr>
                    <tr>
                      <td class="item" align="left" colspan="2"><input type="button" value="Put me on the Waiting List" class="btn" onClick="javascript:window.open('notify.asp?catalogid=[catalogid]','popup','height=350,width=540,location=no,' + 'scrollbars=no,menubars=no,toolbars=no,resizable=yes');" onMouseOver="this.className='btn_over'" onMouseOut="this.className='btn'"></td>
                    </tr>
                                <!--END: waitinglist-->    <!--START: addtocart--><td><input type="button" onClick="window.location='add_cart.asp?quick=1&item_id=[catalogid]';" name="Add" value="[product_addtocart]" class="btn" onMouseOver="this.className='btn_over'" onMouseOut="this.className='btn'"></td>
                                  </tr>
                                  <!--END: addtocart-->
          [/QUOTE]

          Comment


          • #6
            Originally posted by Go Live View Post
            OK Here is a java solution
            Code:
            <script type="text/javascript">
            var inventory = [stock];
            
            if (inventory < 1) 
            {
            <tr>
                        <td colspan="2"><img src="assets/templates/common/images/spacer.gif" border="0" alt="" height="12"></td>
                      </tr>
                      <tr>
                        <td class="item" align="left" colspan="2"><input type="button" value="Put me on the Waiting List" class="btn" onClick="javascript:window.open('notify.asp?catalogid=[catalogid]','popup','height=350,width=540,location=no,' + 'scrollbars=no,menubars=no,toolbars=no,resizable=yes');" onMouseOver="this.className='btn_over'" onMouseOut="this.className='btn'"></td>
                      </tr>
            
            }
            else
            {
            <tr>
                                <td class="item" align="center" valign="middle"><input  type="button" value="[category_buyitlink]" onClick="window.location='add_cart.asp?quick=1&item_id=[catalogid]'" class="btn" onMouseOver="this.className='btn_over'" onMouseOut="this.className='btn'"></td>
                              </tr>
            }
            </script>
            Wow, I was really hoping this would work, because I had plans on how to use it for other cool things.

            Unfortunately, adding the code resulted in having nothing show, in place of the Add to Cart or Waiting List.

            I'm wondering if the product detail page references something that the Category Page doesn't (some code???) in order to make your code work.

            Thanks for the reply, though.

            If anybody figures this out, please update.

            Thanks.

            Comment


            • #7
              OK did some testing and added:
              document.write("") and removed all spaces and put on one line (works when using simple code but seems java inside java is not a good idea. Java is picky would be fine with php.

              Good news: as to your other ideas may still be a go. The code below is a compromise I came up with after working on another project.
              Code:
              <div align="center">
              <script type="text/javascript">
              
              if ([stock] > 0)
              {
              document.write("<b>( In Stock )</b>");
              }
              else
              {
              document.write(<b>(<a href="product.asp?itemid=[catalogid]">View Details</a>)</b>);
              }
              </script>
              </div>
              I'll leave this code here for you to play with. I'm done for now. Has anybody seen my glass of wine?
              Last edited by Go Live; 03-20-2011, 08:48 PM. Reason: updated code
              .
              Clayton
              Go Live Industries

              Comment

              Working...
              X