Print Page | Close Window

Stock Level on a Category Page

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=5143
Printed Date: 02-July-2025 at 8:26am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Stock Level on a Category Page
Posted By: avalight
Subject: Stock Level on a Category Page
Date Posted: 23-May-2012 at 12:38pm
Hello
I am interested in displaying the units on hand for a non-apparel product on the category page.  The information shows up on the product page, but the visitor must click through before they can see how many units are in our inventory.  Perhaps this is a small tweak to the code, I don't know. 

Thoughts, anyone?
Thanks
curt



-------------
Curt



Replies:
Posted By: Guests
Date Posted: 24-May-2012 at 12:41am
Hi Curt,

This is easily doable ... I just haven't had a minute to respond with instruction on it today. 

Meanwhile, could you let us know what layout you're using for your category pages?


Posted By: avalight
Date Posted: 24-May-2012 at 12:58am
Hi Sean
Here is the category page i am putting this on:  http://www.modernclassics.com/store/pc/Quick-Ship-Products-c35.htm" rel="nofollow - page link
So I think that is horizontal.
I think the code mod is in the pcShowProductH.asp, around line 33

I am using V4.5a

Best
Curt


-------------
Curt


Posted By: Guests
Date Posted: 24-May-2012 at 3:14am
Hi Curt,

I couldn't resist looking into this before I shut down tonight.

Displaying the stock qty is a snap as the data is already there. You can simply place something like the following on any pcShowProduct*.asp page wherever you'd like it:
<p class="myShowStock">stock: <%=pStock%></p>
I would probably put this right above the "more info" and "buy" buttons.

To limit this to only display for non-apparel products, you'll need to tweak some stock code.

First, you'll need to add the field to the query generating the array of product data. Find:
'// Query Products of current category
Below that is the query you'll need to edit. In that query, find:
products.pcProd_BackOrder FROM products
Add the new field so that part is now:
products.pcProd_BackOrder, products.pcProd_Apparel FROM products
Now capture that from the product array to use later. Find: 
pcv_intBackOrder=pcArray_Products(15,pCnt) '// rs("pcProd_BackOrder")
Below that, add:
pcv_intApparel=pcArray_Products(16,pCnt) '// rs(" .pcProd_Apparel ")
Now you can use this information on your display intelligently, so that the above display markup would be instead, like this:
<% if pcv_intApparel <> 1 then %>
<p class="myShowStock">stock: <%=pStock%></p>
<% end if %>
I expect that should do what you're looking for.


Posted By: avalight
Date Posted: 24-May-2012 at 11:05am
Wow, thanks, I will check it out and let you know how it went.
Best
Curt


-------------
Curt


Posted By: Guests
Date Posted: 31-May-2012 at 4:02am
Hi Curt,

How'd it go? 

I do see a little syntax error in my directions above, though. This bit should be:
pcv_intApparel=pcArray_Products(16,pCnt) '// rs("pcProd_Apparel ")

I hope that didn't throw you.

This is so "doable" that I'd like to add it to the wiki once I know how it went for you. 
< id="Siber_1" ="application/rf-chrome-plugin" style="left: 0px; top: 0px; width: 0px; height: 0px; : fixed; display: block; ">


Posted By: avalight
Date Posted: 31-May-2012 at 2:08pm
Hi Sean
I only used part of the code, as the products that I was showing were not apparel products and in a special category I created for Quick Ship Products.

[code]
<% if pIDCategory=35 then %>
        <p class="pcShowProductStock">Stock on Hand: <%=pStock%></p>
        <% end if %>
[code]

In your code, does the stock on hand show alongside each product option without having to click?

Anyway, it was helpful to get this from you.

Thanks
Curt



-------------
Curt



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