Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 07/09/2018 in all areas

  1. 2 points
    With the help from support team, it has been fixed, it looks like a number of extensions were missing from the php 7.1/7.2 branch, I have installed them now. All looking good so far Thanks to all for your input, much appreciated 👍
  2. 2 points
    there won't be a way from the settings, so you'll be left with a one line template edit (basically {if $addon.id neq 'x'} inside the first foreach loop - add closing if) or as a hook... <?php /** * Prevent ordering of specific product addons for existing products * @author brian! */ use Illuminate\Database\Capsule\Manager as Capsule; function cart_prevent_ordering_of_product_addons($vars) { $blocked = [1,9,10]; if ($vars['templatefile']=='addons'){ $addons = $vars['addons']; foreach ($addons as $key => $addon) { if (in_array($addon['id'],$blocked)) { unset($addons[$key]); } } $addons = array_values($addons); return array("addons" => $addons); } } add_hook("ClientAreaPageCart", 1, "cart_prevent_ordering_of_product_addons"); in the above hook example, $blocked is an array of addon IDs that you don't want to let clients add to existing products... addons purchased through the cart via configureproduct won't be affected by this hook.
  3. 1 point
    Hi chrigu, please proof if you allow incoming traffic all other incoming traffic in your FW settings: If you block specific ports you need to create a new role and allow port 8443 if still standard. Greetings and best regards Christian
  4. 1 point
    <?php /** * Replace somePrefix with something else to avoid function name collissions */ use WHMCS\Database\Capsule; function somePrefix_AcceptOrder($vars) { $groupID = 1; // Replace with the ID of your Client Group $userID = Capsule::table('tblorders')->where('id', $vars['orderid'])->first(['userid']); Capsule::table('tblclients')->where('id', $userID->userid)->update(['groupid' => $groupID]); } add_hook('AcceptOrder', 1, 'somePrefix_AcceptOrder'); It triggers when you Accept the order.
  5. 1 point
    I don't think it would be - I guess the logic would be with a direct product, WHMCS knows which product you're talking about; whereas with a bundle, it wouldn't (I assume even if there was only one product in the bundle). I can't think of an obvious simple workaround - though that isn't helped by subdomains not seeming to work in v7.6b1... unless i'm missing something.
  6. 1 point
    it's a language string, so you can modify it using Language Overrides. $_LANG['orderForm']['authCodeTooltip'] = "To initiate a transfer you will need to obtain the authorization code from your current registrar. These can often be referred to as either the epp code or auth code. They act as a password and are unique to the domain name."; possible - but it's going to require a hook to get a list of TLDs that require EPP, and then js/jQuery to determine the TLD from the domain entered, check if it that TLD is in the active EPP list and, if so, react accordingly by hiding/showing the EPP form field. I can give you a starting point of getting the list of EPP TLDs from the database... <?php use Illuminate\Database\Capsule\Manager as Capsule; function hook_epp_tld_list($vars){ if ($vars['templatefile'] == 'domaintransfer') { $eppcode = Capsule::table('tbldomainpricing')->where('eppcode', 1)->pluck('extension'); return array("epptlds" => $eppcode); } } add_hook("ClientAreaPageCart", 1, "hook_epp_tld_list"); if you wanted to output that list, you could just implode the array in the template (you could do it in the hook too, but you'd still need to edit the template to output it wherever you want to). another option might be to use a Language Override to change the placeholder string (or one of the others) to state that a code isn't required for South Africa (or whichever local TLD you're thinking of) $_LANG['orderForm']['authCodePlaceholder'] = "Epp Code / Auth Code";
  7. 1 point
    I have no need for this kind of hook but, I just came to say @brian! you're the best 🙂
  8. 1 point
    I understand what you are saying but I doubt that WHMCS team will do anything for the issues you're describing here. WHMCS is capable of generating invoices but it's not an accounting software. Honestly, in my opinion, they shouldn't focus on this stuff at all. Being European companies doesn't make us special. I mean why should they fix our problems and ignore India, Turkey, China, Brazil, Nigeria etc.? Every single country of the world has it's own crazy rules and requirements about invoicing. I do not want WHMCS team focused on studying the regulations of every country on a yearly basis. Not to mention that even within the same country multiple exceptions exist including special tax regimes. I want them to focus on their stuff (integrating panels, servers, registrars...). Don't get me wrong I understand and share your frustration. Not only I'm in EU but more precisely in Italy. If I ask the same question about invoicing to 10 accountants I'll get 25 different replies 🤨 That said, we can still fix all these issues and adapt WHMCS to our needs with hooks and APIs. I know that it's boring but there are no other options. I'm using WHMCS since 2008 and threads like this don't change anything probably because WHMCS team has the same view I described above. In your last example you described an issue that I managed to fix in a simple* way. Every time an overpayment occurs I issue a new invoice just for the overpayment making sure that the original invoice doesn't change. * Actually it wasn't so simple. I mean yeah in the end it was simple but it took me days of tests
  9. 1 point
    It works for all WHMCS versions from (6.x to 7.x)
  10. 1 point
    Its currently working for us
  11. 1 point
    Welcome to WHMCS.Community Tyler Devine! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.
  12. 1 point
    you shouldn't necessarily need any hooks... if you don't need sidebars, specific variables etc, at the most basic, you can use the code in the thread below... <?php use WHMCS\ClientArea; define('CLIENTAREA', true); require __DIR__ . '/init.php'; $ca = new ClientArea(); $ca->setPageTitle('Current Promotions'); $ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname')); $ca->addToBreadCrumb('kyle.php', 'Current Promotions'); $ca->initPage(); $ca->setTemplate('promotions'); $ca->output(); and then in the promotions.tpl template... {if $loggedin} here are a list of current promotions {else} you need to <a href="login.php">Login</a> to view this page. {/if} or if you want to redirect guests (non logged in users) to the login page... {if !$loggedin} <script type="text/javascript"> window.location.replace("login.php"); </script> {else} here are a list of current promotions {/if} another way, and probably the better method, would be to require login in the php file itself... <?php use WHMCS\ClientArea; define('CLIENTAREA', true); require __DIR__ . '/init.php'; $ca = new ClientArea(); $ca->setPageTitle('Current Promotions'); $ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname')); $ca->addToBreadCrumb('kyle.php', 'Current Promotions'); $ca->requireLogin(); $ca->initPage(); $ca->setTemplate('promotions'); $ca->output(); and then the template no longer needs to check if the user is logged in (though it could for added security if you want to)... once upon a time... a lot of the documentation isn't fit for purpose... it doesn't include all the options available (and with encrypted software, how else are we supposed to know?), and some of the examples are vague/wrong/confusing for new users...
  13. 1 point
    Hello jclarke @ I love this module and I hope that you will work on this soon. Waiting for latest version of this plugin.
  14. 1 point
    I apologize for the delay in not having an update recently to this module, I've been tied up working on some other projects. I am still planning on updating this module soon to work fully with the latest version of WHMCS and PHP 7.x and support for WHM api tokens. The basic functionality does still work with the latest version of WHMCS but I have noticed a few minor issues that need fixed.
  15. 1 point
    When displaying your payment options during the final stages of the checkout process, the available payment gateway options are shown as text – in a number of different ways based upon the order form template being used. If we wanted to make this more attractive, we could replace the text of any or all of the gateways, with an image or logo, by editing the viewcart.tpl template within the active order form template. In order to do this, we can use one of the WHMCS variables that we have access to during the checkout process - $gateway.sysname - the variable stores in lowercase, the unique name used by WHMCS for the payment gateway. This is not the value you entered for the gateway in the “Display Name” field in the “Payment Gateways” section of the Admin Area. The next step is to create or find images for each of the gateways that you wish to replace with a graphic, all in the same graphic format (PNG, JPG or GIF) and save them with a lowercase filename. For example, if you were using PNG format, then your “PayPal” image would be called ‘paypal.png’; your “Bank Transfer” image is called ‘banktransfer.png’; and the “Mail-In Payment” gateway (in the above example, named ‘Cheque’) would be ‘mailin.png’. I believe the filename to be used is based upon the filename of the gateway file in ‘modules/gateways’, but you should be able to find its value by viewing the source of your cart page in your browser... [<label><input type="radio" name="paymentmethod" value="paypal" onclick="hideCCForm()" /> <img src=images/paypal.png /> So the part of interest above is: value=”paypal”. You would then upload these images to your “images” directory within WHMCS. If you wanted to put them in their own folder within the “images” directory, you can – but you will need to adjust the URL in the code below to take account of the slightly different path (see end of tutorial). The images directory i'm using in these examples is whmcs/images - and not the template(s) images folder. The replacement code works by first creating a new variable to store the URL of the gateway logo, then it will check to see if the image exists in the “images” folder (remember that it must have a lowercase filename on the server otherwise it will not be found) – if the image exists, it will display the image; if no image is found, it will display the text (as it does now). In the examples above, I have only uploaded a ‘paypal’ logo and hence only that gateway is using a replacement image – if I were to upload logos for the other two gateways, they would also be used instead of their text names. So, I will now go through each of the eight existing order form templates and show the code to be replaced, the replacement code and an image of how the cart checkout page looks when the new code is added. Ajaxcart Replace.... <div class="cartbox">{foreach key=num item=gateway from=$gateways} <label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} /> {$gateway.name}</label>{/foreach}</div> With... <div class="cartbox">{foreach key=num item=gateway from=$gateways} <label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} /> {assign var="paylogo" value="images/`$gateway.sysname`.png"} {if file_exists($paylogo)} <img src={$paylogo} /> {else} {$gateway.name}{/if}</label> {/foreach}</div> Boxes Replace.... <p align="center">{foreach key=num item=gateway from=$gateways}<label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} />{$gateway.name}</label> {/foreach}</p> With... <p align="center">{foreach key=num item=gateway from=$gateways}<label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} /> {assign var="paylogo" value="images/`$gateway.sysname`.png"} {if file_exists($paylogo)} <img src={$paylogo} /> {else} {$gateway.name}</label> {/foreach}</p> Cart Replace... <p align="center">{foreach key=num item=gateway from=$gateways}<label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} />{$gateway.name}</label> {/foreach}</p> With... <p align="center">{foreach key=num item=gateway from=$gateways}<label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} />{assign var="paylogo" value="images/`$gateway.sysname`.png"} {if file_exists($paylogo)} <img src={$paylogo} /> {else} {$gateway.name}{/if}</label> {/foreach}</p> Comparison Replace... <p class="paymentmethods">{foreach key=num item=gateway from=$gateways}<label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} />{$gateway.name}</label><br />{/foreach}</p> With... <p class="paymentmethods">{foreach key=num item=gateway from=$gateways}<label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} />{assign var="paylogo" value="images/`$gateway.sysname`.png"} {if file_exists($paylogo)} <img src={$paylogo} /> {else} {$gateway.name}{/if}</label><br />{/foreach}</p> Modern Replace... {foreach key=num item=gateway from=$gateways}<label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" id="pgbtn{$num}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} /> {$gateway.name}</label> {/foreach} With... {foreach key=num item=gateway from=$gateways}<label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" id="pgbtn{$num}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} /> {assign var="paylogo" value="images/`$gateway.sysname`.png"} {if file_exists($paylogo)} <img src={$paylogo} /> {else} {$gateway.name}{/if}</label> {/foreach} Slider Replace... {foreach key=num item=gateway from=$gateways}<label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} />{$gateway.name}</label> {/foreach} With... {foreach key=num item=gateway from=$gateways}<label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} />{assign var="paylogo" value="images/`$gateway.sysname`.png"} {if file_exists($paylogo)} <img src={$paylogo} /> {else} {$gateway.name}{/if}</label> {/foreach} Verticalsteps Replace... <p align="center">{foreach key=num item=gateway from=$gateways}<input type="radio" name="paymentmethod" value="{$gateway.sysname}" id="pgbtn{$num}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} /><label for="pgbtn{$num}">{$gateway.name}</label> {/foreach}</p> With... <p align="center">{foreach key=num item=gateway from=$gateways}<input type="radio" name="paymentmethod" value="{$gateway.sysname}" id="pgbtn{$num}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} /><label for="pgbtn{$num}">{assign var="paylogo" value="images/`$gateway.sysname`.png"} {if file_exists($paylogo)} <img src={$paylogo} /> {else} {$gateway.name}{/if}</label> {/foreach}</p> Web20Cart Replace... <div class="cartbox">{foreach key=num item=gateway from=$gateways} <label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} /> {$gateway.name}</label> {/foreach}</div> With... <div class="cartbox">{foreach key=num item=gateway from=$gateways} <label><input type="radio" name="paymentmethod" value="{$gateway.sysname}" onclick="{if $gateway.type eq "CC"}showCCForm(){else}hideCCForm(){/if}"{if $selectedgateway eq $gateway.sysname} checked{/if} /> {assign var="paylogo" value="images/`$gateway.sysname`.png"} {if file_exists($paylogo)} <img src={$paylogo} /> {else} {$gateway.name}{/if}</label> {/foreach}</div> Customised Order Form Templates If you are using a customised order form, perhaps supplied with a purchased WHMCS theme, this solution may still work with your template - in viewcart.tpl, you simply replace... {$gateway.name} With... {assign var="paylogo" value="images/`$gateway.sysname`.png"} {if file_exists($paylogo)} <img src={$paylogo} /> {else} {$gateway.name}{/if} In these examples, I have used .PNG images - if you wanted to use .JPG or .GIF instead, then you would replace .png in the code with .jpg or .gif - remember, they must all use the same format! if you wanted to put the gateway images in their own folder, e.g 'paylogos', then you would replace the code... {assign var="paylogo" value="images/`$gateway.sysname`.png"} with... {assign var="paylogo" value="images/paylogos/`$gateway.sysname`.png"} I hope this helps anyone who wants to replace their payment gateways text with images. I should also add that this is tested and working on the latest WHMCS release as of this tutorial - v5.3.3
  16. 1 point
    I can, and they should all be back now - but remember these orderforms are no longer used with the recent releases of WHMCS. you can do the same thing using a hook without the need to edit a template... <?php # Cart Gateway Logos Hook # Written by brian! function hook_cart_gateway_logos($vars) { if ($vars['templatefile'] == 'viewcart') { $gateways = $vars['gateways']; foreach($gateways as $key => $gateway) { $logo = "assets/img/logos/".$key.".png"; if(file_exists($logo)) { $gateways[$key]['name'] = '<img src="'.$logo.'" alt="'.$gateway['name'].'">'; } } return array("gateways" => $gateways); } } add_hook('ClientAreaPageCart', 1, 'hook_cart_gateway_logos'); ?> the hook assumes three things about the logo images... that they are in .png format. the filesnames are the same as the sysname value of the gateway (in lowercase). that they are uploaded to /assets/img/logos/ you could easily alter the hook to use .jpg (or check for both) images, or to change their location. if the logo image exists, it will use that logo - for gateways where no logo exists, the text name will be displayed.
  17. 1 point
    Hi there, We have received a few reports of this error in the past week. Nothing has changed in our code at that time, and I'm not aware of planned changes to eNom's API which could cause this. I suspect this might be related to some of the changes eNom have been making to their system, so I have reached out to our contact for clarification.
  18. 1 point
    Summary: Twitter have made some changes to their API this week which impacts our WHMCS Sign-In Integrations. More information on the changes Twitter have made are outlined on their community. In essence, we can no-longer override the Callback URL used by the Twitter App. Instead the Callback URLs settings on the Twitter Developer site now act more like a whitelist. The Callback URL sent by WHMCS must match exactly with the Callback URL specified in the app settings, or the login will fail. Error presents as: In WHMCS this manifests itself as an error when attempting to login with Twitter: Or when activating Twitter sign-in for the first time in the admin area: Resolution: Because the Callback URL can take several forms, depending upon the Friendly URLs setting, we are recommending users configure all three in their Twitter app settings. Visit https://apps.twitter.com/ If not logged in, login to your Twitter account Select your WHMCS sign-in app from the list Click the Settings tab In the Callback URLs section, replace the current single entry with the following three entries: http://demo.whmcs.com/whmcs/index.php?rp=/auth/provider/twitter_oauth/callback http://demo.whmcs.com/whmcs/index.php/auth/provider/twitter_oauth/callback http:///demo.whmcs.com/whmcs/auth/provider/twitter_oauth/callback Remember to replace http://demo.whmcs.com/whmcs/ with the actual URL of your WHMCS installation Click Save Changes More Information can be found at http://help.whmcs.com/m/troubleshooting/l/914546-troubleshooting-an-invalid-details-not-saved-error-when-configuring-twitter-sign-in-integrations
  19. 1 point
    Thank you! I have updated the registrar using the SQL query following: UPDATE tbldomains SET registrar = 'registrarB' WHERE registrar = 'registrarA';
  20. 1 point
    I'm optimizing my site for SEO and I'm having a problem figuring out how to change the 302 redirects to 301 redirects. Although I've got most of the whmcs pages tagged as noindex, the knowledgeable pages are still indexed and read by the search engines. How can I change the pages from 302 to 301 redirects to keep from being penalized?
×

Important Information

By using this site, you agree to our Terms of Use & Guidelines