Jump to content

(Another) issue in Premium domains management


Remitur

Recommended Posts

Premium Domain management in WHMCS is quite poorly managed, and a number of different issues may occur...

I just realized another issue in premium domain renewal.

 Example:

  • you manage a Premium domain; standard renewal price is 10, for that particular domain renewal price is 120
  • so you set "recurring amount" to 120
  • if domain is set to autorenew, the system will issue an invoice for 120; the user will pay 120, and everything will be fine and everyone will be happy

But what's happen if the user decides to renew it manually?

The user goes to /index.php/cart/domain/renew  and ... SURPRISE! He will be proposed t renew the domain not for the "recurring amount" set, but for the standard price

Long story short. the user will be able to renew his Premium domain paying just 10 instead than 120 ... 🥵

I've just realized this issue, and so I don't know if any easy fix exists, or if it's even possible to fix the issue any way...

 (Apart for the obvious way: do not try to manage premium domains using WHMCS...) 

 

 

Link to comment
Share on other sites

Interesting. I guess that follows the same (flawed) logic that regular domain renewals does.

If a client has registered a domain for $10, and you later change the price for renewals to $15 (without changing the price for existing domains), WHMCS will keep billing the client the original amount.
If the client manually renews the domain, they're suddenly billed $15.

It is described here: https://docs.whmcs.com/Domain_Renewals#Domain_Renewal_Pricing

It is apparently by design but I don't understand what led to that design decision.

Link to comment
Share on other sites

I found a quick and dirty workaround. Far from being perfect, but fixing this issue should be a job for WHMCS's developers,,,

Just edit /templates/orderforms/standard_cart/domain-renewals.tpl (or whatever cart you're using); find following lines:


                                    <h3>{$renewalData.domain}</h3>

                                    <p>{lang key='clientareadomainexpirydate'}: {$renewalData.expiryDate->format('j M Y')} ({$renewalData.expiryDate->diffForHumans()})</p>

                                    {if ($renewalData.pastGracePeriod && $renewalData.pastRedemptionGracePeriod) || !count($renewalData.renewalOptions)}
                                    {else}
                                    <form class="form-horizontal">
                                        <div class="form-group row">
                                            <label for="renewalPricing{$renewalData.id}" class="control-label col-md-5">
                                                {lang key='domainRenewal.availablePeriods'}
                                                {if $renewalData.inGracePeriod || $renewalData.inRedemptionGracePeriod}
                                                    *
                                                {/if}
                                            </label>
                                            <div class="col-sm-6">
                                                <select class="form-control select-renewal-pricing" id="renewalPricing{$renewalData.id}" data-domain-id="{$renewalData.id}">
                                                    {foreach $renewalData.renewalOptions as $renewalOption}
                                                        <option value="{$renewalOption.period}">
                                                            {$renewalOption.period} {lang key='orderyears'} @ {$renewalOption.rawRenewalPrice}
                                                            {if $renewalOption.gracePeriodFee && $renewalOption.gracePeriodFee->toNumeric() != 0.00}
                                                                + {$renewalOption.gracePeriodFee} {lang key='domainRenewal.graceFee'}
                                                            {/if}
                                                            {if $renewalOption.redemptionGracePeriodFee && $renewalOption.redemptionGracePeriodFee->toNumeric() != 0.00}
                                                                + {$renewalOption.redemptionGracePeriodFee} {lang key='domainRenewal.redemptionFee'}
                                                            {/if}
                                                        </option>
                                                    {/foreach}
                                                </select>
                                            </div>
                                        </div>
                                    </form>
                                    {/if}

                                    <div class="text-right">
                                        {if !$renewalData.eligibleForRenewal || $renewalData.beforeRenewLimit || ($renewalData.pastGracePeriod && $renewalData.pastRedemptionGracePeriod)}
                                        {else}
                                            <button id="renewDomain{$renewalData.id}" class="btn btn-default btn-sm btn-add-renewal-to-cart" data-domain-id="{$renewalData.id}">
                                                <span class="to-add">
                                                    <i class="fas fa-fw fa-spinner fa-spin"></i>
                                                    {lang key='addtocart'}
                                                </span>
                                                <span class="added">{lang key='domaincheckeradded'}</span>
                                            </button>
                                        {/if}
                                    </div>
                                </div>
                            {/foreach}
                        </div>

and change it to:

                                   <h3 class="font-size-24">{$renewalData.domain}</h3>
                                    {if $renewalData.isPremium}
                                        <span class="label label-danger">Premium Domain - Open a support ticket to renew it</span>
                                    {/if}
                                    <p>{lang key='clientareadomainexpirydate'}: {$renewalData.expiryDate->format('j M Y')} ({$renewalData.expiryDate->diffForHumans()})</p>
                                    {if $renewalData.freeDomainRenewal}
                                        <p class="domain-renewal-desc">{lang key='domainRenewal.freeWithServiceDesc'}</p>
                                    {/if}

                                    {if ($renewalData.pastGracePeriod && $renewalData.pastRedemptionGracePeriod) || !count($renewalData.renewalOptions) || $renewalData.isPremium }
                                    {else}
                                        <form class="form-horizontal">
                                            <div class="form-group row">
                                                <label for="renewalPricing{$renewalData.id}" class="control-label col-md-5">
                                                    {lang key='domainRenewal.availablePeriods'}
                                                    {if $renewalData.inGracePeriod || $renewalData.inRedemptionGracePeriod}
                                                        *
                                                    {/if}
                                                </label>
                                                <div class="col-sm-6">
                                                    <select class="form-control select-renewal-pricing" id="renewalPricing{$renewalData.id}" data-domain-id="{$renewalData.id}">
                                                        {foreach $renewalData.renewalOptions as $renewalOption}
                                                            <option value="{$renewalOption.period}">
                                                                {$renewalOption.period} {lang key='orderyears'} @ {$renewalOption.rawRenewalPrice}
                                                                {if $renewalOption.gracePeriodFee && $renewalOption.gracePeriodFee->toNumeric() != 0.00}
                                                                    + {$renewalOption.gracePeriodFee} {lang key='domainRenewal.graceFee'}
                                                                {/if}
                                                                {if $renewalOption.redemptionGracePeriodFee && $renewalOption.redemptionGracePeriodFee->toNumeric() != 0.00}
                                                                    + {$renewalOption.redemptionGracePeriodFee} {lang key='domainRenewal.redemptionFee'}
                                                                {/if}
                                                            </option>
                                                        {/foreach}
                                                    </select>
                                                </div>
                                            </div>
                                        </form>
                                    {/if}

                                    <div class="text-right">
                                        {if !$renewalData.eligibleForRenewal || $renewalData.beforeRenewLimit || $renewalData.isPremium || ($renewalData.pastGracePeriod && $renewalData.pastRedemptionGracePeriod)}
                                        {else}
                                            <button id="renewDomain{$renewalData.id}" class="btn btn-default btn-sm btn-add-renewal-to-cart" data-domain-id="{$renewalData.id}">
                                                <span class="to-add">
                                                    <i class="fas fa-fw fa-spinner fa-spin"></i>
                                                    {lang key='addtocart'}
                                                </span>
                                                <span class="added">{lang key='domaincheckeradded'}</span>
                                            </button>
                                        {/if}
                                    </div>
                                </div>
                            {/foreach}
                        </div>

The result will be this:

 

screenshot-dev.domainregister.international-2022.10.27-23_20_35.png

Link to comment
Share on other sites

16 minutes ago, DennisHermannsen said:

It is apparently by design but I don't understand what led to that design decision.

It's a flawed design.

It seems that renewal page uses standard price, whatever price has been set as "recurring amount".

 Instead it should be something like:

if recurring amount = standard price
    use standard price for any number of years available and set
else 
    use custom price and allows just one year (or the different period set for this particular domain) renewal
endif

  Implementing this logic into php code would be trivial, while implementing it using Smarty would be a nightmare (or even simply impossible...)

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.

×
×
  • 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