Print Page | Close Window

In Stock/Out of Stock on Product Lists

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=18
Printed Date: 07-July-2025 at 3:41am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: In Stock/Out of Stock on Product Lists
Posted By: ComputerJack
Subject: In Stock/Out of Stock on Product Lists
Date Posted: 02-November-2005 at 11:29am

I'm about to embark on an adventure to try to show In Stock/Out of Stock on the product list.

What we want is to modify viewCat_P to indicate when a product is out of stock, so the user doesn't have to click on "More Details" to find out.  Also, I'm going to explore putting small icons to the right of the product representing which sizes are in-stock (apparel add-on).  Should be a lot of fun.

Has anyone done anything like this before?  If so, any advice would be dearly welcome!




Replies:
Posted By: Planetlava_com
Date Posted: 01-December-2005 at 9:51pm

Is this what you mean? (see link Below)

http://www.planetlava.com/shop/pc/viewCat_P.asp?idCategory=46 - http://www.planetlava.com/shop/pc/viewCat_P.asp?idCategory=4 6

Here is the code I used... It was added to the prdD1.asp file where I wanted the images to show up.

<% if pstockstat > 0 then %>
 <img src="images/in-stock.gif" alt="in stock product">
 <% end if %>

<% if pstockstat = 0 then %>
 <img src="images/out-stock.gif" alt="in stock product">
 <% end if %>

<% if pstockstat < 0 then %>
 <img src="images/out-stock.gif" alt="in stock product">
 <% end if %>

Note: Don't forget to upload your images and change the folder and filenames accordingly.

The pstockstat variable is loaded in viewCat_P.asp. I can't remember if it is there in the original code or if I added it. If it is not there it is loaded with the following line in the same area the other variables for each product are loaded...

pstockstat=rstemp2("stock")

Good Luck!

T-Bone

 



Posted By: ComputerJack
Date Posted: 02-December-2005 at 8:50am

Marvellous!

I didn't expect it would be that easy...I hadn't noticed that the stock level was returned in the query.

I'm assuming you're not running the apparel add-on, correct?  I think that'll add a bit of complexity, because apparel items stock level isn't quite real-time.  There's a script that runs when you do a search by stock level that updates all the apparel items stock.  I'm looking into replacing that with a SQL trigger so that it IS real-time.  Once that's done, your simple code will work wonders!

Thanks a bunch!



Posted By: katharina
Date Posted: 11-December-2005 at 9:30pm

Question, will it show out of stock if you have your backoffice on ignore stock on some item.  For example we have an item we make on demand and do not have stockage on.  Our site lets the customer buy it, even with 0 or negative inventory.  We basically set this particular item to ignore stock in the back office.  I like to use the code, but do not want to show items out of stock, if they are on ignore stock.  Looking at the code it looks like it only looks for a positive number.  Is there a way to enhance it and consider the ignore inventory feature.

Katharina



Posted By: fidjiti
Date Posted: 07-February-2007 at 4:58am
I would think that if you're out of stock and you told the system to allow orders for out of stock items and you've entered the estimated time it'll take to ship, you can change your image to say "Special Order" or "Ships in X days" instead of showing the out of stock image. No one wants to see that. You can make it look possitive. :) But if you make the item inactive then you won't see that item at all, so you woudn't have to worry about the image.
hope that makes sense and hope that helps. I haven't tried that code change yet, but I may in the future. Let me know how it works. If I'm wrong I'd love it if someone could correct me. (I'm new to this.)



-------------
Linda - I wish I knew ASP.
To view my ever evolving site click the "www" button below. :)


Posted By: rotokirby
Date Posted: 15-June-2007 at 11:13pm
In similar fashion to the above I've attempted to add Inventory status to
our category pages...the following works for regular categories (those
loaded by viewcategories.asp):

Add the following to pcShowProductH.asp (assuming you're using
Horizontal alignment)....


           <% if pstock > 2 then %>
     In Stock
      <% end if %>
     
      <% if pstock < 3 and pstock > 0 then %>
     Low Stock
      <% end if %>

     <% if pstock = 0 then %>
     Out of Stock
     <% end if %>

     <% if pstock < 0 then %>
     Out of Stock
     <% end if %>



I would also like to get it to work for the "special" categories such as
Specials, Featured Products etc. but can't seem to make it work. Anyone
have any ideas?



Posted By: rotokirby
Date Posted: 15-June-2007 at 11:45pm
Figured it out... I had to declare the variable for each of those pages
seperately by inserting the following in various places:


' Set variables for H display
if pcPageStyle = "h" then
     set pStock=rsProducts("stock")
     set pNoStock=rsProducts("noStock")
end if


I'm no coder, so if anyone sees some catastrophic result that could come
of my technique, I'm all ears....I'm just using logic and cutting and pasting
stuff until I get what I want! :)



Posted By: Tzur-pc
Date Posted: 09-July-2007 at 11:50pm

Hi,

I dont understand what file should i edit and where shuold i add this lines????

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net