Jump to content

domain renewal is not honoring the recurring price setting - part 2


Recommended Posts

Sorry to post this way as im unable to reply to the post

Quote

if you are offering renewals at different prices, then the simplest solution might be to just disable renewals in the client area and let them renew the domains upon invoice at due time... other than that, and assuming you can't use pricing slabs, then you're going to have to develop a custom solution.

I did this and now im a bit lost as i see clients that are able to renew in advance.....perhaps the Renew button is showing anyway before X days from the expiry date? They are being able to simply order the renewal and the system is using the base price. Please help!!! hahahaha

Thanx!

Link to comment
Share on other sites

19 hours ago, plusplushosting said:

I did this and now im a bit lost as i see clients that are able to renew in advance

then it sounds like you still haven't disabled "Enable Renewal Orders" in general settings -> domains... if you do that, they will not be able to renew their domains from the cart and will have to wait for the invoice - with their renewal price correctly taken from their own recurring price amount.

Quote

When enabled clients will see domain renewal options in the client area and a renewal category in the shopping cart allowing for them to renew domains at any time. When unticked clients will only be able to renew domains when the renewal invoice is automatically generated.

Link to comment
Share on other sites

13 minutes ago, brian! said:

then it sounds like you still haven't disabled "Enable Renewal Orders" in general settings -> domains... if you do that, they will not be able to renew their domains from the cart and will have to wait for the invoice - with their renewal price correctly taken from their own recurring price amount. 

Thats the problem, i did this initially and they continue being able to order renewals. 😞

Also logging in as a client i do not see the renewal button....so im a bit lost if im missing anything else.

Thanx!

Link to comment
Share on other sites

3 hours ago, plusplushosting said:

Thats the problem, i did this initially and they continue being able to order renewals.

that's weird...

3 hours ago, plusplushosting said:

Also logging in as a client i do not see the renewal button....so im a bit lost if im missing anything else.

that "Renew Domains" link in the menu should be conditional on whether "Enable Renewal Orders" is enabled or not... so if it's disabled, then it gets removed from the menu and it sounds as though that is what you're seeing on your custom theme too - so far, so good.🙂

however, i've just found a bug whilst checking this - in that, even if the feature is disabled, a client could still go to /cart/domain/renew (or whatever your Friendly URL equivalent is) and access the renewals page - that's insanely poor coding/testing from WHMCS to allow that... 🙄

perhaps your clients are still able to access the page via links in your emails or elsewhere on your site ??

you could null the array used on that page with a hook if the "Enable Domain Renewal" feature is disabled...

<?php

use WHMCS\Config\Setting;

function domain_renewals_disabled_hook($vars) {

	$templatefile = $vars['templatefile'];
	if ($templatefile == "domain-renewals" && Setting::getValue('EnableDomainRenewalOrders') != 'on') {
		return array ("renewalsData" => null);
	}
}
add_hook("ClientAreaPage", 1, "domain_renewals_disabled_hook");

PFvfK4H.png

or you could delete or edit the domains-renewals.tpl template itself, but hooking would probably be better.

Link to comment
Share on other sites

  • 2 weeks later...

just got another order for renewal 😞

Looks like the hook is not doing the job somehow....i tested accessing " domain.com/cart/domain/renew" and is load that page with all the domains and the renew buttons 😞

I had to simply remove the domain-renewals.tpl file (hopefully this will not affect another thing other than the early renewal option)

Thanx!

Link to comment
Share on other sites

11 hours ago, plusplushosting said:

Looks like the hook is not doing the job somehow....i tested accessing " domain.com/cart/domain/renew" and is load that page with all the domains and the renew buttons

the problem here might be that it's a custom template, and the domain renewals template might be called something else internally... using a {debug} in that template might tell you what it's called, or asking @Impressive Themes as it's their control template that you're using... as this renewals page is a loggedin-only page, it's difficult for me to test externally.

11 hours ago, plusplushosting said:

I had to simply remove the domain-renewals.tpl file (hopefully this will not affect another thing other than the early renewal option)

if you're going down that road, you'd probably have to remove it from other templates too - e.g., to prevent them bypassing your default template and using one of the others. 🙄

Link to comment
Share on other sites

Thanx! This is getting more interesting....the template file is called the same way...i have also removed the IF logic to simply return null anyway and is not working, keeps loading the renewal page.  Any idea?

 

<?php

use WHMCS\Config\Setting;

function domain_renewals_disabled_hook($vars) {

                return array ("renewalsData" => null);
}
add_hook("ClientAreaPage", 1, "domain_renewals_disabled_hook");

 

 

Link to comment
Share on other sites

On 03/03/2019 at 18:16, plusplushosting said:

i have also removed the IF logic to simply return null anyway and is not working, keeps loading the renewal page.  Any idea? 

that still continues to work as expected on Six - though it's not a good idea to remove the IF in general.

edit your renewals template, add  {debug} to the end and tell me the value of templatefile in the popup window.

also, which version of WHMCS are you using ???

Link to comment
Share on other sites

Thanx!

Quote

edit your renewals template, add  {debug} to the end and tell me the value of templatefile in the popup window.

yup, is what i did before....

$templatefile
Origin: "Smarty object" 	
Value
"domain-renewals"
   
Quote

also, which version of WHMCS are you using ??? 

7.6.1

Thanx Brian!

Link to comment
Share on other sites

5 hours ago, plusplushosting said:

7.6.1

we've entered the Twilight Zone - this for me is working on my v7.6.1 dev...

NJWL0KD.png

... assuming that "Enable Renewal Orders" is unticked in general settings -> domains and that your uploading the hooks to /includes/hooks

0AyThE6.png

also, double check the value in the tblconfiguration table just to ensure that it's not "on" (it will likely be empty).

you could try not using the Class method and going old-skool using $CONFIG... either method should work... if they don't, then something weird is going on...

<?php

function domain_renewals_disabled_hook($vars) {

	global $CONFIG;
	$templatefile = $vars['templatefile'];
	if ($templatefile === "domain-renewals" && $CONFIG['EnableDomainRenewalOrders'] !== 'on') {
		return array ("renewalsData" => null);
	}
}
add_hook("ClientAreaPage", 1, "domain_renewals_disabled_hook");
Link to comment
Share on other sites

1 hour ago, plusplushosting said:

im not sure why is not working in my installation.

the weird thing about your site is that if I try to get it to use Six & Standard_cart (by specifying them in the URL), it tries to, but it fails to load the css/js (as they're 404), so the output isn't correct... though that may be intentional if you don't want users using Six.

anyway, if the template is gone, and they can't use another cart or theme, that should resolve the issue. 🙂

Link to comment
Share on other sites

  • 3 weeks later...
57 minutes ago, plusplushosting said:

is there any way to have $registrarModuleName from the classes available as a variable in the domain-renewal.tpl? 

if it isn't there by default, then it would be a ClientAreaPage hook (IIRC Cart hook isn't triggered by the renewals page); you would get the $renewalsData array from the template; loop through the array; add the registrar name to each domain in the array and then return the array to the template.

Link to comment
Share on other sites

  • 1 month later...
On 3/21/2019 at 1:36 PM, brian! said:

if it isn't there by default, then it would be a ClientAreaPage hook (IIRC Cart hook isn't triggered by the renewals page); you would get the $renewalsData array from the template; loop through the array; add the registrar name to each domain in the array and then return the array to the template.

Yea...a piece of cake :-).....for a developer ...is Chinese for me, hahahaha.....any chance to give me at least a base code to work with it? Thanx again Brian!

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi there,

I've been able to reproduce this on my fresh 7.7.1 installation too, and as such have opened case #CORE-13372 with our developers in order to have this reviewed for future releases. Once we resolve cases and push features they are available at our change log, here:

https://changelog.whmcs.com/

Thanks again for taking the time to report your findings. We welcome bug reports at https://bugs.whmcs.com/

Link to comment
Share on other sites

On 14/05/2019 at 15:27, plusplushosting said:

Yea...a piece of cake :-).....for a developer ...is Chinese for me, hahahaha.....any chance to give me at least a base code to work with it? Thanx again Brian!

you don't want a base code - you want me to write the whole thing! 😎

if a domain is assigned to a registrar, using the attached hook, you should be able to access it in the template foreach loop using...

{$renewalData.registrarmodule}

if a domain is not currently assigned to a registrar, then the above variable won't exist for that particular domain.

 

Link to comment
Share on other sites

22 minutes ago, plusplushosting said:

What will be the difference to write 1000 hooks or 1001 🙂 ? 

i'd need another week off! 😎

21 minutes ago, plusplushosting said:

Thanx again man!...as you can see you cant take vacations....nor taste such things like a "sun" or odd stuff like that 🙂

Brian returns to the dark basement with no windows, not allowed to see the sun ever again, to continue banging out hooks... escalator.gif

Link to comment
Share on other sites

Hi Brian,

Why do you need a window!? You can see the life through a screen 🙂

Unfortunately something is not working as it not passing the registrar variable in the array. I did add {debug} in the template and there isn't any variable in the array for the registrar name (registrarmodule).

Thanx!

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated