daneshtv Posted June 26, 2016 Share Posted June 26, 2016 Hi, We have created some promo codes and given to our affiliate partners. They have appended promo codes with their affiliate Id(For eg: their affiliate id is "www.mysite.com/clients/*?aff=2" and promo code is "MSWPMONSOON25", so they have created url like "www.mysite.com/clients/*?aff=2&promocode=MSWPMONSOON25" This url is perfectly redirecting to our mysite.com home page and while going to checkout there is not showing respective promo code. But if we append same promo code with our direct cart url "http://www.mysite.com/clients/cart.php?gid=4&promocode=MSWPMONSOON25" and its working fine and this promo code is validated in checkout page. So please guide us how to append promo codes with affiliate ids. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 26, 2016 Share Posted June 26, 2016 this is because the affiliate page is not coded to pass a promocode in that way - however, it can be persuaded to by editing the * file (it's not encrypted) and adding the following line... // if promotional code is passed, pass promocode if ($promocode = $whmcs->get_req_var('promocode')) redir("promocode=".$promocode,"cart.php"); i'd suggest putting it after the product group if statement - if you do that, then using your www.mysite.com/clients/*?aff=2&promocode=MSWPMONSOON25 link, should pass the promo to the cart and be visible at the checkout stage. 0 Quote Link to comment Share on other sites More sharing options...
Shobha Patwal Posted June 22, 2020 Share Posted June 22, 2020 On 6/26/2016 at 9:54 PM, brian! said: this is because the affiliate page is not coded to pass a promocode in that way - however, it can be persuaded to by editing the * file (it's not encrypted) and adding the following line... // if promotional code is passed, pass promocode if ($promocode = $whmcs->get_req_var('promocode')) redir("promocode=".$promocode,"cart.php"); i'd suggest putting it after the product group if statement - if you do that, then using your www.mysite.com/clients/*?aff=2&promocode=MSWPMONSOON25 link, should pass the promo to the cart and be visible at the checkout stage. Where I have to write that code 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 22, 2020 Share Posted June 22, 2020 7 hours ago, Shobha Patwal said: Where I have to write that code a f f . p h p (remove the spaces!) 0 Quote Link to comment Share on other sites More sharing options...
Shobha Patwal Posted June 23, 2020 Share Posted June 23, 2020 It is not working, I added the above code in * file but promocode is not adding to url after going to checkout page 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 23, 2020 Share Posted June 23, 2020 3 hours ago, Shobha Patwal said: It is not working, I added the above code in * file but promocode is not adding to url after going to checkout page it doesn't need to be included in the URL by the time you get to checkout - it will have already been passed to the cart and used by it if there is an applicable product within the cart... ... and if there are no products in the cart affected by the promo code, the user will be told... the fact that the promo code is no longer in the URL at checkout is intended behaviour. 0 Quote Link to comment Share on other sites More sharing options...
Shobha Patwal Posted June 23, 2020 Share Posted June 23, 2020 https://youstable.com/manage/*?aff=143&pid=21&promocode=PREMIUM75&billingcycle=triennially Neither Premium code is applying to product nor billing cycle in sidebar 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 23, 2020 Share Posted June 23, 2020 (edited) 43 minutes ago, Shobha Patwal said: Neither Premium code is applying to product nor billing cycle in sidebar the a f f file isn't designed for multiple conditions to be passed to it unless you use gocart in the url... aff . php?aff=143&gocart=true&a=add&pid=21&promocode=PREMIUM75&billingcycle=triennially ... and you might need to move where gocart is specified in the a f f file for this to work. Edited June 23, 2020 by brian! 0 Quote Link to comment Share on other sites More sharing options...
Shobha Patwal Posted June 24, 2020 Share Posted June 24, 2020 15 hours ago, brian! said: aff . php?aff=143&gocart=true&a=add&pid=21&promocode=PREMIUM75&billingcycle=triennially Using gocart in url , promocode and billing cycle are added to product but now affiliate ID is not working.. There is no increase in number of clicks in my affiliate account 0 Quote Link to comment Share on other sites More sharing options...
Shobha Patwal Posted June 24, 2020 Share Posted June 24, 2020 In * file code is this // if gocart = true, redirect to cart with request params if ($whmcs->get_req_var('gocart')) { $reqvars = ''; foreach ($_GET AS $k=>$v) $reqvars .= $k.'='.urlencode($v).'&'; redir($reqvars,"cart.php"); } 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 24, 2020 Share Posted June 24, 2020 2 hours ago, Shobha Patwal said: There is no increase in number of clicks in my affiliate account there is when I test it locally - this is the tblaffiliates_hits table from the dev... ... every one of those entries was added by a gocart link and the hits count is increasing on that affiliate's page. 🙂 0 Quote Link to comment Share on other sites More sharing options...
Shobha Patwal Posted June 24, 2020 Share Posted June 24, 2020 I tested many times there is no increase in number of clicks , but when i removing the gocart from url , it increases number of clicks with removal of promocode and billing cycle 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 24, 2020 Share Posted June 24, 2020 2 minutes ago, Shobha Patwal said: I tested many times there is no increase in number of clicks , but when i removing the gocart from url , it increases number of clicks with removal of promocode and billing cycle did you move the above gocart code like I suggested ? 0 Quote Link to comment Share on other sites More sharing options...
Shobha Patwal Posted June 24, 2020 Share Posted June 24, 2020 like this I have to write url? aff . php?aff=143&gocart=true&a=add&pid=21&promocode=PREMIUM75&billingcycle=triennially 0 Quote Link to comment Share on other sites More sharing options...
Shobha Patwal Posted June 24, 2020 Share Posted June 24, 2020 22 hours ago, brian! said: and you might need to move where gocart is specified in the a f f file for this to work. What I have to do? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 24, 2020 Share Posted June 24, 2020 56 minutes ago, Shobha Patwal said: What I have to do? I would make it the first of the if statements... // if gocart = true, redirect to cart with request params if ($whmcs->get_req_var('gocart')) { $reqvars = ''; foreach ($_GET AS $k=>$v) $reqvars .= $k.'='.urlencode($v).'&'; redir($reqvars,"cart.php"); } // if product id passed in, redirect to order form if ($pid = $whmcs->get_req_var('pid')) redir("a=add&pid=".(int)$pid,"cart.php"); // if product group id passed in, redirect to product group if ($gid = $whmcs->get_req_var('gid')) redir("gid=".(int)$gid,"cart.php"); // if register = true, redirect to registration form if ($whmcs->get_req_var('register')) redir("","register.php"); it's possible gocart isn't being called correctly, but AFAIK, it's use is undocumented (you might need to check with Support on that) - so putting it first should mean that if gocart is in the url, it takes precedence over the other options. also, you might need to change the filename from a f f.php to something else - I don't know if WHMCS you overwrite the changes to this file during an update. 0 Quote Link to comment Share on other sites More sharing options...
Shobha Patwal Posted June 25, 2020 Share Posted June 25, 2020 I did it also , but there is no change ... 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 25, 2020 Share Posted June 25, 2020 2 hours ago, Shobha Patwal said: I did it also , but there is no change ... then what happens when your site is using Six and standard_cart? it would be useful to rule out your custom theme and one page checkout custom orderform being the cause of this. 0 Quote Link to comment Share on other sites More sharing options...
Shobha Patwal Posted June 25, 2020 Share Posted June 25, 2020 so it can be due to one page checkout form? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 25, 2020 Share Posted June 25, 2020 (edited) 3 minutes ago, Shobha Patwal said: so it can be due to one page checkout form? I don't know - but i'm testing it successfully on Six & Standard_cart, so if it works for you with S&SC, then it's likely one of the custom themes; if it doesn't work with S&SC, then something else might be going on. Edited June 25, 2020 by brian! 1 Quote Link to comment Share on other sites More sharing options...
Shobha Patwal Posted June 25, 2020 Share Posted June 25, 2020 Due to onepage checkout form this error is coming..., thanks for your help.. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.