brandonfire Posted July 16, 2016 Share Posted July 16, 2016 How do I set the order configuration page to default to annual billing? I changed the order of the items in the list, but it still defaults to monthly billing. Please see screenshot. Thanks, Brandon Here is the code I changed to change the order, but it still defaults to monthly: {if $pricing.type eq "recurring"} <div class="field-container"> <div class="form-group"> <label for="inputBillingcycle">{$LANG.cartchoosecycle}</label> <select name="billingcycle" id="inputBillingcycle" class="form-control select-inline" onchange="{if $configurableoptions}updateConfigurableOptions({$i}, this.value);{else}recalctotals();{/if}"> {if $pricing.annually} <option value="annually"{if $billingcycle eq "annually"} selected{/if}> {$pricing.annually} </option> {/if} {if $pricing.monthly} <option value="monthly"{if $billingcycle eq "monthly"} selected{/if}> {$pricing.monthly} </option> {/if} {if $pricing.quarterly} <option value="quarterly"{if $billingcycle eq "quarterly"} selected{/if}> {$pricing.quarterly} </option> {/if} {if $pricing.semiannually} <option value="semiannually"{if $billingcycle eq "semiannually"} selected{/if}> {$pricing.semiannually} </option> {/if} {if $pricing.biennially} <option value="biennially"{if $billingcycle eq "biennially"} selected{/if}> {$pricing.biennially} </option> {/if} {if $pricing.triennially} <option value="triennially"{if $billingcycle eq "triennially"} selected{/if}> {$pricing.triennially} </option> {/if} </select> </div> </div> {/if} 0 Quote Link to comment Share on other sites More sharing options...
brandonfire Posted July 16, 2016 Author Share Posted July 16, 2016 Screenshot here: https://www.dropbox.com/s/freftdvt3s5isho/Screenshot%202016-07-16%2015.45.43.png?dl=0 And I'm using the Six theme template. Thanks for your help!! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 16, 2016 Share Posted July 16, 2016 the problem you have is that I think {$billingcycle} is always set to be the lowest cycle for which there is a price - and so changing the order of the {if} statements wouldn't have any effect on that. there are a number of ways to do what you want to achieve - including passing the cycle in the URL if you are linking directly to it. but if you want to edit the template to do it, just add the following code towards the top(after the include) of configureproduct.tpl... {if $pricing.annually}{assign 'billingcycle' 'annually'}{/if} if you do that, then it will default to annually if there is an annual price for the product; if there isn't, it won't change $billingcycle and it will continue to use the lowest cycle. 0 Quote Link to comment Share on other sites More sharing options...
brandonfire Posted July 16, 2016 Author Share Posted July 16, 2016 That's the golden ticket!!! Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Anders Posted October 23, 2016 Share Posted October 23, 2016 Wow Brian you are the best i am using six theme with pure_comparison, in the cart its showing monthly price as default. is iit possible to show the Annual monthly breakdown price as default? if yes could you show me. warm regards Birken 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 23, 2016 Share Posted October 23, 2016 you could modify pure_comparison/products.tpl and change... {$product.pricing.minprice.cycleText} to... {if $product.pricing.annually}<span>{$currency.prefix}{($product.pricing.rawpricing.annually/12)|string_format:"%.2f"}{$currency.suffix}</span>/mo{else}{$product.pricing.minprice.cycleText}{/if} if a product has an annual price, the above code should show it's monthly breakdown price (e.g annual price divided by 12) instead; if the product isn't priced annually, then WHMCS will output as normal. 0 Quote Link to comment Share on other sites More sharing options...
Anders Posted October 23, 2016 Share Posted October 23, 2016 oh my god that is fantastic fast response Brian!, it works fine just one little thing if i change to Euro currency it add the prefix twice like this. € 19.00 EUR any ideas why? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 23, 2016 Share Posted October 23, 2016 Hi Anders, it's taking the information from your currency settings - some currencies use prefix (before the amount) e.g $ - some use suffix (after the amount) USD - and some use both. if you want to remove the prefix (the € symbol) remove {$currency.prefix} from the code; to remove 'EUR', delete {$currency.suffix} from the code. 0 Quote Link to comment Share on other sites More sharing options...
Anders Posted October 24, 2016 Share Posted October 24, 2016 Hi Brian, you are correct but just to be a litltebit peti as i am using swedish and euro currency. the right way is € sign on left side and swedish on the right. so if i remove right code then swedish will not show up and if i remove left then the € sign is not showing correct. i have removed left so it showing swedish and euro ont right side and that fine for me. and super thx for your help Warm regards Anders 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 24, 2016 Share Posted October 24, 2016 checking the normal output again, it doesn't seem to use suffix by default - so you could do this... {if $product.pricing.annually}<span>{if $currency.prefix eq '€'}{$currency.prefix}{/if}{($product.pricing.rawpricing.annually/12)|string_format:"%.2f"}{if $currency.suffix eq 'SEK'}{$currency.suffix}{/if}</span>/mo{else}{$product.pricing.minprice.cycleText}{/if} that would show the Euro sign on the left for EUR Pricing, and SEK on the right for Swedish pricing - the rules could be expanded for other currencies if required. 0 Quote Link to comment Share on other sites More sharing options...
Anders Posted October 24, 2016 Share Posted October 24, 2016 Brian thx again it works 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.