piccarda Posted June 8, 2020 Share Posted June 8, 2020 Hello everybody and thank you for reading this. I have a personal affiliation system, linked to a PS installation (version 1.7.x) using a custom module. When I use a referral link to push a new customer to sign-up, I send him to the registration page with sponsor code on the URL, like this : https://shop.xxxxx.it/it/login?d=HBKWAJQCIAJKMGAKRGKAPCRVBIMDWA To get the sponsor information, I use additionalCustomerFormFields hook in my module, I read the sponsor code and I save it in a cookie to be used on sign-up form. Now, as an option, I would like to create a referral link to point directly to a specific product on my shop, always with sponsor code on it, in this form : https://shop.xxxxx.it/it/men/1-1-hummingbird-printed-t-shirt.html#/1-dimensione-s/8-colore-bianco?sponsor=HBKWAJQCIAJKMGAKRGKAPCRVBIMDWA Here comes the problem : I don’t know how to get the sponsor code on this page. Every hook I have tried doesn’t get the additional info on the URL. I have tried hookDisplayProductPriceBlock, and other without any success. Any clue? Link to comment Share on other sites More sharing options...
piccarda Posted July 15, 2020 Author Share Posted July 15, 2020 Is there anyone that could help me on this? thanks Piccarda Link to comment Share on other sites More sharing options...
Guest Posted July 15, 2020 Share Posted July 15, 2020 $sponsor = Tools::getValue ('sponsor'); or $sponsor = $_GET['sponsor']; Link to comment Share on other sites More sharing options...
piccarda Posted July 17, 2020 Author Share Posted July 17, 2020 Hi Tengler thanks for your reply. I tried to use your suggestion in the "hookDisplayProductPriceBlock" hook, but the sponsor variable is always empty. if I use the standard url https://shop.xxxxx.it/it/women/2-9-brown-bear-printed-sweater.html#/1-dimensione-s the product is visible as usual but if I use this link: https://shop.xxxxx.it/it/women/2-9-brown-bear-printed-sweater.html#/1-dimensione-s?sponsor=HBKWAJQCIAJKMGAKRGKAPCRVBIMDWA the product is always visible as usul but I can't get the sponsor content. Thanks a lot for you help Piccarda Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2020 Share Posted July 17, 2020 Your URL must be: https://shop.xxxxx.it/it/women/2-9-brown-bear-printed-sweater.html?sponsor=HBKWAJQCIAJKMGAKRGKAPCRVBIMDWA#/1-dimensione-s In module: public function hookHeader($params) { if (Tools::getValue('id_product')) { $sponsor = $_GET['sponsor']; } } Link to comment Share on other sites More sharing options...
piccarda Posted July 23, 2020 Author Share Posted July 23, 2020 Hi Tengler thanks for your reply. It works like a charm! Thanks a lot Piccarda Link to comment Share on other sites More sharing options...
Guest Posted July 23, 2020 Share Posted July 23, 2020 I gladly helped. You can give a like by clicking on the gray heart below the posts. 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