Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Mod to Grid Layout product display page

Mod to Grid Layout product display page

Locked

Views: 3,170

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
10 Mar 2007, 7:08 PM
#1
jaygee avatar

jaygee

New Zenner

Join Date:
Mar 2005
Location:
UK
Posts:
38
Plugin Contributions:
0

Mod to Grid Layout product display page

I'm trying to mod the product_listing.php so that all products with priced attributes will have "from" before the price within the grid listing product display. I think I can do it using a conditional If statement and I thought I would use the zen_has_product_attributes_values($products_id) variable that seems to be set to true if the case is met. Can't seem to get it to work as I'm not sure how to compare the value. Not a programmer so may be getting a little confused. Need something along the lines of:

 
if  (zen_has_product_attributes_values($products_id) =="true") {
$lc_price = 'from ' . zen_get_products_display_price($listing->fields['products_id']) . ''; 
} else {
$lc_price = zen_get_products_display_price($listing->fields['products_id']) . ''; 
}

(zen_has_product_attributes_values($products_id) = true) is obviously wrong so if someone can steer me in the right direction it would be much appreciated.

10 Mar 2007, 7:38 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Mod to Grid Layout product display page

$products_id is most likely $listing->fields['products_id']

10 Mar 2007, 9:14 PM
#3
jaygee avatar

jaygee

New Zenner

Join Date:
Mar 2005
Location:
UK
Posts:
38
Plugin Contributions:
0

Re: Mod to Grid Layout product display page

Brilliant!

Worked first time. If anyone else is interested I changed the code as follows:

case 'PRODUCT_LIST_PRICE':
if  (zen_has_product_attributes_values($listing->fields['products_id']) =="true"){
$lc_price = 'from ' . zen_get_products_display_price($listing->fields['products_id']) . ''; //JRG line break removed and from included
} else {
$lc_price = zen_get_products_display_price($listing->fields['products_id']) . '';
}
$lc_align = 'right';
$lc_text =  $lc_price;  

Ajeh,

Many Thanks.

Bought you a cup of coffee (no biscuits!). If you get the chance to explain exactly what $listing->fields does it would be appreciated

11 Mar 2007, 4:23 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Mod to Grid Layout product display page

Glad to hear that this was able to resolve your issues ...

Thanks very much for the support ... we really appreciate it to help keep Zen Cart growing and growing and growing! :cool:

Whether it's a cup of coffee or a great big urn of coffee ... every little bit helps ... :smile: