Forums / Setting Up Categories, Products, Attributes / Turn a field on/off in product listing

Turn a field on/off in product listing

Locked

Views: 1,757

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
23 Oct 2007, 11:24 AM
#1
rwoody avatar

rwoody

Totally Zenned

Join Date:
Aug 2004
Location:
Fountain Hills, AZ
Posts:
476
Plugin Contributions:
0

Turn a field on/off in product listing

I've created a new product type that merely added one field. I've also coded product_listing to display the field on the listing page. 90% of the customer's products will need this field, but there are a few to include Gift Cards (Gift Certificates) that I would rather not have it show.

Is there a bit of code that could be added to the template that could detect the product type and if not product_type 6 don't display field?

I'm not quite sure how to go about this. Any suggestions would be greatly appreciated.

23 Oct 2007, 6:00 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Turn a field on/off in product listing

You would need to customize the product listing files so that when the products_type is not your new Product Type the individual listing will exclude that field ...

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!

1 Nov 2007, 12:46 AM
#3
poolprorich avatar

poolprorich

Zen Follower

Join Date:
Aug 2007
Location:
Tampa FL.
Posts:
143
Plugin Contributions:
0

Re: Turn a field on/off in product listing

$query = "SELECT your_field, FROM your_table WHERE product_type='6' and products_status='1' ;
$result = mysql_query($query) or die(mysql_error());
// Print out result
while($row = mysql_fetch_array($result)){
echo $row['your_field to be displayed'];

}

?>