LoicCDIP Posted June 11, 2015 Share Posted June 11, 2015 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 More sharing options...
LoicCDIP Posted June 11, 2015 Author Share Posted June 11, 2015 Essayez d'utiliser cette URL ! http://prestashop.com/index.php?controller=cart&add=add&id_product=46&id_lang=1&qty=3&id_product_attribute=790 Le problème, c'est que cela fonctionne uniquement si un paramètre token est présent, et valide. Link to comment Share on other sites More sharing options...
LoicCDIP Posted June 11, 2015 Author Share Posted June 11, 2015 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now