Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / On 'product list page' I need an extra icon to appear when the product has an url.

On 'product list page' I need an extra icon to appear when the product has an url.

Views: 1,285

Results 1 to 7 of 7
20 Apr 2012, 12:43 PM
#1
post_carlos avatar

post_carlos

New Zenner

Join Date:
Dec 2011
Posts:
15
Plugin Contributions:
0

On 'product list page' I need an extra icon to appear when the product has an url.

On the 'product list page' I need an extra icon to appear over a products image when the product has a "product url".

I thought it would be something like:

<?php if ($products_url !== "") { echo '<img src="images/dm.gif">'; }; ?>

Any ideas?
Regards,
Carlos.

20 Apr 2012, 1:13 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: On 'product list page' I need an extra icon to appear when the product has an url.

$products_url is not used in product_listing.php. I don't have time at the moment to see if it is available from upstream - have you checked this? If it is available, your code looks good. If not, you would have to add that to the list of fields retrieved from the db upstream and put it into the appropriate array.

20 Apr 2012, 2:48 PM
#3
post_carlos avatar

post_carlos

New Zenner

Join Date:
Dec 2011
Posts:
15
Plugin Contributions:
0

Re: On 'product list page' I need an extra icon to appear when the product has an url.

Sorry, I'm not that experienced, is there anybody that knows how to do it?

20 Apr 2012, 2:50 PM
#4
post_carlos avatar

post_carlos

New Zenner

Join Date:
Dec 2011
Posts:
15
Plugin Contributions:
0

Re: On 'product list page' I need an extra icon to appear when the product has an url.

Do you know where I can find the specific list of field?

20 Apr 2012, 4:37 PM
#5
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: On 'product list page' I need an extra icon to appear when the product has an url.

you need to add (pd.products_url) to your /includes/index_filters/YOUR_TEMPLATE/default_filter.php file in 4 different places

look for something that starts like this:
// We are asked to show only a specific category
$listing_sql = "select " . $select_column_list . " p.products_id,

ADD:
pd.products_url,

you will need to do this in 4 places in that file

then in /includes/modules/YOUR_TEMPLATE/product_listing.php

Find:
$lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';

ADD after it:

if (zen_not_null($listing->fields['products_url'])) {
$lc_text .= zen_image(DIR_WS_IMAGES . 'dm.gif', 'ADD_IMAGE_ALT_HERE', 'ADD_IMAGE_WIDTH_HERE','ADD_IMAGE_HEIGHT_HERE', 'class="imageOverlay"');
}

but before:
}
}
break;

23 Apr 2012, 10:13 PM
#6
post_carlos avatar

post_carlos

New Zenner

Join Date:
Dec 2011
Posts:
15
Plugin Contributions:
0

Re: On 'product list page' I need an extra icon to appear when the product has an url.

Dear rbarbour,

Thank you so much for helping me out!!

23 Apr 2012, 10:16 PM
#7
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: On 'product list page' I need an extra icon to appear when the product has an url.

np, glad I could help!