Je précise d'abord que mon site est une banque d'images !
Dans la page products_listing.php:
Je voudrais faire apparaître sur mes images, "alt" ou "title", une info tel que le titre de l'image par ex: Village de Bellevue-sur-l'Idéal, (products_name étant la référence).
Pour cela j'ai tenté d'utiliser la table products_url (qui ne me sert à rien) et je l'ai renseignée avec mon info.
J'ai ensuite modifié mon code dans products_listing comme suit:
Code
case 'PRODUCT_LIST_IMAGE':
$lc_align = 'center';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . (int)$_GET['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_url'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
} else {
$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_url'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';
}
break;
$lc_align = 'center';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . (int)$_GET['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_url'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
} else {
$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_url'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';
}
break;
J'ai donc remplacé : $listing[$x]['products_name'] par $listing[$x]['products_url']
Résultat néant !
J'ai tenté la même expérience sur products_info.php en changeant
Code
addslashes($product_info['products_name'])
par :
Code
addslashes($product_info['products_url'])
Et ça fonctionne !
Ma question: pourquoi cela ne fonctionne pas sur products_listing ?
Merci