Bonjour, voici mon probleme :
Si le produit existe deja alors j'incremente son compteur, sinon je creer une ligne avec un compteur a 1. Mais ca ne marche pas
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 if (isset($_POST['achat'])) { if (array_key_exists($_POST['id_produit'], $_SESSION['panier'])) $_SESSION['panier'][$_POST['id_produit']][1] = $_SESSION['panier'][$_POST['id_produit']][1] + 1; else { $_SESSION['panier'][] = $_POST['id_produit']; $_SESSION['panier'][$_POST['id_produit']][1] = 1; } }
Est-ce possible de faire un tableau a deux dimensions dans une variable de session au moins ?
Merci
Partager