Jump to content

Prestashop 1.6.0.14 - Ajout un produit au panier avec une URL en GET


Recommended Posts

Bonjour à tous,

 

Je recherche un moyen d'ajouter un produit panier, uniquement grâce à une URL. j'ai déjà trouvé des URLs type, mais surement trop vielle pour fonctionner avec ma version de Prestashop.

 

Ces URLs détenaient l'id_product, la quantité ect...

 

Il y a-t-il un module pour faire cela ? Une URL déjà disponible ? Créer un module qui accepte une URL et qui ajoute au panier en PHP ?

 

Merci de vos réponses

 

Loïc

Link to comment
Share on other sites

Dans le fichier CartController, j'ai crée un overide.

 

Ceci:

if ($this->context->cookie->exists() && !$this->errors && !($this->context->customer->isLogged() && !$this->isTokenValid()))

 

Est devenu 

if ($this->context->cookie->exists() && !$this->errors && !$this->is_bot($_SERVER['HTTP_USER_AGENT']))

 

J'ai crée une méthode is_bot pour détecter les robots

Link to comment
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
×
×
  • Create New...