Community Forums

Discuss, share and get help from our community of friendly WHMCS users

Close
Login to Your Account
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2013
    Location
    Ontario, Canada
    Posts
    346

    Default order form price display

    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:

    PHP Code:
                                            {if $product.pricing.hasconfigoptions}
                                                {
    $LANG.from}
                                             {/if}
                                            {
    $product.pricing.minprice.cycleText}
                                        {/if} 
    I think this is the code specifically in question.

    PHP Code:
      {$product.pricing.minprice.cycleText
    Last edited by AffordableDomainsCanada; 02-17-17 at 05:12 PM.
    Jason P
    Owner @ AffordableDomains.ca
    www.AffordableDomains.ca

  2. #2
    Join Date
    Feb 2013
    Location
    UK
    Posts
    6,837

    Default Re: order form price display

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

    PHP Code:
                                                <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...

    PHP Code:
                                                <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&amp;{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.



  3. #3
    Join Date
    Aug 2013
    Location
    Ontario, Canada
    Posts
    346

    Default Re: order form price display

    Is there anyway to disable to showing of Free Domain in the drop down when the free domain option has been enabled ?
    Jason P
    Owner @ AffordableDomains.ca
    www.AffordableDomains.ca

  4. #4
    Join Date
    Feb 2013
    Location
    UK
    Posts
    6,837

    Default Re: order form price display

    Quote Originally Posted by AffordableDomainsCanada View Post
    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...

    PHP Code:
    {$cycleprice|replace:'(Free Domain)':''
    if you need it to be multilingual...

    PHP Code:
    {$cycleprice|replace:'(':''|replace:$LANG.orderfreedomainonly:''|replace:')':''
    if you just wanted to replace the Free Domain term with an asterisk...

    PHP Code:
    {$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.

  5. #5
    Join Date
    Aug 2013
    Location
    Ontario, Canada
    Posts
    346

    Default Re: order form price display

    Quote Originally Posted by brian! View Post
    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.
    Jason P
    Owner @ AffordableDomains.ca
    www.AffordableDomains.ca

  6. #6
    Join Date
    Feb 2013
    Location
    UK
    Posts
    6,837

    Default Re: order form price display

    Quote Originally Posted by AffordableDomainsCanada View Post
    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!



Similar Threads

  1. Display Configurable Option Groups Name in Order Form?
    By sagargulati in forum Using WHMCS
    Replies: 3
    Last Post: 10-11-15, 02:34 PM
  2. Order Form with price comparison issue
    By itsmir in forum Using WHMCS
    Replies: 1
    Last Post: 04-07-12, 07:36 PM
  3. Annual price in order form drop down
    By demodemo in forum Using WHMCS
    Replies: 5
    Last Post: 08-24-08, 08:02 PM
  4. how to display {$total} in step 4 (order form) without currency
    By azednet in forum Third Party Add-ons
    Replies: 0
    Last Post: 06-28-08, 11:57 AM
  5. Display logged IP on order form
    By shoggy24 in forum Developer Corner
    Replies: 9
    Last Post: 02-05-08, 02:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •