Announcement

Collapse
No announcement yet.

Code help - Show # in Stock

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

  • Code help - Show # in Stock

    I'm trying to set up an new category that will have nearly 500 colors of thread in it. It must show how many are in stock so the customer will know how many they can order (they often order multiples of one color)

    I added the following code to my other listing pages and it works great.

    <!--START: product_availability-->
    <tr><td class="item">[product_Header-availability]</b> [stock]</td></tr> <!--END: product_availability-->


    I tried to copy the same code and put it in category_1.html and I get garbage characters instead of the in stock number. (here: DMC Floss)

    The highlighted area is the part I added.... Any ideas what I did wrong??? I'm terrible at web programming (obviously)

    <!--START: ITEM_TEMPLATE_0-->
    <table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
    <td colspan="2" align="center" valign="middle"><a href="product.asp?itemid=[catalogid]&catid=[catid]"><img src="[THUMBNAIL]" alt="[name]" border="0"></a></td>
    </tr>

    <tr valign="middle">
    <td colspan="2" class="item" align="center"><a href="product.asp?itemid=[catalogid]&catid=[catid]">[name]</a></td>
    </tr>
    <!--START: product_availability-->
    <tr><td class="item">[product_Header-availability]</b> [stock]</td></tr> <!--END: product_availability-->


    <tr>
    <td class="price" align="center" valign="middle" colspan="2">
    <!--START: ITEMPRICE-->
    [ITEMPRICE]
    <!--END: ITEMPRICE-->
    <!--START: SALEPRICE-->
    <s>[ITEMPRICE]</s><br>[ITEMSALEPRICE]
    <!--END: SALEPRICE-->

    </td>
    </tr>
    <tr>
    <td class="item" colspan="2" align="center" valign="middle">[product_quantity] <input type=hidden name="item_id" value="[catalogid]"><input type="text" size="2" name="qty-[counter]" value=0 class="txtBoxStyle"></td>
    </tr>
    </table>
    <!--END: ITEM_TEMPLATE_0-->
    C Ekman
    Owner/Designer: Cobweb Corner
    http://www.cobwebcorner.com

  • #2
    Here's a link showing the exact same code working (obviously I did something right on category_0 and something wrong on category_1)

    Counted Cross Stitch, Crossstitch Designs, Counted Cross Stitch patterns, Needlework, Hardanger, Used Cross Stitch, Vintage Counted Cross Stitch
    C Ekman
    Owner/Designer: Cobweb Corner
    http://www.cobwebcorner.com

    Comment


    • #3
      I reverted the code back to original and am going to try again.
      C Ekman
      Owner/Designer: Cobweb Corner
      http://www.cobwebcorner.com

      Comment


      • #4
        This is So frustrating. This is something that should have been included in V4 - SO many people want to show the # in stock - but that means we have to change our code - which means support won't help us.

        I've tried and tried and can't get it.

        If anyone can tell me what and where to change category_1.html so it will show the stock quantity - I would GREATLY appreciate it.

        Thanks!
        C Ekman
        Owner/Designer: Cobweb Corner
        http://www.cobwebcorner.com

        Comment


        • #5
          Possible Answer, though not a Solution

          IGNORE ME
          I believe the "stock" field was altered to work with the Google Product Search parameters. If you look at your Product Search feed, the "stock" field should be mapped to the "availability" alias by default; and Google only accepts four entries for the "availability" alias:
          • In Stock
          • Out Of Stock
          • Pre-Order
          • Available for Order


          That's why the field generates one of the top two list items. I feel for you, but really don't want 3dcart to update the field to fix your problem until they've created a way for me to specify those four list items outside of the "stock" field. There may be several people in the same boat as you, but we ALL update with Google. I don't know about you, but organic searches account for most of my site visits.

          HOWEVER I DO HAVE SOMETHING WORTH TRYING:

          I think you'll notice that this page has not been updated with the newest interface. There's a field beteween #31 and #32 called "Current Stock." Now this is just a guess, but since the fields around it are: show_out_stock, stock, and stock_alert – I did some digging in the available fields. Have your tried stock_number?
          Last edited by TMS Clint; 08-11-2011, 10:44 AM. Reason: Not relevant to the problem it turns out.
          Webmaster: Texas Media Systems

          Comment


          • #6
            TMS Clint
            Sorry but I'm not understanding your post at all.

            All I want to do is display the available stock quantity on my category listing page.

            I already have it working on category_0.html but that same code doesn't work on category_1.html.

            If you look at the highlighted code in red you'll see I'm using [stock] - which is in the KB article of available product fields to use.

            I have no idea what this has to do with Google Searches - sorry I'm probably missing the obvious here.
            C Ekman
            Owner/Designer: Cobweb Corner
            http://www.cobwebcorner.com

            Comment


            • #7
              I did look at the page you provided - I'm trying to use field #32 - stock - that's what I use in my other category page and it works great.
              C Ekman
              Owner/Designer: Cobweb Corner
              http://www.cobwebcorner.com

              Comment


              • #8
                Sorry, it was quicker for me to do a product export to see what fields produced what results. When you export from Google Product Search, such as I had, it returns a different result for [stock] than the field normally does.

                I thought you were having a problem that you are not having.
                Webmaster: Texas Media Systems

                Comment


                • #9
                  Not sure if you got the answer yet, but the tag you want is [availability]
                  Chris
                  TC Life Safety
                  TC Wireless

                  Comment


                  • #10
                    Chris,
                    Thanks but I'm not getting that to work either. I'm using category_1 with a display type of LISTING

                    Here is the code I have changed (all else should be original code)

                    <!--START: ITEM_TEMPLATE_0-->
                    <table border="0" cellspacing="0" cellpadding="2" width="100%">
                    <tr>
                    <td colspan="2" align="center" valign="middle"><div style="overflow: hidden; height: 150px;"><a href="product.asp?itemid=[catalogid]"><img src="thumbnail.asp?file=[THUMBNAIL]&maxx=150&maxy=0" alt="[name]" border="0"></a></div></td>
                    </tr>
                    <tr valign="middle">
                    <td colspan="2" class="item" align="center"><a href="product.asp?itemid=[catalogid]&catid=[catid]">[name] (Qty in Stock: [availability]) </a></td>
                    </tr>
                    <td class="price" align="center" valign="middle" colspan="2"><!--START: ITEMPRICE-->
                    [ITEMPRICE]
                    <!--END: ITEMPRICE-->


                    You can see my products using this template here: DMC Floss Eventually there will be over 500 colors in this product category and customers often order multiples of one color - so they really need to see how many are available -otherwise it will be very frustrating for them

                    All I want is the name of the product displayed with the quantity like this:

                    105 Variegated Tan/Brown (Qty in Stock: 3)

                    If anyone can help I would really appreciate it. The code I originally posted works just fine in my categor_0.html - and that uses the field name [stock]

                    Thanks for any help!
                    C Ekman
                    Owner/Designer: Cobweb Corner
                    http://www.cobwebcorner.com

                    Comment


                    • #11
                      I'm pretty sure you need the tags <!--START: product_availability-->and <!--END: product_availability--> before and after the tag.
                      Chris
                      TC Life Safety
                      TC Wireless

                      Comment


                      • #12
                        OK - when I get a chance I'll try that again. I tried it before (with [stock]) and it printed garbage characters on my page.

                        Thanks - will let you know...
                        C Ekman
                        Owner/Designer: Cobweb Corner
                        http://www.cobwebcorner.com

                        Comment


                        • #13
                          I am so close!

                          I figured out I need to make the update to Template_1 section of the category_1.html file - there are three ways to display this file - Thumnails (template_0), Listing (template_1) and Details (template_2).

                          I want to use LISTING

                          So:
                          Here is the code section I changed:

                          <!--START: ITEM_TEMPLATE_1-->
                          <table border="0" cellspacing="5" cellpadding="0" width="100%">
                          <tr>
                          <td class="item" width="60%" align="left" valign="middle"><a href="product.asp?itemid=[catalogid]&catid=[catid]"><span class="item">[name]</span></a></td>
                          <td class="item" width="15%" align="left" valign="middle">[STOCK]</td>
                          <td class="price" width="25%" align="left" valign="middle"> [ITEMPRICE]</td>
                          <td class="item" width="10%" align="right" valign="middle"><input type="hidden" name="item_id" value="[catalogid]">
                          <input type="text" size="2" name="qty-[counter]" value="0" class="txtBoxStyle"></td>
                          </tr>
                          </table>
                          <!--END: ITEM_TEMPLATE_1-->

                          The template was displaying 4 columns of information divided to use 100% of the space. I wanted to add a new field - so changed it to 5 columns.

                          Then I copied the code exactly for how it displays ITEMPRICE - but I used CLASS="item" instead of CLASS="Price" because I'm assuming my field comes from the product item file.

                          I don't get garbage code anymore - but it just displays the word STOCK instead of the value.

                          Any ideas??? DMC Floss
                          C Ekman
                          Owner/Designer: Cobweb Corner
                          http://www.cobwebcorner.com

                          Comment


                          • #14
                            You can try to search, but a few months ago Piaf offered code that enabled stock figures to show on the category page. I used her code and it works great. It was very simple but I couldnt even begin to tell you the exact code.

                            Comment


                            • #15
                              Yes - I found that thread her code is

                              <td class="item"><b>[product_Header-availability]</b><span class="price">&nbsp;&nbsp;[stock] In Stock</span></td>


                              And - look at that - the CLASS for stock is PRICE - not ITEM

                              Going to go try that...
                              C Ekman
                              Owner/Designer: Cobweb Corner
                              http://www.cobwebcorner.com

                              Comment

                              Working...
                              X