<% msg_err = "" set template = New PA_template template.open("panier_tpl.htm") set obj_panier = new panier_cls id_panier = obj_panier.code_panier() set obj_panier_ligne = new panier_ligne_cls if id_panier = "" then template.eraseBloc "panier" template.parse_item "libelle_panier","Vous n’avez pas d’articles placés dans votre panier" else ' Fait le menage dans les paniers de plus de 5 jours obj_panier.netoyage() if request("action_formulaire") = "supp" then set obj_codage = new codage_cls obj_panier_ligne.supp_produit obj_codage.get_code(request("id_panier_ligne")),id_panier obj_panier.calcul_prix_panier(id_panier) end if if request("action_formulaire") = "recalculer" then nb_produit = request("nb_produit") set obj_codage = new codage_cls For i = 1 To nb_produit if request("ancienne_quantite_" & i) <> request("quantite_" & i) then msg_err = msg_err & obj_panier_ligne.maj_ligne_panier(id_panier,obj_codage.get_code(request("id_panier_ligne_" & i)),request("quantite_" & i)) end if Next obj_panier.calcul_prix_panier(id_panier) end if obj_panier.charge() obj_panier_ligne.charge_tout(id_panier) poid_panier = 0 if obj_panier_ligne.nb_lignes = 0 then template.eraseBloc "panier" template.parse_item "libelle_panier","Vous n’avez pas d’articles placés dans votre panier" else template.parse_item "libelle_panier","Vous avez placé les articles suivants dans votre panier :" coul_ligne = "#A95454" n_ligne = 0 set obj_codage = new codage_cls Do While not obj_panier_ligne.end_recordset n_ligne = n_ligne + 1 if coul_ligne = "#A95454" then coul_ligne = "#C58989" else coul_ligne = "#A95454" end if template.loopBloc "panier.ligne_panier",false set obj_produit_reference = new produit_reference_cls obj_produit_reference.id = obj_panier_ligne.id_ref obj_produit_reference.charge() set obj_produit = new produit_cls obj_produit.id = obj_produit_reference.id_produit obj_produit.charge() poid_panier = poid_panier + (CDbl(obj_produit.poid) * CDbl(obj_panier_ligne.quantite)) template.parse_item "panier.ligne_panier.nom_ref",obj_produit_reference.nom_ref template.parse_item "panier.ligne_panier.nom_ref_js",replace(obj_produit_reference.nom_ref,"'","\'") template.parse_item "panier.ligne_panier.coul_ligne",coul_ligne template.parse_item "panier.ligne_panier.n_ligne",n_ligne template.parse_item "panier.ligne_panier.id_panier_ligne",obj_codage.id_code(obj_panier_ligne.id) template.parse_item "panier.ligne_panier.quantite",obj_panier_ligne.quantite template.parse_item "panier.ligne_panier.prix_unitaire",FormatNumber(obj_panier_ligne.prix_unitaire,2) template.parse_item "panier.ligne_panier.prix_total",FormatNumber(obj_panier_ligne.prix_total,2) obj_panier_ligne.rs_suivant() Loop template.parse_item "nb_ligne",obj_panier_ligne.nb_lignes template.parse_item "panier.montant_ht",FormatNumber(obj_panier.montant,2) montant_tva = CDbl(obj_panier.montant) * (taux_tva/100) montant_ttc = CDbl(obj_panier.montant) + montant_tva set obj_tarif_transport = new tarif_transport_cls obj_tarif_transport.charge_frais_port(poid_panier) montant_frais_port = CDbl(obj_tarif_transport.tarif) montant_commande = montant_ttc + montant_frais_port template.parse_item "panier.montant_tva",FormatNumber(montant_tva,2) template.parse_item "panier.montant_ttc",FormatNumber(montant_ttc,2) template.parse_item "panier.montant_frais_port",FormatNumber(montant_frais_port,2) template.parse_item "panier.montant_commande",FormatNumber(montant_commande,2) end if end if if msg_err <> "" then template.parse_item "message_js","" end if template.Write() %>