martilu Posted May 27, 2021 Share Posted May 27, 2021 Hi, I'm trying to add some js script in the <head> tag go a page only when a customer successfully creates an account. It should be in the sign up process and in the checkout, when the client registers as a new customer. Till now I've created a custom module and registering hookActionFrontControllerSetMedia I've been able to add my module custom javascript in the head, obviously it's in every page, but I want it only on registration event page. Is there anyone that can help me? Thanks Link to comment Share on other sites More sharing options...
Ress Posted March 3, 2022 Share Posted March 3, 2022 You could use the actionCustomerAccountAdd hook, which runs when someone logs in. Here, for example, you can save a cookie, which you can check where you register your js, then delete the cookie. Link to comment Share on other sites More sharing options...
JBW Posted March 4, 2022 Share Posted March 4, 2022 On 5/27/2021 at 3:14 PM, martilu said: Till now I've created a custom module and registering hookActionFrontControllerSetMedia I've been able to add my module custom javascript in the head, obviously it's in every page, but I want it only on registration event page. Check the controller inside the hook and only add the JS when it's inside the desired one. Alternatively check prestashop.page.page_name inside your JS 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