Forums / Setting Up Categories, Products, Attributes / Displaying Product Quantity for some products only

Displaying Product Quantity for some products only

Locked

Started by bumboo on 11 Apr 2009, 12:42 AM · Views: 987

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
11 Apr 2009, 12:42 AM
#1
bumboo avatar

bumboo

New Zenner

Join Date:
Dec 2008
Posts:
6
Plugin Contributions:
0

Displaying Product Quantity for some products only

Hello,

I hope that there is a Zen expert that can help me!

I would like to be able to display the amount of products available for the 'seconds' (products with slight flaws) only. For the regular products I don't want to have any quantity displayed.

Does anyone know if it's possible? If so how do I do it?!

Many thanks for any tips!
Cheers,
Tiff

11 Apr 2009, 3:58 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Displaying Product Quantity for some products only

What distinguishes the Products you want to see the quantity and the ones that you don't want to see the quantity ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

11 Apr 2009, 11:23 AM
#3
bumboo avatar

bumboo

New Zenner

Join Date:
Dec 2008
Posts:
6
Plugin Contributions:
0

Re: Displaying Product Quantity for some products only

Hi Ajeh,

The Products that I want to see the quantity in are listed a seperate category named 'Seconds'. These are the products in my store that have slight flaws and are only available in limited quantities.

All remaining products (each with their own category) always have plenty in stock and I don't wish to have an amount displayed of how many are available.

Is that the information you needed?

Hope you might be able to help!
Cheers,
Tiff

11 Apr 2009, 2:25 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Displaying Product Quantity for some products only

You could put a conditional IF around the display of the Units based on master_categories_id for that Seconds Category ...

You can customize the template using your overrides so that if the Seconds categories_id is 10, then use:

<?php
$show_seconds = $db->Execute("SELECT master_categories_id from " . TABLE_PRODUCTS . " WHERE products_id ='" . $product_info->fields['products_id'] . "'");
if ($show_seconds->fields['master_categories_id'] == 10) {
  // show quantity
  $show_quantity_seconds = true;
} else {
  // do not show quantity
  $show_quantity_seconds = false;
}
?>
  <?php echo ($show_quantity_seconds && ($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>'  : '') . "\n"; ?>

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 Apr 2009, 5:42 AM
#5
bumboo avatar

bumboo

New Zenner

Join Date:
Dec 2008
Posts:
6
Plugin Contributions:
0

Re: Displaying Product Quantity for some products only

Hi Linda,
Wow, thanks so much!

Are you able to help me just one little bit more ... which template file should I be editing?:blush: I'm still learning!

Many thanks,
Tiff

PS Will this work for the Product Listing (where I have quantity turned on) - not the Product Information display (which I have quantity turned off permantly)?

12 Apr 2009, 5:50 AM
#6
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,188
Plugin Contributions:
0

Re: Displaying Product Quantity for some products only

Bum
Use all the tools that Zen provides...

Ajeh, has written the .php code for you, so lets look at the code

  1. admin panel/ tools/ developers tool kit
  2. bottom left hand side
  3. search for:
  4. TEXT_PRODUCT_QUANTITY
  5. drop down box, to right, Click: category
  6. then click search
  7. Now we see all the files associated with this Code..
  8. Looks like you will add the code here:
  9. includes/ templates/ your_template/ templates/ tpl_product_info_display.php

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

12 Apr 2009, 4:21 PM
#7
ajeh avatar

ajeh

Oba-san

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

Re: Displaying Product Quantity for some products only

That's the one ... thanks haredo ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 Apr 2009, 12:52 AM
#8
bumboo avatar

bumboo

New Zenner

Join Date:
Dec 2008
Posts:
6
Plugin Contributions:
0

Re: Displaying Product Quantity for some products only

thanks so much for the help :smile:

16 Apr 2009, 1:54 PM
#9
lobazniouk avatar

lobazniouk

New Zenner

Join Date:
Mar 2009
Location:
Somerset West, South Africa
Posts:
11
Plugin Contributions:
0

Re: Displaying Product Quantity for some products only

Hi Zenners:

Im very new to Zencart and i know very little, but i cant get this right, ive been looking for a way to only show units left in one category, but even though i read this topic i still cant get it, please guys could you give me a hand here!

Thanks in advance