+ Reply to Thread
Results 1 to 4 of 4

Thread: Displaying stock counts

  1. #1
    Client
    Join Date
    Nov 2010
    Posts
    5
    Squirrelcart version
    v3.2.2

    Displaying stock counts

    I’m trying to display the number of items in stock in the item description and the item preview on regular pages. Like this store does (which I found in a thread here);

    http://yellowbellyfrog.com/store.php...maker-soap-bag

    My issue is pretty much the same as the following thread covers:

    http://www.ldev.com/forums/showthrea...ht=items+stock

    I’m using the Main Street theme, and I’ve found the product.detail.tpl.php but I don’t see the show.product.detail.tpl.php, which is where Jamie says to add:

    Code:
    Number in stock: <?=$Number_in_Stock?><br />
    So my question is, what are the files I need to add that code too, and where exactly in that file should I put the code so that the stock count appears in every place that displays that product?

  2. #2
    Client
    Join Date
    Oct 2010
    Location
    Missouri
    Posts
    49
    Squirrelcart version
    v3.3.0
    All you need to do is add it to the product_detail.tpl.php... I believe show.product.detail.tpl.php for for an older version of Squirrelcart.

    File: squirrelcart/themes/<THEME_NAME>/product_detail.tpl.php
    Example: This would put it right above the price.
    Find: "<h2>Buy Now!</h2>" and put the line of code Jamie stated just like this.

    PHP Code:
            <div class="prod_section buy_now">
                <h2>Buy Now!</h2>
                Number in stock: <?=$Number_in_Stock?><br />
    If you want it in the category details where all products are shown with thumbnails, do this.

    File: squirrelcart/themes/<THEME_NAME>/product_thumbnail.tpl.php
    Example: This would put it right above the price.
    Find: "<!-- price info -->" and put the line of code Jamie stated just like this.

    PHP Code:
            <!--  price info -->
            Number in stock: <?=$Number_in_Stock?><br />
    If you want it in featured products as well, do this.

    File: squirrelcart/themes/<THEME_NAME>/featured_product.tpl.php
    Example: This would put it right above the price.
    Find: "<div class="featured_price">" and put the line of code Jamie stated just like this.

    PHP Code:
                        <div class="featured_price">
                          Number in stock: <?=$Number_in_Stock?><br />
    Hope that helps.

    Thanks,
    Jarrod

  3. #3
    Client
    Join Date
    Nov 2010
    Posts
    5
    Squirrelcart version
    v3.2.2
    That worked like a charm, thanks! In the main street theme there are no ‘product_thumbnail.tpl.php’ or ‘featured_product.tpl.php’ files, but I copied the ones from the Squirrelcart theme, added that code, and placed them in our main street theme folder.

    Thanks again Jarrod!
    Shawn

  4. #4
    Client
    Join Date
    Oct 2010
    Location
    Missouri
    Posts
    49
    Squirrelcart version
    v3.3.0
    No problem, and glad to hear you got it working.

    Thanks,
    Jarrod

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts