Jump to content

Recommended Posts

Hello,

 

I'm really liking the new WHMCS. Feels fresh. Anyway, I'm having a problem customizing the default cart.php page. As you can see the TLD table is missing prices here: https://my.rockhost.com/cart.php

 

However, all kinds of neat pricing options appear at the search url: https://my.rockhost.com/domainchecker.php

 

Can someone help me connect the dots? Everything else is in order. Let me know if you see otherwise.

 

Thanks!

Share this post


Link to post
Share on other sites

have you updated to v6.0.2 ?

 

that included a change to tablelist.tpl, so might be worth seeing if that fixes the issue - if not, come back and i'll take a look.

Share this post


Link to post
Share on other sites

Ah, no, I'm running v6.0.1. Is the next build related? I'll definitely go ahead and upgrade regardless. Hadn't seen that yet.

 

- - - Updated - - -

 

Ok cool, I just added about 10 tlds to my search as well. Guess we'll see what happens. Give me an hour...

Share this post


Link to post
Share on other sites

it might be something as simple as the variables/array not being available on that cart page - it looks like you're including domainchecker.tpl from the main template.

 

what I would do is add a {debug} to your rockhost/products.tpl template and see if the $tldpricelist array is actually available - it looks not.

 

if it isn't, then you may have to drop the idea of displaying the pricing table on the opening cart page; or obtain the array via a hook... or go old school and use a data feed to display the table.

Share this post


Link to post
Share on other sites

I am including domainchecker.tpl. It's inserted on line 47 of templates/orderforms/rockhost. I totally agree with you. Something is missing. I added {debug} to line 48 temporarily, but I'm not seeing any errors in the activity log or live on the page.

 

Any thoughts? Or really, how do I "hook"? Grasping a new idea here. Love to learn.

 

Thanks!

Edited by rockhost
typo

Share this post


Link to post
Share on other sites
I am including domainchecker.tpl. It's inserted on line 47 of templates/orderforms/rockhost. I totally agree with you. Something is missing. I added {debug} to line 48 temporarily, but I'm not seeing any errors in the activity log or live on the page.

apologies - I should have said to add {debug} to the end of the file. :)

 

it wouldn't have shown any errors in the logs or on the page, but it should have generated a popup box containing all variable/arrays available to that page... it seems you have left it in the template as it generated a popup when I visited just now - so you might want to remove that!

 

i've imported your rockhost order-form template into my v6 dev and added the {debug} to products.tpl - as I suspected, $tldpricelist doesn't exist and that explains why the table is empty.

 

actually, you'd also run into an issue if you were using multiple currencies, but you aren't - so never mind!

 

Any thoughts? Or really, how do I "hook"? Grasping a new idea here. Love to learn.

with the way you're including the domainchecker template, hooking to get this array is really awkward to do.

 

for your issue, i'd be tempted to come at this from entirely another angle and embed a Data Feed inside the final table of domainchecker.tpl - it is that table that is being used when including domainchecker in your products template.

 

so at ~line 120 in domainchecker.tpl, I would replace the following...

 

{foreach $tldpricelist as $tld}
<tr>
<td>{$tld.tld}</td>
<td class="text-center">{$tld.period}</td>
<td class="text-center">{if $tld.register}{$tld.register}{else}{$LANG.domainregnotavailable}{/if}</td>
<td class="text-center">{if $tld.transfer}{$tld.transfer}{else}{$LANG.domainregnotavailable}{/if}</td>
<td class="text-center">{if $tld.renew}{$tld.renew}{else}{$LANG.domainregnotavailable}{/if}</td>
</tr>
{/foreach}

with..

 

<script language="javascript" src="feeds/alltldpricing.php?currency={$currency.id}"></script>

and then in the "Feeds" directory, create a new file called "alltldpricing.php" and add the following code within it...

 

<?php

require("../init.php");
require("../includes/domainfunctions.php");

$code = '';

if (!is_numeric($currency)) {
   $currency = array();
} else {
   $currency = getCurrency('', $currency);
}

if (!$currency || !is_array($currency) || !isset($currency['id'])) {
   $currency = getCurrency();
}

$freeamt = formatCurrency(0);
$tldslist = getTLDList();
foreach ($tldslist AS $tld) {
   $tldpricing = getTLDPriceList($tld, true);
   $firstoption = current($tldpricing);
   $year = key($tldpricing);
   $transfer = ($firstoption["transfer"] == $freeamt) ? $_LANG['orderfree'] : $firstoption["transfer"];
   $code .= sprintf(
       '<tr><td class="text-center">%s</td><td class="text-center">%d</td><td class="text-center">%s</td><td class="text-center">%s</td><td class="text-center">%s</td></tr>',
       htmlspecialchars($tld, ENT_QUOTES, 'UTF-8'),
       $year,
       htmlspecialchars($firstoption["register"], ENT_QUOTES, 'UTF-8'),
       htmlspecialchars($transfer, ENT_QUOTES, 'UTF-8'),
       htmlspecialchars($firstoption["renew"], ENT_QUOTES, 'UTF-8')
   );
}

$code .= '';

echo "document.write('".$code."');";

you should now have a working "ALL TLD Pricing" table on both domainchecker.php and cart.php! :)

 

there is a slight issue with the Data Feed generated table rows looking slightly squashed (only in cart.php not domainchecker.php), but that is being caused by a order-form css clash - the solution I think is to modify rockhost/style.css and change the padding from "2px 3px" to "8px" - however, this might well have untold consequences elsewhere in the cart (possibly viewcart?), so you might want to test that thoroughly.

 

#order-slider table tr td {
   padding: 2px 3px;

if the css solution turns out to be something else, let me know!

Share this post


Link to post
Share on other sites

Wow, thanks, that's a lot to take in. My brain's fried for today, but I'll certainly test this tomorrow. I did remove the debug code. Thanks for that!

Share this post


Link to post
Share on other sites

just checked out the site - it looks ok doesn't it! :idea:

 

with regards to the table padding being different on the cart page from domainchecker, it occurred to me that if you wanted to fix it, it's easier not to mess with your stylesheets but to add the specific styling to the data feed, e.g replace each...

 

<td class="text-center">

with...

<td class="text-center" style="padding: 8px;">

and the two tables should match (apart from that i've centred the TLD in the data feed, but it's not centred in the original table - though I think mine looks better!).

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By onliner
      Hello,
      As WHMCS support couldn't reproduce the issue, I want to check if someone has experience this 'odd issue'.
      Simply, when a domain check query has been entered, either as direct in the domain check box, or as a link like
      https://domainxxxxx.xxx/cart.php?a=add&domain=register&query=somenewdomain.net
      it takes WHMCS between 6-8 seconds just to respond to a query. In all, it can take up to 14 seconds to load the result.
      I've minimized the auto search to just one TLD, and I've also disabled spotlight TLDs.
      3 independent online speed test tools, return following results:
      I'm using the default templates, both for orderforms and design.
      Load time: 6.89 s
      Fully loaded: 13.811s
      Fully Loaded Time: 8.9s
      I'm getting about 400ms as a TTFB.
      I don't have any ideas left to try. I would appreciate any constructive input. Thanks in advance!
      WHMCS 7.7.1
      PHP version 7.2.19
      PHP Memory Limit  1024MB
       
       
       
       

    • By So, who am I ?
      Hello
      I'd like to sell domains with different price and currency for customers who visit from outside my country.
      I'm thinking to use OrderDomainPricingOverride hook to change price for non local customers, I plan to differ local and non local customers by their IP. But before I start, thought to ask here, maybe there's a better built in way of doing it that I couldn't find.
      I see I can add another currency to WHMCS but it says:  Customers who visit your site can then choose to shop in their local currency.
      I don't want customers to have to choose currency, I want local ones to shop with local currency and non local one with non local currency. I still can differ it manually by IPs I know, just want to know if WHMCS has some extra features for it that I can use.
    • By hexonet
      Hello WHMCS fans,
       
      The domain name landscape is changing dramatically with the introduction of more than 1000 new TLDs. As well there is a significant shift towards the secondary market. Taking these factors into consideration, we decided to develop a new Domain Checker Module for WHMCS.
       
      Key Features:
       
      - Support for the new gTLDs (.BIKE, .EMAIL, .SEXY, and many others ...)
      - High-performance Domain Availability Checks using our registrar API
      - Support of NameMedia Aftermarket premium domains
      - Support of Donuts Registry premium domains
      - Support of RightSide, .BUILD, .CEO & .MENU Registry premium domains (coming soon)
      - Categorization of the TLDs in 2 levels for an improved user experience
      - Various performance optimizations
      - Ajax driven search (no page reload)
      - Easy to install
       
      We're looking for individuals around the world who are interested in beta testing our new module.
      If you are interested, please send an email to support@hexonet.net and we will send you all the required information.
       
      A public demo site is available at:
       
      http://try-whmcs.hexonet.net/
      User / Pass: demo / demo
       
      Thanks in advance.
       
      Your HEXONET Team
    • By fiberit
      I get domain unavailable for extensions: .eu .be .aero .gr
       
      I have check this issue with some long names and always get "unavailable".
    • By CCSupport
      Hello all,
       
      Just been doing some testing and came across what seems to be a bug when searching for a domain.
       
      With the Default Captcha enabled I searched for a test domain from /domainchecker.php. After completing the Captcha and hitting 'Check Availability' it worked normally, so it showed the result of my search, however I then entered a different domain to search, entered the new 5 character verification code and again hit 'Check Availability'....this failed...it came up with the error 'The characters you entered didn't match the image shown. Please try again.'
       
      I completed the exact same test a number of times, all with the same result....it only allows one time search for the domain. As soon as one search is completed even though it does change the Captcha code one has to refresh the page and enter the code for a successful search.
       
      Can someone else confirm this?
       
      Thanks
  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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