WebSite X5Help Center

 
Michel R.
Michel R.
User

Code HTML du panier e-commerce  fr

Auteur : Michel R.
Visité 5779, Followers 2, Partagé 0  

bonjour,

donc une autre question, sur la version 8 , que j ai du mal à lacher, j ai un code html qui montre le panier, option quasi obligatoire en e commerce, et version 10, le code ne fonctionne pas, ca me rappel les problème Paypal bouton achat qui maintenant sont résolus.

voici le code en html version 8

<script type="text/javascript" src="res/x5cart.js"></script>
<script type="text/javascript" src="res/x5products.js"></script>
<script type="text/javascript">
//
// Show shoppingcart info on you home page
// Version for WebsiteX5 Evolution 8
// 2010 - Rbbrt
//
// Load the WX5 shoppingcartsystem
imCLoad("");
// Constant values. Change to suit your language
// or pull appropriate values from Language.ini
var strProducts="produits";
var strSubtotal="";
var strVAT = "remise";
var strTotal = imLocale["Total"];
var strEmpty = imLocale["Err_EmptyCart"];
var strGoToCart = "voir le panier";
var iNumberOfProducts=0; // for counting the number of products
var iTotal = 0; // for calculating the total of the order
var fVAT = 0;
var sBuf ="<div id='myDiv'>";
// Load the shopingcartfunction.
var sCart = imGetCookie("imOrder");
var aCart = "";
// set the results in a table...
sBuf +="<table id='myTable'>";
// split the contents of the shoppingcart into an array.
if(sCart != null && sCart != "" ) {
aCart = sCart.split("|");
}
else {
aCart = new Array();
}
// If the cart is empty show 'EmptyCart'.
// This is defined in the languagedefinition.
// Otherwise count the number of ordered articles
// and calculate the total orderprice (ex shipment and VAT.
if(aCart.length == 0) {
sBuf += strEmpty;
}
else {
for ( var i = 0; i < aCart.length; i++) {
aCartProd = aCart[i].split(":");
aProd = imCGetProduct(aCartProd[0],aCartProd[1]);
iNumberOfProducts += Number(aCartProd[3]);
iTotal += aProd[4]*aCartProd[3];
}

// Create output:
// remove the lines you don't need in your output by
// placing two forward slashed before them!

// First report the number of products and the amount ex VAT.
sBuf +="<tr><td style='text-align: left;'>" + iNumberOfProducts + " " +
strProducts + "</td>";
sBuf +="<td align='right'>" + imCFormat(iTotal,false) + "</td></tr>";

// Caluclate the amount of VAT
fVAT = iTotal * Number( imVAT/100 );

// Next report the amount of VAT
sBuf += "<tr><td style='text-align:left;'>" + strVAT + " (" + imVAT + "%)" + "</td>";
sBuf += "<td style='text-align:right;'>" + imCFormat(fVAT,false) + "</td></tr>";

// calculate the total including VAT
iTotal += fVAT;
sBuf +="<tr><td style='text-align: left;'>" + strTotal + "</td>";
sBuf +="<td align='right'><b>" + imCFormat(iTotal,false) + "</b></td></tr>";
}
sBuf += "</table>";
sBuf +=" <p>&nbsp</p>";

// add a link to go to the shoppingcart...
sBuf +="<a title='' href='imcart.html'>" + strGoToCart + "</a>";

// Close the div...
sBuf+="</div>";
// and output the buffer...
[removed](sBuf);
</script> <!-- HTML -->

Posté le
5 RéPONSES - 1 UTILES
JiPeR 48
JiPeR 48
Moderator

Re-bonjour M'sieur, je ne comprends pas trop ton souci... Veux-tu dire que ce code amène sur la visualisation du panier en cours ? Il existe un moyen beaucoup plus simple en mettant un texte ou une image sur le header du site pour amener au panier via un lien tout simple non ?

Peut-on voir ça en ligne ?

Et si ma mémoire est bonne, la V8 codait en HTML 1.0 alors que depuis la V9 le codage se fait en HTML 5... Ceci pourrait-il expliquer cela ?

@+, J.P.

Lire plus
Posté le de JiPeR 48
Michel R.
Michel R.
User
Auteur

bonjour monsieur,

ce code rend visible le panier, le nombre d article et le montant de la commande

http://salopette.org

Lire plus
Posté le de Michel R.
Mimoune .
Mimoune .
User

Bonsoir,

1/ pour accéder au panier depuis la bannière : insérer une image du panier à placer sur la bannière (onglet "en-tête"), dans modifier le modèle, puis sur cette image y associer un lien (icône lien de l'éditeur) puis sous l'onglet "Action" sélectionner tout en bas de la liste "Afficher le panier";

2/ pour afficher le nombre d'article, voir sous l'icône "insérer code html" de l'éditeur, choisir sous l'icône "insérer widget" de l'éditeur htlm "Shopping Cart" tout en bas de la liste... choisir dans la liste des widgets le type : Nombre de produits

3/ pour le montant total de la commande, même opération que le 2/, juste dans la dernière étape du Widget - ShoppingCart, vous modifiez votre choix suivant ce que vous voulez afficher ici, Total de la commande, etc.. pour le 3ème widget !

Lire plus
Posté le de Mimoune .
Mimoune .
Mimoune .
User

Oublié d'envoyer la capture .... que voici !

Lire plus
Posté le de Mimoune .
Michel R.
Michel R.
User
Auteur

bonjour,

en fait je voulais garder le code html

merci quand meme

Lire plus
Posté le de Michel R.