Ragonz Posted November 19, 2016 Share Posted November 19, 2016 See image, how would you go about removing the - $0.00? https://www.dropbox.com/s/fsccjr4vfjdlxvs/Screenshot%202016-11-19%2021.50.25.png?dl=0 0 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted November 19, 2016 Share Posted November 19, 2016 Hello Ragonz, Under Setup -> Products/Services -> Products/Services -> YOUR SERVICE -> Pricing untick the enable box under Quarterly or set the price on this pricing level then save 0 Quote Link to comment Share on other sites More sharing options...
Ragonz Posted November 21, 2016 Author Share Posted November 21, 2016 Hello Ragonz, Under Setup -> Products/Services -> Products/Services -> YOUR SERVICE -> Pricing untick the enable box under Quarterly or set the price on this pricing level then save Unfortunately its not that simple as the billing frequency box is required, the price comes from configurable options. I dont want to know how to remove the options entirely, just to remove the $0.00 from the end. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 21, 2016 Share Posted November 21, 2016 that x% discount in the billing cycle text is not the usual WHMCS format, so I assume there is an addon modifying the output - and after looking at your website, this only seems to occur on your TeamSpeak3 product, therefore I would imagine the Smarty variable is being modified by that addon... first thought would be to contact the developers and see if it can be tweaked by them. assuming they can't, you should be able to do it yourself by editing the standard_cart/configureproduct.tpl template... there'd be a few ways to do it in Smarty, but one simple way would be to just remove the final 11 characters from the output - e.g by changing.... {if $pricing.quarterly} <option value="quarterly"{if $billingcycle eq "quarterly"} selected{/if}> {$pricing.quarterly} </option> {/if} with... {if $pricing.quarterly} <option value="quarterly"{if $billingcycle eq "quarterly"} selected{/if}> {if $productinfo.pid eq '87'}{$pricing.quarterly|substr:0:-11}{else}{$pricing.quarterly}{/if} </option> {/if} that should get rid of " - £0.00GBP" and do the same for Euro and USD pricing too... then do the same with the semiannually and annually billing cycles {if} blocks of code. 0 Quote Link to comment Share on other sites More sharing options...
Ragonz Posted December 12, 2016 Author Share Posted December 12, 2016 The issue occurs with all products not just TS3, where would I find standard_cart/configureproduct.tpl as I cant see it within our template files. The module we are using doesn't touch the ordering side it only connects WHMCS to TCAdmin (As far as I am aware) - - - Updated - - - nevermind about finding it now, have located it, issue occurs with all products though so would {if $pricing.quarterly} <option value="quarterly"{if $billingcycle eq "quarterly"} selected{/if}> {if $productinfo.pid eq '*'}{$pricing.quarterly|substr:0:-11}{else}{$pricing.quarterly}{/if} </option> {/if} work? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 4, 2017 Share Posted January 4, 2017 if it's occuring with all products, then you shouldn't need the {if}{/if} parts of the code... {if $pricing.quarterly} <option value="quarterly"{if $billingcycle eq "quarterly"} selected{/if}> {$pricing.quarterly|substr:0:-11} </option> {/if} 0 Quote Link to comment Share on other sites More sharing options...
Ragonz Posted March 2, 2021 Author Share Posted March 2, 2021 This change seems to have stopped working since version 8, it now displays How do I go about making sure the biling cycle just displays 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 2, 2021 Share Posted March 2, 2021 40 minutes ago, Ragonz said: How do I go about making sure the billing cycle just displays two simple options... either edit the template and replace the output for each cycle with it's language string equivalent, e.g {if $pricing.monthly} <option value="monthly"{if $billingcycle eq "monthly"} selected{/if}> {$pricing.monthly} </option> {/if} becomes... {if $pricing.monthly} <option value="monthly"{if $billingcycle eq "monthly"} selected{/if}> {$LANG.orderpaymenttermmonthly} </option> {/if} and then repeat for the other billing cycles... or you use an action hook to modify those values in a similar way and remove the need to edit the template... <?php # Remove Pricing From Cart BillingCycles Hook # Written by brian! use WHMCS\Config\Setting; function cart_remove_prices_in_billingcycles_hook($vars) { $pricebreak = Setting::getValue('ProductMonthlyPricingBreakdown'); if ($vars['templatefile'] == 'configureproduct' && empty($pricebreak)) { $pricing = $vars['pricing']; $cyclesarray = array('monthly','quarterly','semiannually','annually','biennially','triennially'); foreach ($cyclesarray as $cycle) { if ($pricing[$cycle]) { $langstring = 'orderpaymentterm'.$cycle; $pricing[$cycle] = Lang::trans($langstring); } } return array("pricing" => $pricing); } } add_hook("ClientAreaPageCart", 1, "cart_remove_prices_in_billingcycles_hook"); the above hook first checks to see if Monthly Pricing Breakdown in enabled in the settings, and if not, then it will modify the available cycle values... if you want to make the change regardless of MPB setting, then you can just remove that condition from the code. 0 Quote Link to comment Share on other sites More sharing options...
Ragonz Posted March 2, 2021 Author Share Posted March 2, 2021 excellent as always Brian, thank you 0 Quote Link to comment Share on other sites More sharing options...
tangogc Posted March 4, 2021 Share Posted March 4, 2021 On 3/2/2021 at 2:47 PM, brian! said: two simple options... either edit the template and replace the output for each cycle with it's language string equivalent, e.g {if $pricing.monthly} <option value="monthly"{if $billingcycle eq "monthly"} selected{/if}> {$pricing.monthly} </option> {/if} becomes... {if $pricing.monthly} <option value="monthly"{if $billingcycle eq "monthly"} selected{/if}> {$LANG.orderpaymenttermmonthly} </option> {/if} and then repeat for the other billing cycles... or you use an action hook to modify those values in a similar way and remove the need to edit the template... <?php # Remove Pricing From Cart BillingCycles Hook # Written by brian! use WHMCS\Config\Setting; function cart_remove_prices_in_billingcycles_hook($vars) { $pricebreak = Setting::getValue('ProductMonthlyPricingBreakdown'); if ($vars['templatefile'] == 'configureproduct' && empty($pricebreak)) { $pricing = $vars['pricing']; $cyclesarray = array('monthly','quarterly','semiannually','annually','biennially','triennially'); foreach ($cyclesarray as $cycle) { if ($pricing[$cycle]) { $langstring = 'orderpaymentterm'.$cycle; $pricing[$cycle] = Lang::trans($langstring); } } return array("pricing" => $pricing); } } add_hook("ClientAreaPageCart", 1, "cart_remove_prices_in_billingcycles_hook"); the above hook first checks to see if Monthly Pricing Breakdown in enabled in the settings, and if not, then it will modify the available cycle values... if you want to make the change regardless of MPB setting, then you can just remove that condition from the code. this hook not work form me on 8.1.3 @Brian guru where is the problem ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 4, 2021 Share Posted March 4, 2021 2 hours ago, tangogc said: this hook not work form me on 8.1.3 @Brian guru where is the problem ? because I think your site has Monthly Pricing Breakdown enabled and so the hook ignores those cycles... as I explained would happen at the end of the last post. 🙂 to make it work regardless of the MPB setting, you could just change that first if statement to... if ($vars['templatefile'] == 'configureproduct') { 0 Quote Link to comment Share on other sites More sharing options...
tangogc Posted March 4, 2021 Share Posted March 4, 2021 thanks Brian as usual, but not work too. and also are we sure that remove only the 0.00 price ? and not also where the mounthly prices are defined ? <?php # Remove Pricing From Cart BillingCycles Hook # Written by brian! use WHMCS\Config\Setting; function cart_remove_prices_in_billingcycles_hook($vars) { $pricebreak = Setting::getValue('ProductMonthlyPricingBreakdown'); if ($vars['templatefile'] == 'configureproduct') { $pricing = $vars['pricing']; $cyclesarray = array('monthly','quarterly','semiannually','annually','biennially','triennially'); foreach ($cyclesarray as $cycle) { if ($pricing[$cycle]) { $langstring = 'orderpaymentterm'.$cycle; $pricing[$cycle] = Lang::trans($langstring); } } return array("pricing" => $pricing); } } add_hook("ClientAreaPageCart", 1, "cart_remove_prices_in_billingcycles_hook"); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 4, 2021 Share Posted March 4, 2021 16 minutes ago, tangogc said: thanks Brian as usual, but not work too. I assume you are uploading it to the existing /includes/hooks folder, and within it's own .php file ? 18 minutes ago, tangogc said: and also are we sure that remove only the 0.00 price ? it's replacing the entire content of each dropdown option with it's language string equivalent.... 20 minutes ago, tangogc said: and not also where the monthly prices are defined ? no the dropdown is just a label that passes the cycle value. 0 Quote Link to comment Share on other sites More sharing options...
tangogc Posted March 4, 2021 Share Posted March 4, 2021 yes Brian I confirm in the right pleace somethings in the code is wrong I have attached the hook removemonth.php 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 5, 2021 Share Posted March 5, 2021 16 hours ago, tangogc said: somethings in the code is wrong I have attached the hook the hook code is working fine - I tested it before posting and if I upload your attached hook to my hooks folder (and disable mine), then it works without issue - only differences I can see are the filesize and possibly the encoding of the file. if you can't get the hook to work, then you can do this in the template manually... {if $pricing.monthly} <option value="monthly"{if $billingcycle eq "monthly"} selected{/if}> {$pricing.monthly} </option> {/if} becomes... {if $pricing.monthly} <option value="monthly"{if $billingcycle eq "monthly"} selected{/if}> {$LANG.orderpaymenttermmonthly} </option> {/if} and then repeat for the other cycles. 0 Quote Link to comment Share on other sites More sharing options...
tangogc Posted March 6, 2021 Share Posted March 6, 2021 yes I know but this will be replaced in the next update. There is anyway to debook the hook and understand why not work ?= 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 7, 2021 Share Posted March 7, 2021 16 hours ago, tangogc said: There is anyway to debug the hook and understand why not work ?= there is nothing wrong with the hook - the issue will be that you have other conflicting cart changes occurring... I can see from the site that there are other modifications occurring in the output - they might be template changes, other hooks or even ModuleGarden's Discount Center addon - any of which could be interfering with the hook (e.g running after the hook and undoing the changes). 0 Quote Link to comment Share on other sites More sharing options...
tangogc Posted March 7, 2021 Share Posted March 7, 2021 yes you right "as usual" Discount center" break the hook. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 7, 2021 Share Posted March 7, 2021 55 minutes ago, tangogc said: yes you right "as usual" Discount center" break the hook. you could try changing the hook priority so that perhaps the hook should run after the MG addon... add_hook("ClientAreaPageCart", 100, "cart_remove_prices_in_billingcycles_hook"); ... but i'm not sure if that will have any affect as I don't have the MG addon locally to test. 0 Quote Link to comment Share on other sites More sharing options...
tangogc Posted March 7, 2021 Share Posted March 7, 2021 thans Brian as someone alredy said I will have to offer you a virtual coffy 🙂 No replacing the hook priority not solve the problem, only disabling the module it work again. if you are interested to test all MG extension can be download for a free 7 days testing but need to complete the registration process. Thanks 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.