Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / quantity on product listing - needs text too

quantity on product listing - needs text too

Views: 2,860

Results 1 to 15 of 15
5 Mar 2007, 12:15 PM
#1
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

quantity on product listing - needs text too

Hello! Forgive me.. this question is the result of me not remembering if/where I changed this last year:

On the product listing pages (not product info), I have decided to show the quantity available because I now have the multiple add to cart quantity boxes. My problem is that all it shows is a number, there is nothing next to it that says "in stock" or "available". It may confuse people.

It shows:

5

When I'd like it to show:

5 in stock

Does anyone know where I can fix this? Much thanks in advance.

11 Mar 2007, 6:21 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: quantity on product listing - needs text too

Have you an URL we can look at?

There should be a title above each column ...

12 Mar 2007, 7:49 AM
#3
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: quantity on product listing - needs text too

Thanks for replying! My site is down for maintenance right now because I switched hosts and things are a little screwy. More work! Yay! Anyway, someone on this thread had the same question (just found it):

http://www.zen-cart.com/forum/showthread.php?t=47824

and you can see what I mean on their website here:

http://www.doodlebuckets.com/store/index.php?main_page=index&cPath=7

Above the price it just shows a number and we'd like it to say "Qty:" before the number or "available" after the number... something like that.

I thought it was something I had changed a long time ago, because I did change things to say "In stock" instead of "Units In Stock" but doodlebuckets has it too so maybe its not just me?!?!?

Anyway, your help is greatly appreciated as always.

12 Mar 2007, 7:59 AM
#4
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: quantity on product listing - needs text too

I think its probably in the files for the column display mod, but I have no clue how to edit them.

15 Mar 2007, 9:25 PM
#5
doodlebuckets avatar

doodlebuckets

Totally Zenned

Join Date:
Jul 2005
Posts:
497
Plugin Contributions:
0

Re: quantity on product listing - needs text too

Did this ever get resolved? I have been observing customer behavior and I am consistently seeing them order more than I have in stock b/c they don't understand without the text that the # stands for quantity.

I just uploaded the new columnar layout for 1.3.6 and 7 but it's still not there. What to do? I am not a coder! I have looked at the files and am not sure what to modify.

15 Mar 2007, 10:01 PM
#6
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: quantity on product listing - needs text too

Doodlebuckets:

Did this ever get resolved? I have been observing customer behavior and I am consistently seeing them order more than I have in stock b/c they don't understand without the text that the # stands for quantity.

I just uploaded the new columnar layout for 1.3.6 and 7 but it's still not there. What to do? I am not a coder! I have looked at the files and am not sure what to modify.

Hi Amy! No, I still haven't figured this one out. In the meantime, I have removed the quantity and I have been editing a lot of products and changing them to "Product Qty Maximum: 1". Next to that field it says that the quantity box will be removed if you put "1", but its still there (which is what I want). When you use the Product Qty Maximum field, if the customer tries to add more than one to the cart, it will only add 1.

I have a lot of products that need to be changed though, and would prefer to find the answer to our question before I go and change all of those products. In the future when I add a product, I am going to make sure I use the Product Qty Maximum field. I'll let you know as soon as I find out anything.

15 Mar 2007, 10:09 PM
#7
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: quantity on product listing - needs text too

If anyone would be willing to help us, here is an example:

:smile:

p.s. the link above in post #3 to doodlebuckets site is not what we are looking for as she has since changed it and does not have the columnar display right now.

15 Mar 2007, 11:12 PM
#8
doodlebuckets avatar

doodlebuckets

Totally Zenned

Join Date:
Jul 2005
Posts:
497
Plugin Contributions:
0

Re: quantity on product listing - needs text too

I just went back to rows for the time being...

21 Mar 2007, 9:36 PM
#9
tmc_sherpa avatar

tmc_sherpa

Zen Follower

Join Date:
Mar 2007
Posts:
158
Plugin Contributions:
0

Re: quantity on product listing - needs text too

What you need is in

includes/modules/YOUR TEMPLATE/product_listing.php

look for

case 'PRODUCT_LIST_QUANTITY':

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

(Its the second instance of PRODUCT_LIST_QUANTITY in the file, playing with the first one would be bad as I think its for the database query)
and replace it with

case 'PRODUCT_LIST_QUANTITY':

      $lc_align = 'right';
$lc_temp = $listing->fields['products_quantity'];

      $lc_text = "Your Text Here ${lc_temp} Or Here";
break;

Having the temp variable is probably not the bestest, but does work. Please note the use of double quotes as it will not do the variable substitution with singles.

21 Mar 2007, 9:42 PM
#10
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: quantity on product listing - needs text too

Thanks so much for replying TMC_Sherpa! I will try it out and will post back with my results so others can benefit. :smile:

9 Apr 2007, 10:56 AM
#11
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: quantity on product listing - needs text too

Just to update everyone... TMC_Sherpa is wonderful! This works exactly as I wanted. Thanks so much!

9 Apr 2007, 6:24 PM
#12
tmc_sherpa avatar

tmc_sherpa

Zen Follower

Join Date:
Mar 2007
Posts:
158
Plugin Contributions:
0

Re: quantity on product listing - needs text too

Good! I haven't heard anything and was beginning to think it took down the whole server or something :P
fyi

case 'PRODUCT_LIST_QUANTITY':

      $lc_align = 'right';

$lc_text = "Your Text Here " . $listing->fields['products_quantity'] . " Or Here"; break;

is probably a better way of doing it, removes an extra variable from the mix...

9 Apr 2007, 10:08 PM
#13
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: quantity on product listing - needs text too

TMC_Sherpa:

Good! I haven't heard anything and was beginning to think it took down the whole server or something :P
fyi

case 'PRODUCT_LIST_QUANTITY':

      $lc_align = 'right';

$lc_text = "Your Text Here " . $listing->fields['products_quantity'] . " Or Here"; break;

is probably a better way of doing it, removes an extra variable from the mix...

Hmm, well this one gave me an error, so I stuck with the first method. I also used the first method to add "item#" in front of the model number. Much thanks again!

9 Apr 2007, 10:25 PM
#14
tmc_sherpa avatar

tmc_sherpa

Zen Follower

Join Date:
Mar 2007
Posts:
158
Plugin Contributions:
0

Re: quantity on product listing - needs text too

ick, I think I boogered the quotes

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

mind you it did work on 4.3.11 PHP (meh, its old, but runs on the emac I have to play with at work)

8 Feb 2011, 10:40 AM
#15
sam_m avatar

sam_m

New Zenner

Join Date:
Nov 2007
Posts:
71
Plugin Contributions:
0

Re: quantity on product listing - needs text too

Just thought I would put a thanks on this thread aswell even though its 4 years down the line, as its just helped me to sort out that issue too :) thanks Sherpa