AffordableDomainsCanada Posted February 17, 2017 Share Posted February 17, 2017 (edited) Right now on my order form it displays the lowest cycle for the set price. for example if the recurring price is set for monthly then that price is set, if only annually is set, then it would be displayed only.. Is there a way to make this have a drop down menu? I have monthly, quarterly, semi, and annually set as options and would like a nice drop down menu to be displayed. Here is the code in the orderform in question: {if $product.pricing.hasconfigoptions} {$LANG.from} {/if} {$product.pricing.minprice.cycleText} {/if} I think this is the code specifically in question. {$product.pricing.minprice.cycleText} Edited February 17, 2017 by AffordableDomainsCanada 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 17, 2017 Share Posted February 17, 2017 i'm sure i've answered a similar question previously last year, but can't find the thread - probably lost forever inside one of the beta forums! if it's purely for show (e.g you don't need to pass the billingcycle to the next cart step), then you should be able to replace cycletext with a dropdown using a foreach loop... <select name="billingcycle"> {foreach $product.pricing.cycles as $cycle => $cycleprice} <option value="{$cycle}">{$cycleprice}</option> {/foreach} </select> if you want to pass the cycle and make the dropdown active (effectively bypassing the submit/configure button), then you'll need a bit of js... <select name="billingcycle" onchange="window.location=this.value"> <option>{$LANG.cartchoosecycle}</option> {foreach $product.pricing.cycles as $cycle => $cycleprice} <option value="{$smarty.server.PHP_SELF}?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}&billingcycle={$cycle}">{$cycleprice}</option> {/foreach} </select> anyway, that's roughly a couple of ways to do it... but with you using a custom orderform, it might need a bit of tweaking. 0 Quote Link to comment Share on other sites More sharing options...
AffordableDomainsCanada Posted February 17, 2017 Author Share Posted February 17, 2017 Is there anyway to disable to showing of Free Domain in the drop down when the free domain option has been enabled ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 17, 2017 Share Posted February 17, 2017 Is there anyway to disable to showing of Free Domain in the drop down when the free domain option has been enabled ? there would be a few options - depending on how thorough you want to be... if your site is English only, you can just do a straight Smarty replace by changing {$cycleprice} to... {$cycleprice|replace:'(Free Domain)':''} if you need it to be multilingual... {$cycleprice|replace:'(':''|replace:$LANG.orderfreedomainonly:''|replace:')':''} if you just wanted to replace the Free Domain term with an asterisk... {$cycleprice|replace:$LANG.orderfreedomainonly:'*'} it's probably also worth mentioning that there is another pricing array that would potentially give more customisable output, but would need a lot of additional coding to accomplish it. 0 Quote Link to comment Share on other sites More sharing options...
AffordableDomainsCanada Posted February 18, 2017 Author Share Posted February 18, 2017 it's probably also worth mentioning that there is another pricing array that would potentially give more customisable output, but would need a lot of additional coding to accomplish it. Well you are just a bearer of good news this morning! Well I have not yet run into this issue, but I am hoping I don't. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 18, 2017 Share Posted February 18, 2017 Well you are just a bearer of good news this morning! Well I have not yet run into this issue, but I am hoping I don't. using the above code, I doubt you ever will - WHMCS is doing the donkey work creating the ideal array for you, so you just need to output it as is (with perhaps tweaks for setup fees and free domains). the other array, rawpricing, would only be of use if you didn't want to use the above array output as is but wanted a more customised output - as you can see from below, you don't necessarily have access to whether the cycle comes with a free domain, but the other prices/fees are just numbers, so easier to perform maths functions on... if you needed to - but you likely won't! 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.