DennisHermannsen Posted September 19, 2019 Share Posted September 19, 2019 Hi, We need to set the recurring price to 0 for domain transfers for the .dk TLD. When a client orders a transfer of this TLD, the client will not be billed by us, but instead by the DK Registry. It makes absolutely no sense to have a recurring price for it for us. We can't just simply change the 'Renew/Register' price for the TLD as this price is actually used for domain registrations. Does anyone know of a way to do this? I've tried with various hooks, but without any luck. 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted September 19, 2019 Author Share Posted September 19, 2019 (edited) Seems like I didn't do my research properly 😄 This seems to be doing some of what I want: <?php add_hook('OrderDomainPricingOverride', 1, function($vars) { $domainType = $vars['type']; $domainName = $vars['domain']; if($domainType = "transfer" AND strpos($domainName, '.dk') !== false){ return ['recurringAmount' => 0]; } }); However: It doesn't calculate the correct price if I add another registration for a .dk domain. Any idea why? Edited September 19, 2019 by DennisMidjord 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted September 19, 2019 Author Share Posted September 19, 2019 Guess who made a type in their code? 😛 Correcting my if statement seems to have solved my error: <?php add_hook('OrderDomainPricingOverride', 1, function($vars) {    $domainType = $vars['type'];    $domainName = $vars['domain'];    if($domainType == "transfer" AND strpos($domainName, '.dk') !== false){       return ['recurringAmount' => 1];    } }); <?php add_hook('OrderDomainPricingOverride', 1, function($vars) { $domainType = $vars['type']; $domainName = $vars['domain']; if($domainType == "transfer" AND strpos($domainName, '.dk') !== false){ return ['recurringAmount' => 1]; } });  0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted September 25, 2019 Author Share Posted September 25, 2019 (edited) The above script should return 'recurringamount' => 0, of course 😅 I forgot to change it after testing the hook. Edited September 25, 2019 by DennisMidjord 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.