for ($w = 0; $w < count($_SESSION['panier']['id_article']); $w++) { $css_class = $i % 2 == 0 ? 'clair' : 'sombre'; echo '<tr class="' . $css_class . '">'; echo "<td><img class='img_articlePanier' src='" . $_SESSION['panier']['photo'][$w] . "' alt='" . $_SESSION['panier']['titre'][$w] . "' title='" . $_SESSION['panier']['titre'][$w] . "' ></td>"; echo "<td>" . $_SESSION['panier']['titre'][$w] . "</td>"; echo "<td>" . $_SESSION['panier']['quantite'][$w] . "</td>"; if ($_SESSION['panier']['id_promo'][$w] > 1) { echo "<td>" . virgule($_SESSION['panier']['prix'][$w] - $_SESSION['panier']['prix'][$w] * ($_SESSION['panier']['reduction'][$w] / 100)) . " €</td>"; } else { echo "<td>" . $_SESSION['panier']['prix'][$w] . " €</td>"; } echo "<td><a href='?action=retirer&id_article=" . $_SESSION['panier']['id_article'][$w] . "'><img src='" . RACINE_SITE . "photo/suppr.png' alt='' title='Supprimer cet article'></a></td>"; echo "</tr>"; $i++; } echo "<tr class='border_stop'><td colspan='3'></td><th colspan='1' class='border_prix'>Sous total:</th><td colspan='1'>" . montantSousTotal() . " €</td></tr>"; } echo "</table>"; if (utilisateurEstConnecte()) { if (!empty($_SESSION['panier']['id_article'])) { echo "<div><a id='return_btn' href='" . RACINE_SITE . "panier_adresse.php'>Passer à l'étape suivante</a></div>"; } } else { if (!empty($_SESSION['panier']['id_article'])) { echo "<div><a id='connect_btn' href='" . RACINE_SITE . "connexion.php'>Se connecter pour commander</a></div>"; } } echo "</div>"; echo "</div>"; ?> <script type="text/javascript">
echo "<img class='img_articlePanier' src='" . $_SESSION['panier']['photo'][$w] . "' alt='" . $_SESSION['panier']['titre'][$w] . "' title='" . $_SESSION['panier']['titre'][$w] . "' >"; echo "<p class='titreA_recap'>" . $_SESSION['panier']['titre'][$w] . "</p>"; echo "<p class='quantite_recap'>" . $_SESSION['panier']['quantite'][$w] . "</p>"; if ($_SESSION['panier']['id_promo'] == 1) { echo "<p class='prix_recap'>" . $_SESSION['panier']['prix'][$w] . " €</p>"; } else { echo "<p class='prix_recap'>" . prixAvecPromo($_SESSION['panier']['id_article'][$w]) . "€</p>"; } echo "</div>"; } if (montantTotal() > 50) { echo "<div id='shipping'><p>Frais de port :</p><p>Offert</p></div>"; } else { echo "<div id='shipping'><p>Frais de port :</p><p>4,50 €</p></div>"; } echo "<div id='montant_panier'><p>Sous total :</p><p>" . montantSousTotal() . " €</p></div>"; echo "<div id='montant_panierTotal'><p>Prix total :</p><p>" . montantTotal() . " €</p></div>"; echo "</div>"; ?> </div> <div id="first_Btn"><a class="btn_paiementFirst" href="<?php echo RACINE_SITE; ?> panier.php">Étape précédente</a></div> <script type="text/javascript"> document.getElementById("form_adresse").style.display = "none"; document.getElementById("formAdress_submitBtn").style.display = "none";
function montantTotal() { if (montantSousTotal() > 50) { $totalWithShipping = montantSousTotal(); } else { $totalWithShipping = montantSousTotal() + 4.5; } return virgule($totalWithShipping); }
</div> <div class="searchbar"> <form method="post" action="<?php echo RACINE_SITE; ?> recherche.php" > <input type="search" name="requete" id="recherche" placeholder="Rechercher..."> </form> </div> <div id="panier"> <?php compterArticles(); if (compterArticles() < 2) { echo '<a href=" ' . RACINE_SITE . 'panier.php" class="nb_resa">' . compterArticles() . ' article <br/>' . virgule(montantSousTotal()) . ' €</a>'; } else { echo '<a href=" ' . RACINE_SITE . 'panier.php" class="nb_resa">' . compterArticles() . ' articles <br/>' . virgule(montantSousTotal()) . ' €</a>'; } ?> </div> </div> <div id="livraison_gratuite"> <div id="text_livraison"> <img src="<?php echo RACINE_SITE; ?> /photo/free_del.png" alt="" title=""> <p>Livraison gratuite à partir de 50€ d'achat ! C'est le moment d'en profiter !<p> </div> </div> </header>