DigitalShadow:
One question in product_listing.php I would like to put an if statement, this is my current code and it works fine. However, I only want it to display the Part Also Found In text if the table also_found_in_1 is populated.
case 'PRODUCT_LIST_NAME':
$lc_align = '';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
} else {
$lc_text = '<h2 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h2>
<h3 class="itemTitleES">EasySearch ID: <a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '"><strong>ES' . $listing->fields['products_id'] . '<
[B]/[/B]strong></a></h3>
[B]';[/B]
[B]if (zen_not_null($listing->fields['also_found_in_1'])) {[/B]
[B]$lc_text .= '[/B]<h3 class="itemTitleAFI">Part Also Found In: ' . $listing->fields['also_found_in_1'] . ' ' . $listing->fields['also_found_in_2'] . ' ' . $listing->fields['also_found_in_3'] . ' ' . $listing->fields['also_found_in_4'] . ' ' . $listing->fields['also_found_in_5'] . ' ' . $listing->fields['also_found_in_6'] . ' ' . $listing->fields['also_found_in_7'] . ' ' . $listing->fields['also_found_in_8'] . ' ' . $listing->fields['also_found_in_9'] . ' ' . $listing->fields['also_found_in_10'] . ' ' . $listing->fields['also_found_in_11'] . ' ' . $listing->fields['also_found_in_12'] . ' ' . $listing->fields['also_found_in_13'] . ' ' . $listing->fields['also_found_in_14'] . ' ' . $listing->fields['also_found_in_15'] . ' ' . $listing->fields['also_found_in_16'] . ' ' . $listing->fields['also_found_in_17'] . ' ' . $listing->fields['also_found_in_18'] . ' ' . $listing->fields['also_found_in_19'] . ' ' . $listing->fields['also_found_in_20'] . ' ' . $listing->fields['also_found_in_21'] . ' </h3>[B]';[/B]
[B]}[/B]
[B]$lc_text .= '[/B]<div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
}
break;
>
>
> Elsewhere on the website I have used this code
>
> ```
<?php if (empty($also_found_in_1)) { echo ''; } else { echo 'Please note that this part has also been fitted to these alternative TV models:<div id="also_found">'; } ?>
How could I modify that so it works on the search results page.
try above code in red, the products listing page and the search result page should pick up the if statement.