Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


brian! last won the day on September 15

brian! had the most liked content!

Community Reputation

1,620 Excellent

About brian!

  • Rank
    WHMCS GearHead

Recent Profile Visitors

19,552 profile views
  1. if i'm doing any serious Smarty work in the email templates, it's often easier to edit the appropriate record in tblemailtemplates directly as that avoids WHMCS doing anything strange to the output - e.g converting < to &lt;
  2. brian!

    Info from feeds being shown beneath all HTML

    as the OP reported in the thread, I think it can use feeds without issue - you just need to tweak the carousel settings. you could use an action hook to get the current details from the database - it's not a million miles away from the one in the above thread, except it's finding products and not domains... <?php use Illuminate\Database\Capsule\Manager as Capsule; function homepage_products_hook($vars) { $products = Capsule::table('tblproducts') ->join('tblpricing', 'tblproducts.id', '=', 'tblpricing.relid') ->where('tblpricing.type', 'product') ->where('tblproducts.hidden','0') ->where('tblproducts.gid','1') ->select('tblproducts.id','tblproducts.name','tblproducts.description','tblpricing.monthly') ->orderBy('tblproducts.order') ->groupBy('tblproducts.id') ->get(); $results = json_decode(json_encode($products), true); return array("myproducts" => $results); } add_hook("ClientAreaPageHome", 1, "homepage_products_hook"); ?> that will give you an array of products ($myproducts) on the homepage that are: in Product Group 1 and not hidden and the array will contain 4 fields - Product ID, Product Name, Product Description, Monthly Price... as per the domain hook, instead of just taking all products from a certain product group, you could give it a list of Product IDs and use that instead. with that array, you could then generate your carousel output in a foreach loop, or access each field individually... e.g the first result elements could be directly accessed using the following for name, desc and price... {$myproducts[0].name} {$myproducts[0].description} {$myproducts[0].monthly} .. and for the second result, you would change the 0 to 1 and so on. also, the monthly price won't be currency formatted - you could do that in the hook if you wanted to, but as I assume you're only using one currency, you might as well just add a pound sign before the price. Just £{$myproducts[0].monthly} per month
  3. {if $loggedin && !$inShoppingCart} <button type="button" class="line-default" data-dismiss="modal">{$LANG.secure_pin}</button> {/if}
  4. brian!

    preventing new accounts?

    i'm going to assume that you don't want potential new customers to make any orders at all - not just for domains.. first step, disable register.php from the admin settings -> setup > general settings -> other -> allow client registration second step, perhaps use the hook below to redirect visitors from the cart and/or register, who are not logged in, to clientarea.php (or any other page)... <?php # Redirect Cart/Register Visitors Hook # Written by brian! function redirect_cart_vistors($vars) { $client = Menu::context("client"); if (!$client){ header("Location: clientarea.php"); exit; } } add_hook("ClientAreaPageCart", 1, "redirect_cart_vistors"); add_hook("ClientAreaPageRegister", 1, "redirect_cart_vistors"); ?> possible third step, modify the navbar links to the store depending on if the client is logged in or not... optional fourth step, modify using Language Overrides, the string shown on register.tpl when registration is disabled. but if you're using the above hook, they should never see this page anyway. and then test your site thoroughly to see if there is any obvious way to get to the cart/registration pages.
  5. you didn't give it an alternative color to use - so it left things as they are... if you were to assign individual colors to elements of the sidebar, that would work... .panel-sidebar > .panel-heading {background-color:#FF69B4;} .panel-sidebar .list-group-item {background-color:#FFB6C1;} you'd also have to take care of active/focus etc if you want the colors to remain the same when the cursor interacts with the sidebar.
  6. a better example hook might be the hhread below - i'm going to assume that this is for a client area page and that the client is already logged in. <?php # Product/Service List Hook # Written by brian! use Illuminate\Database\Capsule\Manager as Capsule; function products_list_hook($vars) { $client = Menu::context('client'); $services = Capsule::table('tblhosting') ->join('tblproducts','tblhosting.packageid','=','tblproducts.id') ->where('userid',$client->id) ->select('tblhosting.*','tblproducts.name as product') ->orderby('nextduedate','desc') ->get(); $results = json_decode(json_encode($services), true); return array("myservices" => $results); } add_hook("ClientAreaPage", 1, "products_list_hook"); ?> a clients product/services are stored in the tblhosting table - that will give you the majority of the information you want... however, it wouldn't give you the Product Name of the service, and so for that we need to check the tblproducts table - that is basically all the above hook is doing... it's creating that list and then passing it back to the template as an array. and then in the template, you would output that array - that could be using a foreach loop, using DataTables (as I did in the example above), in a HomePagePanel etc.
  7. brian!

    Customize Markdown Editor (not using CSS)

    have you tried opening a ticket with Support about this? this may be another situation, like TinyMCE, where something fundamental is in an encoded file somewhere. I can see in the js code in scripts.min.js (both admin and client) that the markdown header is set to add a toolbar - but even if you a) remove it from there, and b) add it to the markdown footer - nothing happens. that immediately implies to me (unless i'm missing something obvious), that the markdown settings could be being initially set in an encoded file. if so, I would do one of two things (or both!)... i'd open a ticket with Support (unless one of the devs see this thread and reply to it) and see whether what you want to do is possible... or i'd go direct to the developer of the Markdown editor used in WHMCS (Michel Fortin) and see if it can be done.. but as I said, if a setting is in an encoded file, to do what you want might not be possible.
  8. the only two gateway fee addons that I can think of that allow for an invoice minimum before applying the fee are... Payment Gateway Charges For WHMCS Service Fees that said, charging EU clients a fee for using a card would probably be illegal under EU law - but as you're US-based, that might not really matter for your situation.
  9. brian!

    Adding custom field value to Product Name

    three points with this... just because Support say 'there's no way to do this', never assume that they're correct - often it's true, but not always... and I speak from personal experience as many years ago, after being told by Support that something couldn't be done, I solved it myself in about 30 minutes... to be fair, depending upon what exactly you asked them, i'd be inclined to think that modifying the services page (as you envisage) using a hook wouldn't be possible.... though i'd stand by that either modifying the client summary tables would be possible, as would updating the database directly to change the product name. be aware that feature requests, however trivial you may think them to be, will take years before being completed by WHMCS - that's just a fact. if you submit a feature request, it might be useful to add a link to the request in this thread in case anyone reads this thread in the future... otherwise, it might not be easy to find!
  10. brian!

    Show just price and nothing else

    HI Sam, if you wanted to show multiple cycle prices for the same product, you'd either have to take the raw price for the billing cycle (2.49) and add currency prefix and/or suffix to it... {$currency.prefix}{$product.pricing.rawpricing.monthly}{$currency.suffix} e.g the above would show £2.49 GBP... take out the suffix code and it would show £2.49 - same would apply for annual prices and the other billing cycles too... {$currency.prefix}{$product.pricing.rawpricing.annually}{$currency.suffix} if the value of $product.pricing.rawpricing.monthly (or any other cycles) equals -1, then the product isn't priced for that billing cycle. ... or the other way is to take your full text price and strip it after the first space.. {$product.pricing.cycles.monthly} for you, the above code would show £2.49 GBP Monthly (Free Domain)... {$product.pricing.cycles.monthly|strstr:' ':true} and this would show just £2.49 with no additional text. a third way, if you're doing some form of showing multiple prices of a product (list, dropdown etc) would be to loop through the $product.pricing.cycles or $product.pricing.rawpricing arrays and output the prices like that... I did something similar for the Pure Comparison template in a previous post... the code wouldn't be exactly the same, but it wouldn't be a million miles away. note the $product.pricing.cycles array will contain ONLY those cycles for which the product is priced - whereas the rawpricing array contains prices and fees for all cycles whether priced or not.
  11. brian!

    Info from feeds being shown beneath all HTML

    I think it's the Owl Carousel script - I answered a similar question earlier in the year... you might need to re-issue the license for the removal to become active. also, in your header, the BASE CSS and custom.css links are called twice - doesn't really matter, but thought it worth mentioning...
  12. brian!

    Show just price and nothing else

    in the products.tpl template, you should be able to use any of the following (inside the foreach loop) to show £1.99 GBP... {$product.pricing.minprice.price} {$product.pricing.minprice.simple} the minprice will be the smallest billing cycle (e.g monthly, quarterly, semi, annual etc in that order) - not necessarily the cheapest price.
  13. brian!

    Changing Size of Logo

    you can use different sized logos for each - the email logo is specified in the general settings; website/invoice pdf will use logo.png/jpg by default, but you can change web logo by editing the template or using a hook, and the pdf template can be modified to use a different sized logo too.
  14. be aware that feature requests will take years to be implemented - i'm not joking! you might want to post a link to the request for others who read this thread in the future - because I just did a quick search for it and I couldn't see it! 🕶️
  15. brian!

    Pro Rated Billing

    @Ambarella - if it helps, I explained how to expand the pro-rata output in the thread below... I wouldn't suggest using the ordersummary.tpl template attached to the post (as it might be out of date now), but you should be able to tweak your current template using the code pasted in there... and expand the output further if required.

Important Information

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