Sign in to follow this  
Followers 0

dans achat/caddie_ajout.php

12 posts in this topic

Posted · Report post

bonjour,

Quand une cliente, ou un client ajoute un produit dans son caddie, j'aimerai qu'ils soient renvoyés directement dans caddie_affichage, afin qu'ils voient de suite que l'article s'est bien ajouté à leur caddie.

comment changer cela dans la page caddie_ajout :

	header("Location: $wwwroot/cookie.php");
[/codebox]

et lorsqu'ils sont bien dans la page caddie_affichage, j'aimerai que lorsqu'ils cliquent sur "continuer à acheter" que le click les renvoient là où ils étaient, et non pas retour aux catégories, mais, qu'ils se retrouvent à la page du dernier produit vu et ajouter au caddie.

Je ne sais pas si je me fais bien comprendre, et si le problème a déjà été soumis, pourriez vous me donner le lien du post, je vous en remercie

Jackye

Share this post


: post
Share on other sites

Posted · Report post

attention : le code qui tu as donné plus haut permet de rédiriger l'utilisateur si son navigateur n'accepte pas les cookies

Share this post


: post
Share on other sites

Posted · Report post

attention : le code qui tu as donné plus haut permet de rédiriger l'utilisateur si son navigateur n'accepte pas les cookies

Ah bon, donc, on ne peut pas rediriger l'utilisateur vers la page que l'on veut, si je comprends bien. :huh:

Share this post


: post
Share on other sites

Posted · Report post

ben si, bien sûr

Share this post


: post
Share on other sites

Posted · Report post

ben si, bien sûr

Plusieurs code possible

header("Location:$wwwroot/achat/caddie_affichage.php"); // Renvoie sur le caddie


header("Location:$_SERVER['HTTP_REFERER']"); // Renvoie sur la page précédente


header("Location:$wwwroot/achat/index.php"); // Renvoie sur lpage catalogue

Share this post


: post
Share on other sites

Posted · Report post

merci Mr Pruault,

mais, mon code doit ressembler à ça :

<?

include("../configuration.inc.php");

if (!isset($_COOKIE['PHPSESSID'])) {

header("Location: $wwwroot/cookie.php");
header("Location:$wwwroot/achat/caddie_affichage.php"); // Renvoie sur le caddie
header("Location:$_SERVER['HTTP_REFERER']"); // Renvoie sur la page précédente
header("Location:$wwwroot/achat/index.php"); // Renvoie sur lpage catalogue} else {
[/codebox]

ou à ça :

[codebox]$_SESSION['caddie']->ADD_CART($_REQUEST['id'], $_REQUEST['qte']);
$_SESSION['caddie']->EMPTY_LIST();
$_SESSION['caddie']->UPDATE();

header("Location:$wwwroot/achat/caddie_affichage.php"); // Renvoie sur le caddie

header("Location:$_SERVER['HTTP_REFERER']"); // Renvoie sur la page précédente

header("Location:$wwwroot/achat/index.php"); // Renvoie sur lpage catalogue

if (!isset($_COOKIE['PHPSESSID'])) {

header("Location: $wwwroot/cookie.php");

ou ni l'un ni l'autre, à mon avis ni l'un ni l'autre,

Share this post


: post
Share on other sites

Posted · Report post

pour renvoyer sur le caddie après l'ajout du produit c'est

header("Location:$wwwroot/achat/caddie_affichage.php");

comme le dit Patrice

ds achat/caddie_ajout.php

Share this post


: post
Share on other sites

Posted · Report post

pour renvoyer sur le caddie après l'ajout du produit c'est

header("Location:$wwwroot/achat/caddie_affichage.php");

comme le dit Patrice

ds achat/caddie_ajout.php

yes, Paulanna, j'ai à peu près compris, mais, quand elles sont dans leur caddie affichage après avoir ajouté un produit, quand elles cliquent sur continuer mes achats, j'aimerai qu'elles soient renvoyées à la dernière page qu'elles ont consultée, donc, est ce que :

header("Location:$wwwroot/achat/caddie_affichage.php"); est suffisant.

Tu me diras que "jai qu'à essayer, tu verras bien"

merci Paulanna,

bonne journée,

Jackye

Share this post


: post
Share on other sites

Posted · Report post

est ce que la redirction fonctionne ?

alors, alors tu mets ds achat/modeles/caddie_affichage

<tr><td><a href="<?php echo $referer?>">continuer mes achats</a></td></tr> où tu le souhaites

et ds achat/caddie_affichage.php sous l'inclusion du fichier de configuration

$referer = $_SERVER['HTTP_REFERER'];

Share this post


: post
Share on other sites

Posted · Report post

merci Paulanna, mais, si je fais ça dans achat caddie affichage :

$_SESSION['caddie']->nettoie();

$_SESSION['caddie']->recalc_total();

}

if (! empty($_SERVER['HTTP_REFERER'])) {

header("Location: ".$_SERVER['HTTP_REFERER']."");

} else {

header("Location:$wwwroot/achat/caddie_affichage.php");}

}[/codebox]

il ne se passe rien, on est toujours renvoyé à la page de l'article qui a été ajouté, mais, pas à la page du caddie.

Si je fais ça :

[codebox]$_SESSION['caddie']->ajout();
$_SESSION['caddie']->nettoie();
$_SESSION['caddie']->recalc_total();

}

if (! empty($_SERVER['HTTP_REFERER'])) {

header("Location: ".$_SERVER['HTTP_REFERER']."");

} else {

header("Location:$wwwroot/achat/caddie_affichage.php");}

alors, là, c'est pire, que je clique sur ajouter au caddie, il y a une page pleine de ligne d'erreurs,

Je ne fais pas bien les choses,

Désolée, j'ai essayé, mais merci quand même

bonne journée,

Jackye

Share this post


: post
Share on other sites

Posted · Report post

heu, oups ! pour la redirection c'est achat/caddie_ajout.php (en fin de fichier)

je te rassure, j'aurai du m'en rendre compte moi aussi, mais, j'ai pris habitude de te suivre les yeux fermés :huh:

j'essayerai donc cela plus tard, là, il est temps que je me remette au travail,

bonne journée,

Jackye

Share this post


: post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

Twitter Advisto ecommerce

Facebook PEEL Shopping