Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Adding words after Product Quantity?

Adding words after Product Quantity?

Views: 1,281

Results 1 to 14 of 14
30 Dec 2012, 6:34 PM
#1
bubbadan avatar

bubbadan

New Zenner

Join Date:
Apr 2005
Location:
TN
Posts:
96
Plugin Contributions:
0

Adding words after Product Quantity?

I would like to add the words "lbs Left" after the display of the quantity of products.
We sell closeout fragrances and I would just like to have it very clear that the number listed means how many pounds we have left of the product in stock.

Anyone know how this could be done?

I have attached an image of how it looks now and how I want it to look if that helps.

Thank You
Bubba

Attachment 11675

30 Dec 2012, 7:44 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Adding words after Product Quantity?

A quick answer would be to edit the tpl_products_all_default.php in the yourtemplate/templates directory BUT there are so many variables in play here. Not the least of which is, "Are ALL your products measured in pounds?"
You failed to answer any of the posting tips AND you didn't even answer the basic "What version of Zen Cart?"
We need more info and a look at the cart (READ THE *NOTE BEFORE POSTING A LINK).

30 Dec 2012, 9:30 PM
#3
bubbadan avatar

bubbadan

New Zenner

Join Date:
Apr 2005
Location:
TN
Posts:
96
Plugin Contributions:
0

Re: Adding words after Product Quantity?

Sorry. That info was always in my signature (As in your "reminders"). Have no idea why it isn't there anymore. Can't find where to add it in my profile either

Using version 1.5 and yes EVERYTHING is in Pounds.

30 Dec 2012, 9:48 PM
#4
bubbadan avatar

bubbadan

New Zenner

Join Date:
Apr 2005
Location:
TN
Posts:
96
Plugin Contributions:
0

Re: Adding words after Product Quantity?

At least I found where to update my signature (I think)

30 Dec 2012, 9:53 PM
#5
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Adding words after Product Quantity?

Under Forum Actions in the menu bar above will get you to your sig.
Meanwhile, 1.5.0 or 1.5.1, custom template, upgraded? Etc.
If customized, does your custom template have a tpl_products_all_default.php in its templates directory?
If it does, you will need to carefully modify it to make sure nothing placed there by another mod is not munged.
If it does not, you can change> <div id="allProductsListingTopNumber" class="navSplitPagesResult back"><?php echo $products_all_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_ALL); ?></div>to> <div id="allProductsListingTopNumber" class="navSplitPagesResult back"><?php echo $products_all_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_ALL , ' lbs left'); ?></div>I have not tested this on a test site, but it should work.

30 Dec 2012, 10:09 PM
#6
bubbadan avatar

bubbadan

New Zenner

Join Date:
Apr 2005
Location:
TN
Posts:
96
Plugin Contributions:
0

Re: Adding words after Product Quantity?

Sorry... That didn't work.
Yes I have a custom template and no there was no such file in my templates

Here is the link to the page where I want the lbs. Left to be displayed if that helps

http://tradewindsfragrance.net/index.php?main_page=index&cPath=21_28

30 Dec 2012, 10:53 PM
#7
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Adding words after Product Quantity?

Now we know you're using it in a category display versus product, we can get closer. Item eight down the list of Posting Tips. Knowledge is power.:P
SO.... There are only 10 tons of Aquamarine left?
Will have to look at this later, but setting text based on a specific category is doable as well.
Anyone else is free to jump in.

31 Dec 2012, 12:52 AM
#8
bubbadan avatar

bubbadan

New Zenner

Join Date:
Apr 2005
Location:
TN
Posts:
96
Plugin Contributions:
0

Re: Adding words after Product Quantity?

Well I did post the image.
All I need is what I said... lbs left

Once I get this up the products will be split (Colors vs Fragrance) in to two different sites as both have been sold off to other companies.
I just need a simple "lbs. Left" that is all... nothing less, nothing more.

31 Dec 2012, 1:56 AM
#9
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Adding words after Product Quantity?

Well, let's see:

  1. Never really answered posting tips.
  2. Title of the thread said nothing about where the Product Quantity was that needed the addition.
  3. Took four hours of haggling to get enough information to even come close to a solution or where one might be.
  4. Thought that an image could tell us all the php coding going on in the background or that it would inform us as to the actual page needing a fix.
  5. Finally declared that it's simple and implied that my questions were irrelevant.

As the commercial says, "Priceless".

As I said in the earlier post, This simple volunteer is simply not able to devote simple time to this simple problem till later this evening. And, any other simple volunteer is welcome to simply take over until then.

31 Dec 2012, 6:36 PM
#10
bubbadan avatar

bubbadan

New Zenner

Join Date:
Apr 2005
Location:
TN
Posts:
96
Plugin Contributions:
0

Re: Adding words after Product Quantity?

Sorry for asking a question on a help forum!
I won't make that mistake again... I promise.

31 Dec 2012, 8:48 PM
#11
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,711
Plugin Contributions:
56

Re: Adding words after Product Quantity?

Try looking at includes/modules/YOUR_TEMPLATE/product_listing.php
(If it's not there, copy it from includes/modules/product_listing.php).

Look at the block that prints

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

try changing the setting of $lc_text to what you want.

$lc_text = $listing->fields['products_quantity'] . " lbs. left";

31 Dec 2012, 10:17 PM
#12
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Adding words after Product Quantity?

1.5.0 will look slightly different as it now uses defines> case 'PRODUCT_LIST_QUANTITY':

$lc_text = TABLE_HEADING_QUANTITY;
$lc_align = 'right';
$zc_col_count_description++;
break;Could a fix be> case 'PRODUCT_LIST_QUANTITY':
$lc_text = (TABLE_HEADING_QUANTITY , ' lbs Left');
$lc_align = 'right';
$zc_col_count_description++;
break;Or is that code incorrect?
31 Dec 2012, 10:36 PM
#13
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,711
Plugin Contributions:
56

Re: Adding words after Product Quantity?

It is incorrect. That code manages the table headings. My post shows the required changes.

31 Dec 2012, 10:49 PM
#14
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Adding words after Product Quantity?

Correct! Didn't scroll down far enough:blush: