Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / How do I add 'Units available' to the qty number on the products listing page?

How do I add 'Units available' to the qty number on the products listing page?

Locked

Started by vivaraquel on 17 Aug 2008, 4:26 AM · Views: 1,345

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
17 Aug 2008, 4:26 AM
#1
vivaraquel avatar

vivaraquel

Zen Follower

Join Date:
Sep 2004
Location:
Australia
Posts:
305
Plugin Contributions:
0

Post #1 by vivaraquel

Hi, I have looked around the forum for this with no luck.

On this page http://dreamevent.com.au/fiona/index.php?main_page=index&cPath=1 you'll see a list of products displaying img, name, price, add, and how much is in stock. However, the available qty is just a number, for all a buyer knows, it could mean a size.

I'd like to add text in front of the number to suggest that it refers to how many are in stock.

Where would I do this? Thank you.

17 Aug 2008, 11:21 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Post #2 by stevesh

The stock Zencart product info page looks like this

**Model: 01234
Shipping Weight: 8lbs
0 Units in Stock **

so I'd guess you've modified that template to move stuff around, and in the process, removed the 'units in stock' text.

You'll have to go back and figure out where it went, either in that template file or the file where that text is defined.

18 Aug 2008, 12:22 AM
#3
vivaraquel avatar

vivaraquel

Zen Follower

Join Date:
Sep 2004
Location:
Australia
Posts:
305
Plugin Contributions:
0

Post #3 by vivaraquel

Thank you for your reply Stevesh, however I have not made any changes to it. If you go to the link in my 1st post you'll see it has
PRODUCT IMG
PRODUCT NAME
PRICE
ADD TO CART
ANAILABLE QUANTITY.

The available qty is just a number. What you're talking about shows up in the porduct info info page http://dreamevent.com.au/fiona/index.php?main_page=product_info&cPath=1&products_id=1&zenid=48e2fa0dc7c1241ba9e5b6c6ef56f463 which I haven't changed.

I don't want to chnage stuff in there, just in the previous page where all products in a category are listed as per my original post.

Thnak you.

25 Sep 2008, 2:11 AM
#4
alext avatar

alext

New Zenner

Join Date:
May 2007
Location:
Perth, Australia
Posts:
54
Plugin Contributions:
0

Post #4 by alext

Hi,

If you figured out how to add text like "In stock:" or "Available:" in front of the quantity number in the category listing, could you please share this?

Many thanks,
Alex

vivaraquel:

Hi, I have looked around the forum for this with no luck.

On this page http://dreamevent.com.au/fiona/index.php?main_page=index&cPath=1 you'll see a list of products displaying img, name, price, add, and how much is in stock. However, the available qty is just a number, for all a buyer knows, it could mean a size.

I'd like to add text in front of the number to suggest that it refers to how many are in stock.

Where would I do this? Thank you.

Learning the hard way -
Matryoshka Dolls

25 Sep 2008, 2:39 AM
#5
vivaraquel avatar

vivaraquel

Zen Follower

Join Date:
Sep 2004
Location:
Australia
Posts:
305
Plugin Contributions:
0

Post #5 by vivaraquel

No, I'm sorry, I still haven't worked it out but I really would like to thought as I feel it looks stupid just a number sitting there on its own. If anyone knows, please let us know. Thank you.

25 Sep 2008, 2:04 PM
#7
vivaraquel avatar

vivaraquel

Zen Follower

Join Date:
Sep 2004
Location:
Australia
Posts:
305
Plugin Contributions:
0

Post #7 by vivaraquel

Thanks AlexT.

I tried that, it did absolutely nothing for me. My code looks like this:
case 'PRODUCT_LIST_QUANTITY':
$lc_text = TABLE_HEADING_QUANTITY;
$lc_align = 'right';
$zc_col_count_description++;
$lc_temp = $listing->fields['products_quantity'];
$lc_text="${lc_temp} Units in Stock.";
break;

The $zc_col_count_description++; was already there. I removed it but it still did nothing.

Thanks for taking the time to reply.

25 Sep 2008, 2:30 PM
#8
alext avatar

alext

New Zenner

Join Date:
May 2007
Location:
Perth, Australia
Posts:
54
Plugin Contributions:
0

Post #8 by alext

You are in a wrong place of the file, try to find the second instance of PRODUCT_LIST_QUANTITY further down.

Find

case 'PRODUCT_LIST_QUANTITY':
          $lc_align = 'right';
          $lc_text = $listing->fields['products_quantity'];
          break;

Replace with

case 'PRODUCT_LIST_QUANTITY':
  $lc_align = 'right';
  $lc_text = 'In Stock: ' . $listing->fields['products_quantity'] . '';
  break;

Learning the hard way -
Matryoshka Dolls

25 Sep 2008, 10:09 PM
#9
vivaraquel avatar

vivaraquel

Zen Follower

Join Date:
Sep 2004
Location:
Australia
Posts:
305
Plugin Contributions:
0

Post #9 by vivaraquel

YAY, thank you, that did it. I should have re read the post better and notice the quote of 'in the second instance'. It's been a long day.

Thank you again.