Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 11/11/2019 in all areas

  1. 1 point
    the customfields already have a class assigned to them, so you're really replacing what's already there by changing the class. a bad example as that isn't a customfield, but I get the gist - for something like this, you have at least 3 options... edit the clientregister.tpl template and use a Smarty replace... {if $customfield.id eq 42}{$customfield.input|replace:'class="form-control"':'class="form-control2" placeholder="place holder"'}{else}{$customfield.input}{/if} so in this example for CF42, I am changing the CSS class and adding a placeholder - for other customfields, it does nothing... though you can have multiple if statements, in_arrays etc to cover whatever conditions/changes that you need to do. use a ClientAreaPageRegister hook, loop through the $customfields array (these input fields are just html strings) and use multiple replaces on the input fields and then return the updated array back to the template. use jQuery in a ClientAreaFooterOutput hook to change the class and add the placeholder to each CF field you want to change.
  2. 1 point
    my thought was you could update the field with a date when run, that way you can just reference the appropriate date in MM and should remove the need to empty the fields after use. oh gawd - a two-tier feature request system! 😲 another avenue for hook/API issues might be to raise it on the WHMCS GitHub site... my suspicions is that would be a faster path than than a "normal" FR, but probably not a suitable one for the above FR... but if you thought there was an issue with an existing hook/API, then the GH site could be a better option. the tragedy of the FR system is that if many of those suggestions had been asked here first instead, there would have been simple solutions posted... instead their suggestions are gathering dust in the shed at the bottom of the garden that is the FR site.
  3. 1 point
    Glad to hear its working for you now @Unity Capitalism
  4. 1 point
    This one should work. <?php use Illuminate\Database\Capsule\Manager as Capsule; add_hook('InvoiceCreation', 1, function($vars) { $Data = Capsule::select(Capsule::raw('SELECT t1.total, t2.credit FROM tblinvoices AS t1 LEFT JOIN tblclients AS t2 ON t1.userid = t2.id WHERE t1.id = "' . $vars['invoiceid'] . '" LIMIT 1')); $CreditBalance = $Data[0]->credit; $TotalDue = $Data[0]->total; // Apply Credit only if Credit Balance is greater than zero if ($CreditBalance) { $postData = array( 'invoiceid' => $vars['invoiceid'], 'amount' => ($CreditBalance < $TotalDue ? $CreditBalance : $TotalDue) // If Credit Balance is less than Total Due there will be a partial payment ); $results = localAPI('ApplyCredit', $postData, $adminUsername); } });
  5. 1 point
    Hi, Need more details but you can untick Require Domain (Setup > Products/Services > Products/Services > Your hosting package > Edit > Details tab > Require Domain).
  6. 1 point
    No, the issue hasn't been fixed. The problem reversed actually. In the past sometimes discount coupons were being deducted twice from the price, now they are not being deducted at all. I really don't understand why WHMCS was not able to fix the issue. This is just calculation via scripting, not some complex algorithm.
  7. 1 point
    Hey @Unity Capitalism Thanks for your post I've tested this and its working for me as per the image below have you tried clearing your cookies and cache?
  8. 1 point
    Hello @bizon06 Thank you for your post, your Sales Operators & Support users would use the same admin area URL that you use, Support Agents, Sales Operators & Administrators all use the same Admin Panel
  9. 1 point
    you should be able to use the UpgradeProduct API for that... https://developers.whmcs.com/api-reference/upgradeproduct/
  10. 1 point
    have you priced your products in all 3 currencies?
  11. 1 point
    Hi Peter, purely from settings, it's not automated - a client can upgrade manually, or an admin can manually upgrade them. it would be possible to use hooks to auto upgrade the product, but off-hand, i'm not aware of an existing solution that has been published. there's a third-party commercial addon called "Product Auto Upgrade" in Marketplace that possibly does what you need.
  12. 1 point
    no worries - all I did was quickly take the example AdminHomepage hook from the docs, copied the <div> from the badges.php widget and tweaked the output a little (removed icons, classes and added some inline CSS)... 🙂 <?php add_hook('AdminHomepage', 1, function($vars) { return '<div class="row home-status-badge-row"> <div class="col-sm-6"> <div class="health-status-block status-badge-cyan clearfix"> <div style="color:black; font-size: 20px; text-align: center;"> Mission: Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> </div> </div> <div class="col-sm-6"> <div class="health-status-block status-badge-cyan clearfix"> <div style="color:black; font-size: 20px; text-align: center;"> Vision: Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> </div> </div>'; }); I think I have more belief in you being able to write this type of hook than you do yourself. 😎
  13. 1 point
    @Cubeboy in V7.8.x the "Credit Card Information" has been replaced by Pay Methods, are you using a custom admin theme? Your Client area theme will also need updating to support Pay Methods, you'll find a copy of the changes made to the Six and Standard Cart Templates in our release notes https://docs.whmcs.com/Version_7.8.0_Release_Notes#Template_Changes which should help you
  14. 1 point
    @Believe_ and @MikeP, here's an updated version - please note that this currently doesn't work very well if a client has a Group Discount. <?php use WHMCS\Database\Capsule; add_hook('PreModuleTerminate', 1, function($vars) { $invoices = Capsule::table('tblinvoiceitems') ->where('relid', $vars['params']['serviceid']) ->where('type', '!=', 'GroupDiscount') ->get(); logActivity('Auto Cancel Invoice: Starting...'); foreach($invoices as $key){ $invoiceIDs = Capsule::table('tblinvoices') ->where('id', $key->invoiceid) ->where('status', 'Unpaid') ->value('id'); $invoiceLine = Capsule::table('tblinvoiceitems') ->where('invoiceid', $invoiceIDs) ->where('relid', $vars['params']['serviceid']) ->value('id'); $invoiceLines = Capsule::table('tblinvoiceitems') ->where('invoiceid', $invoiceIDs) ->get(); $description = Capsule::table('tblinvoiceitems') ->where('relid', $vars['params']['serviceid']) ->where('invoiceid', $invoiceIDs) ->value('description'); $discountLine = Capsule::table('tblinvoiceitems') ->where('invoiceid', $invoiceIDs) ->where('type', 'GroupDiscount') ->where('description', 'like', '% '.$description.'%') ->value('id'); if($invoiceIDs){ logActivity('Auto Cancel Invoice: Invoice ' . $invoiceIDs . ' has had a line removed. This invoice previously had ' . count($invoiceLines) . ' lines.'); if(count($invoiceLines) > 1){ $command = 'UpdateInvoice'; $postData = array( 'invoiceid' => $invoiceIDs, 'deletelineids' => array($invoiceLine), ); $results = localAPI($command, $postData); }elseif(count($invoiceLines) == 1){ logActivity('Auto Cancel Invoice: Invoice ' . $invoiceIDs . ' has been cancelled because the product was terminated.'); $command = 'UpdateInvoice'; $postData = array( 'invoiceid' => $invoiceIDs, 'status' => 'Cancelled', ); $results = localAPI($command, $postData); } if($discountLine){ logActivity('Auto Cancel Invoice: Invoice ' . $invoiceIDs . ' had a Group Discount. This has been removed.'); $command = 'UpdateInvoice'; $postData = array( 'invoiceid' => $invoiceIDs, 'deletelineids' => array($discountLine), ); $results = localAPI($command, $postData); } } } }); It will remove the product from the invoice (as split is not possible using the API, and WHMCS does just remove lines from invoices any way) if the invoice has more than 1 line. If it only has 1 line, the invoice will be cancelled. But please note that this doesn't work with Client Group Discounts at all. There's no way for me to know for certain if a 'discount' line is associated with another line. If you use this hook with Client Group Discounts enabled, be aware that an invoice can have a negative total. Does anyone have any ideas of a way to "link" a discount line with the relevant product line? The only way I could think of is to copy the line for the product, and match on %PRODUCT-LINE%, but we could potentially target an incorrect discount line. Do you know any smarter way, @brian!? Edit: I added very simple logic to check if the product has a line for GroupDiscount. Please test this thoroughly before using it. I've only tested it on my dev installation, and everything seems fine from there.
  15. 1 point
    Hasta donde tengo entendido, tú puedes crear tus propias traducciones. Lo que hice fue basarme en los modelos en inglés y las personalicé a mi gusto. No cabe duda que en español tenemos algunas prácticas de escritura muy distintas a las del inglés, así que la mejor opción para mí es hacerlas a mano. Es un poco de trabajo, pero pocas veces las tocas de nuevo.
  16. 1 point
    there will be at least two short-term ways to do it... edit the code in the above template. edit scripts.min.js (where there URL is defined). method 2 implies that you should be able to do it via a hook (which would be a better long-term solution), but i've not been able to get it working yet... besides, now that v7.7.1 is released, I suspect there won't be any more updates, apart from hotfixes, until May 2019 and so no harm in editing the template or js files. so if you want to edit the template... {if $service.sslStatus} {if $service.sslStatus->getClass() eq "ssl-state ssl-inactive"}<a href="cart.php?gid=11">{/if}<img src="{$service.sslStatus->getImagePath()}" data-toggle="tooltip" title="{$service.sslStatus->getTooltipContent()}" />{if $service.sslStatus->getClass() eq "ssl-state ssl-inactive"}</a>{/if} {elseif !$service.isActive} <img src="{$BASE_PATH_IMG}/ssl/ssl-inactive-domain.png" data-toggle="tooltip" title="{lang key='sslState.sslInactiveService'}"> {/if} alternatively, in scripts.js (not used by WHMCS), you can change... jQuery(document).on('click', '.ssl-state.ssl-inactive', function(e) { e.preventDefault(); window.location.href = WHMCS.utils.getRouteUrl('/ssl-purchase'); }); to... jQuery(document).on('click', '.ssl-state.ssl-inactive', function(e) { e.preventDefault(); var gidvalue="11"; window.location.href = "cart.php?gid=" + gidvalue; }); minify/compress it and save it as /templates/six/js/scripts.min.js - or if you're familiar with the minified files, you could edit scripts.min.js directly... either method should work, there is no need to do both! it's probably easier to use the template edit, but I posted the js solution because it was the first one that I wrote for this and it seems a shame to let it go to waste if others want to use or improve upon it (e.g the basis of a hook).
×

Important Information

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