osCommerce France : Accueil Forum Portail osCommerce France Réponses aux questions Foire aux contributions

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> [Résolu] Box Nouveautés sous forme de Box meilleure ventes, mise en forme Box Nouveautés sous forme de Box meilleure ventes
repare31
posté 18 Jul 2010, 08:46
Message #1


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



Bonjour,

Comment faire pour avoir le même afichage du box nouveautés en box meilleure ventes

soit tous les derniers produits ajoutées sous forme de liste, car l'affichage actue est d'un produit.

j'ai cherché sur différents site et je ne trouve pas mon bonheur, j'ai tenté ce qu'on m'a dit et ça ne marche toujours pas !

toute piste est la bienvenue..

pour celles et ceux qui ne comprènent pas ce que je cherche à faire voilà une image :



je suis sur rc2

à bientôt..

Ce message a été modifié par repare31 - 4 Sep 2010, 09:50.
Raison de l'édition : message déplacé dans le forum à propos
Go to the top of the page
 
repare31
posté 31 Aug 2010, 12:12
Message #2


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



Bonjour,

c'est un sujet lu mais reste sans réponse..

avec un ami qui part prochainement on réussit à faire partiellement la manip..

mais marche que d'un côté, que dans column_left.php

dans column_right.php elle affiche le code suivant :

Citation
1064 - Erreur de syntaxe près de 'SELECT p.products_id, p.products_image, p.products_tax_class_id, IF (s.status, s' à la ligne 1

select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, p.products_price from products p, products_description pd, specials s where products_status = '1' and pd.products_id=p.products_id and pd.language_id = '1' SELECT p.products_id, p.products_image, p.products_tax_class_id, IF (s.status, s.specials_new_products_price, NULL) AS specials_new_products_price, p.products_price, pd.products_name FROM products p LEFT JOIN specials s ON p.products_id = s.products_id LEFT JOIN products_description pd ON p.products_id = pd.products_id AND pd.language_id = '1' LEFT JOIN featured f ON p.products_id = f.products_id WHERE p.products_status = '1' AND f.status = '1' order by rand(28449) DESC limit 6 order by products_date_added desc limit 10


une idée ??


--------------------
Installé mais ça se complique !!
oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5 - More_Category_Boxes_1
Go to the top of the page
 
FoxP2
posté 31 Aug 2010, 12:48
Message #3


Ceinture marron OSC
Icône de groupe

Groupe : Modérateurs
Messages : 1458
Inscrit : 3-June 09
Membre no 25501



oui, met le code modifié complet de ta boxe nouveautés (sans nul doute whats_new.php) et son appel dans le fichier column_right car personne ici n'a d'extension 'boule de cristal' à son navigateur.


--------------------


Go to the top of the page
 
repare31
posté 31 Aug 2010, 13:12
Message #4


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



Bonjour,

je suis justement entrain de faire ça..

Citation
<!-- Whats_new //-->
<tr>
<td>
<?php
if ($new_product = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, ". TABLE_SPECIALS ." s where products_status = '1' and pd.products_id=p.products_id and pd.language_id = '" . (int)$languages_id . "' ".$query." order by products_date_added desc limit " . MAX_DISPLAY_WHATS_NEW)) {

$info_box_contents = array();
$info_box_contents[] = array('text' => '<a href="products_new.php" class="coul2">'.BOX_HEADING_WHATS_NEW.'</a>');

new infoBoxHeading($info_box_contents, false, false);

$rows = 0;
$newProd_list = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
while ($new_prod = tep_db_fetch_array($new_product)) {

$rows++;

$newProd_list .= '
<tr>
<td class="infoBoxContents">
<div class="padd-line">
<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_prod['products_id']) . '">'.$new_prod['products_name'].'</a>
</div>
</td>
</tr>
<tr><td>
<div><img height="0" width="100%" border="0" alt="" src="images/pixel_trans.gif"/></div>
</td></tr>';
}
$newProd_list .= '</table>';
$newProd_list .= '<br /><div><a href="products_new.php"><u>'.ALL_BOX_HEADING_WHATS_NEW.'</u></a></div>';

$info_box_contents = array();
$info_box_contents[] = array('text' => $newProd_list);

new infoBox($info_box_contents);
?>
</td>
</tr>
<!-- Whats_new_eof //-->
<?php
}
?>


ça marche donc dans column_left.php mais pas column_right.php

j'ai un site de test sous free, j'envoi par MP..

merci d'avance..

Ce message a été modifié par repare31 - 31 Aug 2010, 13:15.


--------------------
Installé mais ça se complique !!
oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5 - More_Category_Boxes_1
Go to the top of the page
 
FoxP2
posté 31 Aug 2010, 13:29
Message #5


Ceinture marron OSC
Icône de groupe

Groupe : Modérateurs
Messages : 1458
Inscrit : 3-June 09
Membre no 25501



ton code est à ...
-> aucun respect de la nomenclature d'oscommerce. faut pas s'étonner qu'après ça part en sucette ...
bon sinon, c'est quoi cette variable ?
Citation
if ($new_product = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, ". TABLE_SPECIALS ." s where products_status = '1' and pd.products_id=p.products_id and pd.language_id = '" . (int)$languages_id . "' ".$query." order by products_date_added desc limit " . MAX_DISPLAY_WHATS_NEW))


--------------------


Go to the top of the page
 
repare31
posté 31 Aug 2010, 13:47
Message #6


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



Bonjour,

si à chaque fois que tu m'aide tu me vanne.. ça me va quand même happy.gif

je ne suis pas un pro du code je fais ce que je peux..

sinon on c'est inspiré de best seller..

je t'envoi par MP ce que ça donne même si c'est pas fini et que c'est sur free

et même si je vais me prendre une vanne.. wub.gif

on peut être fait n'importe quoi et que ça marche presque..

euh pour la variable je ne sais pas !



--------------------
Installé mais ça se complique !!
oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5 - More_Category_Boxes_1
Go to the top of the page
 
FoxP2
posté 31 Aug 2010, 15:16
Message #7


Ceinture marron OSC
Icône de groupe

Groupe : Modérateurs
Messages : 1458
Inscrit : 3-June 09
Membre no 25501



je vois, tu essayes d'adapter une boutique prestashop vers oscommerce ... (en général, les choses vont dans l'autre sens ...)
partir sur la boxe best_sellers comme point d'appui était une bonne solution, mais pourquoi la défoncer autant après ? huh.gif
il suffit de :
Code
<?php
/*
  $Id: products_new.php 1739 2007-12-20 00:52:16Z hpdl $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  $new_product_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit 10");

  if (tep_db_num_rows($new_product_query) >= 10) {
?>
<!-- new_products //-->
          <tr>
            <td>
<?php
    $info_box_contents = array();
    $info_box_contents[] = array('text' => BOX_HEADING_WHATS_NEW);

    new infoBoxHeading($info_box_contents, false, false);

    $rows = 0;
    $newsproducts_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
    while ($new_products = tep_db_fetch_array($new_product_query)) {
      $rows++;
      $newsproducts_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a></td></tr>';
    }
    $newsproducts_list .= '</table>';
    
    $info_box_contents = array();
    $info_box_contents[] = array('text' => $newsproducts_list);
    $info_box_contents[] = array('text' => '<tr><td class="infoBoxContents" align="center" valign="top"><b><u><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . ALL_BOX_HEADING_WHATS_NEW . '</a></u></b></td></tr>');
    new infoBox($info_box_contents);
?>
            </td>
          </tr>
<!-- new_products_eof //-->
<?php
  }
?>


quelques points importants :
les liens du style :
Code
$newProd_list .= '<br /><div><a href="products_new.php"><u>'.ALL_BOX_HEADING_WHATS_NEW.'</u></a></div>';

c'est niet avec oscommerce ! il te faut passer ceux ci avec la fonction tep_href_link.
ta requête : attention aux alias des tables, inutile d'appeler des tables ou des colonnes si tu ne t'en sers pas ensuite.
Citation
f ($new_product = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, ". TABLE_SPECIALS ." s where products_status = '1' and pd.products_id=p.products_id and pd.language_id = '" . (int)$languages_id . "' ".$query." order by products_date_added desc limit " . MAX_DISPLAY_WHATS_NEW)) {

évites les horreurs de <DIV> partout où tu ne sais pas ajouter une ligne ou une cellule dans un tableau. revois les bases du HTML car c'est le minimum syndicale demandé ici avant toute modification du script oscommerce.


--------------------


Go to the top of the page
 
repare31
posté 31 Aug 2010, 15:45
Message #8


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



Bonjour,

j'aime bien les deux mais osc est plus rapide que presta !!

biggrin.gif tu m'a fait rire oui on a exploser le bordel..

sinon j'ai viré les classes dans les div c'est pour ça que c'est pas top et je te l'accord bien moche !!

je test ça et te donne suite..

merci encore..



--------------------
Installé mais ça se complique !!
oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5 - More_Category_Boxes_1
Go to the top of the page
 
repare31
posté 31 Aug 2010, 23:21
Message #9


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



Bonjour,

super un grand merci ça marche au poil..

j'ai une autre question, je n'arrive pas à faire afficher les bons prix, ça affiche $0.00

a ton code j'ai ajouter :

Citation
if (tep_not_null($random_product['specials_new_products_price'])) {
$whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';
$whats_new_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 {
$whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
}


et :

Citation
$whats_new_price


comme ça :

Citation
<?php
/*
$Id: products_new.php 1739 2007-12-20 00:52:16Z hpdl $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2003 osCommerce

Released under the GNU General Public License
*/

$new_product_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit 10");

if (tep_db_num_rows($new_product_query) >= 10) {
?>
<!-- new_products //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_WHATS_NEW);

new infoBoxHeading($info_box_contents, false, false);

if (tep_not_null($random_product['specials_new_products_price'])) {
$whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';
$whats_new_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 {
$whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
}



$rows = 0;
$newsproducts_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
while ($new_products = tep_db_fetch_array($new_product_query)) {
$rows++;
$newsproducts_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a>'.$whats_new_price.'</td></tr>';
}
$newsproducts_list .= '</table>';

$info_box_contents = array();
$info_box_contents[] = array('text' => $newsproducts_list);
$info_box_contents[] = array('text' => '<tr><td class="infoBoxContents" align="center" valign="top"><b><u><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . ALL_BOX_HEADING_WHATS_NEW . '</a></u></b></td></tr>');
new infoBox($info_box_contents);
?>
</td>
</tr>
<!-- new_products_eof //-->
<?php
}
?>


Merci d'avance

Ce message a été modifié par repare31 - 31 Aug 2010, 23:26.


--------------------
Installé mais ça se complique !!
oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5 - More_Category_Boxes_1
Go to the top of the page
 
FoxP2
posté 1 Sep 2010, 10:21
Message #10


Ceinture marron OSC
Icône de groupe

Groupe : Modérateurs
Messages : 1458
Inscrit : 3-June 09
Membre no 25501



il te faut modifier la requête avec les tables et les colonnes nécessaires et appeler le bon tableau de résultat.(en l’occurrence : $new_products).


--------------------


Go to the top of the page
 
repare31
posté 1 Sep 2010, 11:01
Message #11


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



Bonjour,

Merci encore..

alors soit je suis une bille ( j'en doute plus ) soit je cherche au mauvais coin depuis hier..

ce que j'arrive à obtenir c'est un prix à $0.00

je continue à chercher..


--------------------
Installé mais ça se complique !!
oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5 - More_Category_Boxes_1
Go to the top of the page
 
repare31
posté 1 Sep 2010, 19:45
Message #12


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



HI,

en faisant ça j'ai bien le prix mais sous forme $123.0000 ou $123.1200 au lieu de $123 ou $123.12

il me manque quoi svp ?

Citation
<?php
/*
$Id: products_new.php 1739 2007-12-20 00:52:16Z hpdl $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2003 osCommerce

Released under the GNU General Public License
*/

$new_product_query = tep_db_query("select distinct p.products_id, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit 10");

if (tep_db_num_rows($new_product_query) >= 10) {
?>
<!-- new_products //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_WHATS_NEW);

new infoBoxHeading($info_box_contents, false, false);

$rows = 0;
$newsproducts_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
while ($new_products = tep_db_fetch_array($new_product_query)) {
$rows++;
$newsproducts_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a>'.$new_products['products_price'].'</td></tr>';
}
$newsproducts_list .= '</table>';

$info_box_contents = array();
$info_box_contents[] = array('text' => $newsproducts_list);
$info_box_contents[] = array('text' => '<tr><td class="infoBoxContents" align="center" valign="top"><b><u><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . ALL_BOX_HEADING_WHATS_NEW . '</a></u></b></td></tr>');
new infoBox($info_box_contents);
?>
</td>
</tr>
<!-- new_products_eof //-->
<?php
}
?>


Merci d'avance..


--------------------
Installé mais ça se complique !!
oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5 - More_Category_Boxes_1
Go to the top of the page
 
repare31
posté 2 Sep 2010, 19:08
Message #13


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



Bonjour,

beaucoup abondonne osc pour presta..

moi c'est le contraire j'ai 2 presta eu souhaite passer à une osc..

mais j'ai besoin d'aide pour finir cette boutique..

je demande donc votre aide svp..

Merci d'avance..



--------------------
Installé mais ça se complique !!
oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5 - More_Category_Boxes_1
Go to the top of the page
 
Bonbec
posté 2 Sep 2010, 19:53
Message #14


Ceinture verte OSC
Icône de groupe

Groupe : Membres
Messages : 710
Inscrit : 30-May 06
Lieu : Vichy (03)
Membre no 10583



Bonjour,

Si j'ai bien compris ce code est inspiré par new_poducts.php c'est çà ?
Si oui, il suffit de regarder dans le fichier en question comment est appelé l'affichage du prix et çà donne çà :
$currencies->display_price($new_products['products_price']


--------------------
Config : Osc 2.2 très fortement modifié ... entièrement refait en mai 2012 (passage en UTF-8 et Php 5.3). Le passage à la 2.3 demanderait trop de travail mais je la teste en local ...
Contribs installées : down_for_maintenance_v 2.3 | Estimated Shipping v1.5 | imprint_1_3_5 | low_stock_report_v2.04 | visible_countries_1.2b | Products Tabs | shoppingCart_cleanup_v1.01.0 | + bidouilles persos pas très OsCommerce (erreurs de jeunesse)
En local j'utilise UwAmp, que du bonheur ...
Go to the top of the page
 
repare31
posté 3 Sep 2010, 08:52
Message #15


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



Bonjour,

merci je test..

non ça me fait une erreur quand je remplace :
Code
$new_products['products_price']

par
Code
$currencies->display_price($new_products['products_price']

l'erreur :
Citation
Parse error: syntax error, unexpected ';' in ..\www\shop\includes\boxes\whats_new.php on line 37


merci quand même...

et j'ai oublié les prix donnés ne prenenet pas en compte les prix promo

Ce message a été modifié par repare31 - 3 Sep 2010, 08:55.


--------------------
Installé mais ça se complique !!
oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5 - More_Category_Boxes_1
Go to the top of the page
 
Bonbec
posté 3 Sep 2010, 13:41
Message #16


Ceinture verte OSC
Icône de groupe

Groupe : Membres
Messages : 710
Inscrit : 30-May 06
Lieu : Vichy (03)
Membre no 10583



Re,

L'erreur est logique, mon code $currencies->display_price($new_products['products_price'] est incomplet puisqu'il a une parenthèse ouvrante et pas de parenthèse fermante. La parenthèse fermante se trouve après la seconde composante de $currencies->display_price.
C'est une piste que j'ai donné, pas un copier/coller à faire sans compréhension.

En regardant les fichiers qui permettent d'afficher les prix, il est facile de voir la syntaxe exacte.
Je crois que le mieux est de regarder dans products_info.php comment s'affiche le prix (justement avec le fameux $currencies->display_price) et en plus quelques lignes au dessus il y a le code nécessaire pour tenir compte des prix spéciaux.


--------------------
Config : Osc 2.2 très fortement modifié ... entièrement refait en mai 2012 (passage en UTF-8 et Php 5.3). Le passage à la 2.3 demanderait trop de travail mais je la teste en local ...
Contribs installées : down_for_maintenance_v 2.3 | Estimated Shipping v1.5 | imprint_1_3_5 | low_stock_report_v2.04 | visible_countries_1.2b | Products Tabs | shoppingCart_cleanup_v1.01.0 | + bidouilles persos pas très OsCommerce (erreurs de jeunesse)
En local j'utilise UwAmp, que du bonheur ...
Go to the top of the page
 
repare31
posté 3 Sep 2010, 14:36
Message #17


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



Bonjour,

Merci encore..
mais je ne suis pas fanne du copier coller non plus..
ma ptite shop a plus de 20 modules dans le ventre..
et c'est pas du copier coller..

j'avoue néanmoins que je ne suis pas un as du code..

j'ai appri en tatonant..

sinon il me semble avoir déjà regarder du côté de products_info.php..

j'ai du passer à côté de qqchose.. je vais regarder ça..

merci pour coup de pouce.. et merci d'avance de toute aide..


--------------------
Installé mais ça se complique !!
oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5 - More_Category_Boxes_1
Go to the top of the page
 
Bonbec
posté 3 Sep 2010, 19:49
Message #18


Ceinture verte OSC
Icône de groupe

Groupe : Membres
Messages : 710
Inscrit : 30-May 06
Lieu : Vichy (03)
Membre no 10583



Re,

Alors çà donne quoi ?

Je viens de tester le remplacement de $new_products['products_price'] par $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) et çà fonctionne nickel pour le formatage du prix.

Donc cette ligne :
Code
$newsproducts_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a> '.$new_products['products_price'].'</td></tr>';

est à remplacer par :
Code
$newsproducts_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a> '.
$currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])).'</td></tr>';


Mais pour tenir compte d'un prix spécial comme une promo, j'ai indiqué qu'il fallait regarder dans products_info.php où il y a le code nécessaire, il suffit de l'adapter en changeant les variables qui vont bien.
Donc, le code donné ci-dessus :
Code
$newsproducts_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a> '.
$currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])).'</td></tr>';

se remplace par :
Code
  if ($new_price = tep_get_products_special_price($new_products['products_id'])) {
      $products_price = '<s>'.$currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '</s> ' . $currencies->display_price($new_price, tep_get_tax_rate($new_products['products_tax_class_id']));
    } else {
      $products_price = $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id']));
    }

$newsproducts_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a> '.$products_price.'</td></tr>';


Voili voilou, çà doit fonctionner wink.gif


--------------------
Config : Osc 2.2 très fortement modifié ... entièrement refait en mai 2012 (passage en UTF-8 et Php 5.3). Le passage à la 2.3 demanderait trop de travail mais je la teste en local ...
Contribs installées : down_for_maintenance_v 2.3 | Estimated Shipping v1.5 | imprint_1_3_5 | low_stock_report_v2.04 | visible_countries_1.2b | Products Tabs | shoppingCart_cleanup_v1.01.0 | + bidouilles persos pas très OsCommerce (erreurs de jeunesse)
En local j'utilise UwAmp, que du bonheur ...
Go to the top of the page
 
repare31
posté 4 Sep 2010, 09:48
Message #19


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



Bonjour,

UN BIG GRAND MERCI BONBEC !!!

j'ai ajouter pour la cart :

Code


<tr><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></td></tr>


UN GRAND GRAND MERCI à FoxP2 et Bonbec !!

Ce message a été modifié par repare31 - 4 Sep 2010, 09:51.


--------------------
Installé mais ça se complique !!
oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5 - More_Category_Boxes_1
Go to the top of the page
 
repare31
posté 4 Sep 2010, 10:02
Message #20


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



Bonjour,

une tite dernière pour la route..

j'ai cherché mas ça me donne rien..

comment remplacer du text pas [...] quand ce dernier est trop long ?

merci d'avance..


--------------------
Installé mais ça se complique !!
oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5 - More_Category_Boxes_1
Go to the top of the page
 
Bonbec
posté 4 Sep 2010, 12:51
Message #21


Ceinture verte OSC
Icône de groupe

Groupe : Membres
Messages : 710
Inscrit : 30-May 06
Lieu : Vichy (03)
Membre no 10583



Re,


Un p'tit truc du style :

A la place de çà :
Code
$newsproducts_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a> '.$products_price.'</td></tr>';

mettre çà :
Code
$mylimit = 50;    // le max de caractères que je veux
$newsproducts_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . substr_replace($new_products['products_name'], '[...]', $mylimit) . '</a> '.$products_price.'</td></tr>';


Mais le fin du fin serait de se créer une p'tite fonction à mettre dans html_output.php par exemple et qui serait appelée dans les pages qui en auraient besoin, un truc du style :
Code
function tep_get_short_text($text, $mylimit){
return substr_replace($text, '[...]', $mylimit);
}

Et du coup on peut appeler cette fonction dans n'importe quelle page d'OsCommerce où on en aurait besoin.
Pour le cas présent, le code serait :

Code
// j'ai fixé à 50 le max de caractères que je veux mais çà peut se changer
$newsproducts_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_get_short_text($new_products['products_name'], 50)  . '</a> '.$products_price.'</td></tr>';


--------------------
Config : Osc 2.2 très fortement modifié ... entièrement refait en mai 2012 (passage en UTF-8 et Php 5.3). Le passage à la 2.3 demanderait trop de travail mais je la teste en local ...
Contribs installées : down_for_maintenance_v 2.3 | Estimated Shipping v1.5 | imprint_1_3_5 | low_stock_report_v2.04 | visible_countries_1.2b | Products Tabs | shoppingCart_cleanup_v1.01.0 | + bidouilles persos pas très OsCommerce (erreurs de jeunesse)
En local j'utilise UwAmp, que du bonheur ...
Go to the top of the page
 
repare31
posté 4 Sep 2010, 13:56
Message #22


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 147
Inscrit : 18-July 10
Membre no 27814



Bonjour,

Merci une fois de plus..

oui c'est plus pratique en fonction..

ça me fait pneser que c'est plus pratique de faire une fonction pour afficher NC à la place de 0.00

car en cement je suis entrain de faire des codes moches du style :

Code
if(($price_null == '$0.00' )||($price_null == '0.00$' )||($price_null == '£0.00' )||($price_null == '0.00£' )||($price_null == '0.00€' )||($price_null == '€0.00' )){
      $price_null = "[ <a href='contact_us.php' class='center'><b>N C</b></a> ]";
    }


ou pire :

Code
<?php if ($product_info['products_price'] > 0 ) { ?><?php echo $products_price; ?><?php } ?><?php if ($product_info['products_price'] == 0 ) { ?><?php echo '[ <a href="contact_us.php"><b>N C</b></a> ]'; ?><?php } ?>


je ne suis pas un géni du code, je pense que ça c'est vu..


--------------------
Installé mais ça se complique !!
oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5 - More_Category_Boxes_1
Go to the top of the page
 

Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :

 



RSS Version bas débit Nous sommes le : 25th May 2013 - 08:09
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)