stuners Posted June 19, 2019 Share Posted June 19, 2019 Bonjour, tout d'abord, il s'agit d'une version de PS 1.6.1 j'ai besoin d'overrider le module "blockcart" qui génère la pop-up lorsqu'on ajoute un produit au panier afin de faire remonter le pays du client afin de mettre un message à la place des FDP si le client n'est pas FR. Cependant, les infos du client ne sont pas remontés dans cette partie du module. Je ne peux donc pas ajouter ma condition. Existe t-il une variable global que je peux appeller ? Où savez-vous comment je peux déclarer une nouvelle variable dans le fichier php ? Merci. Link to comment Share on other sites More sharing options...
Eolia Posted June 19, 2019 Share Posted June 19, 2019 Vous avez tout dans le context ($this->context) 1 Link to comment Share on other sites More sharing options...
stuners Posted June 19, 2019 Author Share Posted June 19, 2019 (edited) 7 minutes ago, Eolia said: Vous avez tout dans le context ($this->context) Merci pour votre réponse. $this->context est à utiliser dans le fichier php ? Merci, j'avais dejà testé mais je viens de m'apercevoir que c'est mon fichier php overridé qui n'est pas pris en compte ! Mais ça fonctionne ! Merci beaucoup Edited June 19, 2019 by stuners (see edit history) Link to comment Share on other sites More sharing options...
Eolia Posted June 19, 2019 Share Posted June 19, 2019 il y a 44 minutes, stuners a dit : Merci pour votre réponse. $this->context est à utiliser dans le fichier php ? Merci, j'avais dejà testé mais je viens de m'apercevoir que c'est mon fichier php overridé qui n'est pas pris en compte ! Mais ça fonctionne ! Merci beaucoup Vous avez bien supprimé le fichier /cache/class_index.php ? Link to comment Share on other sites More sharing options...
stuners Posted June 19, 2019 Author Share Posted June 19, 2019 1 minute ago, Eolia said: Vous avez bien supprimé le fichier /cache/class_index.php ? Je vais tester, merci beaucoup Link to comment Share on other sites More sharing options...
Eolia Posted June 19, 2019 Share Posted June 19, 2019 Hello, Please read the documentation before trying to override something here. http://doc.prestashop.com/display/PS16/Overriding+default+behaviors Frequently Asked Questions Q: I added an override file but it seems to be ignored by PrestaShop A: You need to trigger the regeneration of the /cache/class_index.php file. This is done simply by deleting the file. It is the same when manually removing an override: in order to reinstate the default behavior, you must delete the /cache/class_index.php file. 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