Jump to content
AffordableDomainsCanada

order form price display

Recommended Posts

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 by AffordableDomainsCanada

Share this post


Link to post
Share on other sites

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! :roll:

 

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. :idea:

 

VHNfK8i.png

Share this post


Link to post
Share on other sites
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. :idea:

Share this post


Link to post
Share on other sites
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. :idea:

 

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.

Share this post


Link to post
Share on other sites
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). :idea:

 

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! :)

 

Wx1hI6k.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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