Probleme d'affichage avec flash selling 2.9

badibade
Invité n'ayant pas de compte PHPfrance

21 févr. 2008, 17:11

Bonjour

j'ai un gros pepin avec flash selling 2.9 dans ma page d'accueil j'ai d'abitute dans chaque boxe au moin 3 produit mais depuis que je l'ai installer je n'est qu'un produit qui apparait dans ma boxe

comment fair pour le modifier

De plus le compteur qui aparait m'affiche n'inposte quelle temp et il ne deconpte pas


Code : Tout sélectionner

<?php /* $Id: specials.php,v 1.31 2003/06/09 22:21:03 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() > s.flash_selling_beginning_date and now() < s.flash_selling_end_date order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) { //::::::::::::::::::::::::::: Modif by Fenris : ajout délai restant avant fin vente flash EOF ::::::::::::::::::::::::: // Flash discount end Date $special_flash_selling_end_date = tep_get_products_special_flash_selling_end_date($random_product['products_id']); $jend_days_box = (int)substr($special_flash_selling_end_date,8,2); // le jour $jend_month_box = (int)substr($special_flash_selling_end_date,5,2); // puis le mois $jend_year_box = (int)substr($special_flash_selling_end_date,0,4); // et l\'annee $jend_hour_box = (int)substr($special_flash_selling_end_date,11,2); // et l\'heure $jend_minute_box = (int)substr($special_flash_selling_end_date,14,2); // et la minute $jend_second_box = (int)substr($special_flash_selling_end_date,17,2); // et la seconde ?> <!-- flash_selling //--> <script type="text/javascript"> function decompteur(jour,mois,annee,heure,minute,seconde) { Resultat = ""; now = new Date(); goal = new Date(annee,mois-1,jour,heure,minute,seconde); ts = Math.abs((now.getTime()/1000)-(goal.getTime()/1000)); if((goal.getTime()/1000) < (now.getTime()/1000)){ location.reload(); } fjour = Math.floor(ts/(3600*24)); if(fjour<=1) { Resultat = fjour + " jour "; } else { Resultat = fjour + " jours "; } ts = ts - (fjour*24*3600); fheure = Math.floor((ts/3600)); if(fheure<10) { Resultat += " 0" + fheure + "h "; } else { Resultat += " " + fheure + "h "; } ts = ts - (fheure*3600); minutes = Math.floor((ts/60)); if(minutes<10) { Resultat += "0" + minutes + "m "; } else { Resultat += minutes + "m "; } ts = ts - (minutes*60); fseconde = Math.floor(ts); if(fseconde<10) { Resultat += "0" + fseconde + "s" } else { Resultat += fseconde + "s" } return Resultat } function startXbox() { document.getElementById("ctpbox").innerHTML=decompteur(<?php echo $jend_days_box.','.$jend_month_box.','.$jend_year_box.','.$jend_hour_box.','.$jend_minute_box.','.$jend_second_box; ?>); setTimeout("startXbox()",1000); } window.onload = startXbox; </script> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B'))); new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_FLASH_SELLING)); $new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIAL_PRODUCTS); $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => BOX_FLASH_SELLING . '<br>' . $jend_days_box .'&nbsp;Jours'. ' ' . $jend_hour_box.'&nbsp;H'. ' ' . $jend_minute_box . '&nbsp;Min&nbsp;'. $jend_second_box .'&nbsp;Sec'. '<br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br><s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_price_flash_selling'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'); //::::::::::::::::::::::::::: Modif by Fenris : ajout délai restant avant fin vente flash EOF ::::::::::::::::::::::::: new infoBox($info_box_contents, infoBoxContentsShoppingCartBoxe, infoBoxShoppingCartBoxe); ?> </td> </tr> <!-- specials_eof //--> <?php } ?>



Merci de votre aide

badibade
Invité n'ayant pas de compte PHPfrance

22 févr. 2008, 00:08

bon je suis pris autrement mais l'ennuis meintement c'est que j'ai un probleme de double boucle je ne sais pas comment l'ecrir car un fois c'est la premier qui marche et une fois la deuxième

voici la premier boucleme

Code : Tout sélectionner

$info_box_contents = array(); $row = 0; $col = 0; while ($default_specials = tep_db_fetch_array($new)) { $default_specials['products_name'] = tep_get_products_name($default_specials['products_id']); $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_image(DIR_WS_IMAGES.'Horloge.gif') . '&nbsp;'.tep_get_products_flash_timer($specials['products_id']) .'"><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . $default_specials['products_name'] . '</a><br><s>' . $currencies->display_price($default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span>'); $col ++; if ($col > 2) { $col = 0; $row ++; } }

voici la deuxième

Code : Tout sélectionner

$row = 0; $specials_query = tep_db_query($specials_split->sql_query); while ($specials = tep_db_fetch_array($specials_query)) { $row++; $default_specials['products_name'] = tep_get_products_name($default_specials['products_id']); $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_image(DIR_WS_IMAGES.'Horloge.gif') . '&nbsp;'.tep_get_products_flash_timer($specials['products_id']) .'"><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . $default_specials['products_name'] . '</a><br><s>' . $currencies->display_price($default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span>'); if ((($row / 3) == floor($row / 3))) {

et j'ai essayer de les fussionner en fesant ceci

Code : Tout sélectionner

info_box_contents = array(); $row = 0; $specials_query = tep_db_query($specials_split->sql_query); $col = 0; while ($default_specials = tep_db_fetch_array($new)($specials = tep_db_fetch_array($specials_query) { $default_specials['products_name'] = tep_get_products_name($default_specials['products_id']); $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_image(DIR_WS_IMAGES.'Horloge.gif') . '&nbsp;'.tep_get_products_flash_timer($specials['products_id']) .'"><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . $default_specials['products_name'] . '</a><br><s>' . $currencies->display_price($default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span>'); $col ++; if ($col > 2) { $col = 0; $row ++; } } if ((($row / 3) == floor($row / 3))) {
mais ca marche pas je sais pas comment fussionner les deux boucle merci de votre aide

badibade
Invité n'ayant pas de compte PHPfrance

22 févr. 2008, 17:09

re onjour donc j'ai progresser un peu je mis suis pris encore entrement mais j'ai toujour un petit probleme de compte à rebours

je doit inserer c'est ligne la

Code : Tout sélectionner

$special_flash_selling_end_date = tep_get_products_special_flash_selling_end_date($product_info['products_id']); if (($special_flash_selling_end_date != '') && ($special_flash_selling_end_date != '0000-00-00 00:00:00')) { echo '<span class="inputRequirement">' . BOX_FLASH_SELLING ; echo tep_date_long($special_flash_selling_end_date) . ' </span>';
dans ce mon code alors je mi suis pris comme ca

Code : Tout sélectionner

$info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => BOX_FLASH_SELLING . '<br>' . tep_image(DIR_WS_IMAGES.'Horloge.gif') . '&nbsp;'. $special_flash_selling_end_date = tep_get_products_special_flash_selling_end_date($product_info['products_id']) .tep_date_long($special_flash_selling_end_date) .'<br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . $default_specials['products_name'] . '</a><br><s>' . $currencies->display_price($default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span>');
mais voilla au lieu d'avoir fin de vente dans 3j 5h 6mm 5s j'ai fin de vente dans jeudi 01 janvier, 1970


Bizzard je ne comprend pas merci de bien voulloir m'aider c'est urgent.

badibade
Invité n'ayant pas de compte PHPfrance

27 févr. 2008, 16:27

bon j'y est passer, je ne sais pas combien de nuit blanche et j'ai beau tourner le probleme dans tout les sens je ni arrive pas. J'en appel à une bonne ame génereuse pour m'aider car je sais plus quoi fair.

merci