Aide - Recherche - Membres - Calendrier
Version complète : [RESOLU]Nouveaux produits pour le mois de....
Forum osCommerce-fr > Oscommerce 2.3 > Design OsC2.3
francois21
Bonjour
Tout est dans le titre.
Sur la page acceuil il y a "les nouveaux produits pour le mois de..."
Cela correspond au module includes==>modules==>new_products.php

Si les articles sont hors promo, les prix sont afficher hors promo==>normal
Si les articles sont en promo, c'est le prix promo qui s'affiche sans aucune distinction.
Comment peut on afficher les prix promo comme dans l'ensemble du site c'est a dire le prix normal barré et le prix promo en rouge en dessous.

J'ai essayé de mettre une condition, mais a chaque fois, je n'ai plus de prix ou tout les prix sont a zero ou tous identiques.

Si un specialiste du php passe par la pour m'aiguiller sur la bonne condition.

Merci
Francois
francois21
Bonsoir
si ça interesse quelqu'un je me reponds

vers ligne 73
remplacer
$new_products[$x][products_price'] = $new_s_prices[$i]['specials_new_products_price'];
par
$new_products[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price'];

vers ligne 97 apres

if ($col === 0) {
$new_prods_content .= '<tr>';
}

mettre

if (tep_not_null($new_products[$counter]['specials_new_products_price'])){
$price_new_price = '<del>' .$currencies->display_price($new_products[$counter]['products_price'], tep_get_tax_rate($new_products[$counter]['products_tax_class_id'])) . '</del>/<span class="productSpecialPrice">' . $currencies->display_price($new_products[$counter]['specials_new_products_price'], tep_get_tax_rate($new_products[$counter]['products_tax_class_id'])) . '</span>';
}else{$price_new_price = $currencies->display_price($new_products[$counter]['products_price'], tep_get_tax_rate($new_products[$counter]['products_tax_class_id']));}

et remplacer

$new_prods_content .= '<td width="33%" align="center" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products[$counter]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products[$counter]['products_image'], $new_products[$counter]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products[$counter]['products_id']) . '">' . $new_products[$counter]['products_name'] . '</a><br />' . $currencies->display_price($new_products[$counter]['products_price'], tep_get_tax_rate($new_products[$counter]['products_tax_class_id'])). '</td>';

Par

$new_prods_content .= '<td width="33%" align="center" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products[$counter]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products[$counter]['products_image'], $new_products[$counter]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products[$counter]['products_id']) . '">' . $new_products[$counter]['products_name'] . '</a><br />' . $price_new_price . '</td>';

Je ne sais pas si tout est correct mais ça marche

Attention, cette modif est valable pour le fichier modifié avec SPPC. Je posterai la modif pour le fichier de base.

Francois
mihelicjm
Une solution peut-être...

Dans includes/modules/new_products.php, après:

CODE
$new_products['products_name'] = tep_get_products_name($new_products['products_id']);


ajouter:

CODE

$random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);
if (tep_not_null($random_product['specials_new_products_price'])) {
$new_products_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s>&nbsp;';
$new_products_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
} else {
$new_products_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
}


et pour afficher les deux prix (normal et remisé) remplacer la ligne de l'affichage concerné:

CODE
<td height="40" valign="bottom" align="right" style="padding-bottom:5px;" ><span style="color:#b80101; font-size:20px; "> ' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])).'</span></td>


par exemple par:

CODE
<td valign=bottom align="left" height="45"><span style="color:#000000; font-size:16px;">'. $new_products_price.'</td>









Ceci est une version "bas débit" de notre forum. Pour voir la version complète avec plus d'informations, la mise en page et les images, veuillez cliquer ici.
Invision Power Board © 2001-2013 Invision Power Services, Inc.