Jump to content

Setting default payment term


Jack-PNH

Recommended Posts

  • 2 months later...
  • 11 months later...
  • WHMCS CEO

You can do it in a direct product link from your site, for example:

 

/cart.php?a=add&pid=X&billingcycle=annually

 

Or you can add the &billingcycle=annually suffix to your active order template products.tpl default product links. Where annual is passed and not available, it will just continue as it is now selecting the lowest available cycle so won't cause any problems.

 

Matt

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
  • 9 months later...

Matt, John,

 

Did you guys know what using the "billingcycle=annually" option on a direct shopping cart link doesn't actually work? It still defaults back to monthly.

 

Neither does the "sld" & "tld" options work.

 

Here's the link: https://billing.softdux.com/order/?pid=35&skip=1&billingcycle=annually&sld=anewdomain&tld=.com

 

Look @ the attached screenshot

Clipboard01.jpg

Clipboard02.jpg

Link to comment
Share on other sites

  • 3 weeks later...
Matt, John,

 

Did you guys know what using the "billingcycle=annually" option on a direct shopping cart link doesn't actually work? It still defaults back to monthly.

 

Neither does the "sld" & "tld" options work.

 

Here's the link: https://billing.softdux.com/order/?pid=35&skip=1&billingcycle=annually&sld=anewdomain&tld=.com

 

Look @ the attached screenshot

 

I have the same problem with ajax cart.

How can I make a default payment term?

 

I want the default be the annual, not the monthly

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

adding &billingcycle=annually in the URL will not work. Even though the variable might be set during the first request in the index file it doesn't carry through to the subsequent AJAX requests. The easiest way to "fix" this problem is to open the index.php file (whmcs_folder/order/index.php), find the line:

$billingcycle = $_REQUEST['billingcycle'];

and change it to

$billingcycle = 'annually';

This way all requests made to the index page will have the $billingcycle variable set to annually.

Link to comment
Share on other sites

  • 1 month later...

FYI:

 

In products.tpl find:

 

<select name="billingcycle">
{if $product.pricing.monthly}<option value="monthly">{$product.pricing.monthly}</option>{/if}
{if $product.pricing.quarterly}<option value="quarterly">{$product.pricing.quarterly}</option>{/if}
{if $product.pricing.semiannually}<option value="semiannually">{$product.pricing.semiannually}</option>{/if}
{if $product.pricing.annually}<option value="annually">{$product.pricing.annually}</option>{/if}
{if $product.pricing.biennially}<option value="biennially">{$product.pricing.biennially}</option>{/if}
{if $product.pricing.triennially}<option value="triennially">{$product.pricing.triennially}</option>{/if}
</select>

 

and edit it to:

 

<select name="billingcycle">
{if $product.pricing.monthly}<option value="monthly">{$product.pricing.monthly}</option>{/if}
{if $product.pricing.quarterly}<option value="quarterly">{$product.pricing.quarterly}</option>{/if}
{if $product.pricing.semiannually}<option value="semiannually">{$product.pricing.semiannually}</option>{/if}
{if $product.pricing.annually}<option selected="selected" value="annually">{$product.pricing.annually}</option>{/if}
{if $product.pricing.biennially}<option value="biennially">{$product.pricing.biennially}</option>{/if}
{if $product.pricing.triennially}<option value="triennially">{$product.pricing.triennially}</option>{/if}
</select>

 

In other words just add

selected="selected"

in the option you want selected by default.

 

Peace

Link to comment
Share on other sites

  • 4 months later...

anyone have an idea how to do the same thing with the new modern theme since the coding seems a bit different?

 

<span class="pricing">{$product.pricing.minprice.price}</span><br />
{if $product.pricing.minprice.cycle eq "monthly"}
{$LANG.orderpaymenttermmonthly}
{elseif $product.pricing.minprice.cycle eq "quarterly"}
{$LANG.orderpaymenttermquarterly}
{elseif $product.pricing.minprice.cycle eq "semiannually"}
{$LANG.orderpaymenttermsemiannually}
{elseif $product.pricing.minprice.cycle eq "annually"}
{$LANG.orderpaymenttermannually}
{elseif $product.pricing.minprice.cycle eq "biennially"}
{$LANG.orderpaymenttermbiennially}
{elseif $product.pricing.minprice.cycle eq "triennially"}
{$LANG.orderpaymenttermtriennially}
{/if}

Link to comment
Share on other sites

  • 2 months later...
  • 1 year later...
Thanks 01Jack. Worked Perfect.

ethical your in the wrong foler.

/templates/orderforms/verticalsteps (change with to your selected Default Order Form Template)

 

well i got a little busy lol! I was not using verticalsteps am using the modern template and that is how the products.tpl looks like

 

anyone know how to do this with the modern theme?

 

thanks

Link to comment
Share on other sites

  • 4 years later...

Not sure if it's too old to post here but I'm trying to do this as well and the option posted above is not there. I found this in my order.tpl

  <h4>Choose Payment Term</h4>
                        <select name="billingcycle" class="form-control">
                            {foreach $product->pricing()->allAvailableCycles() as $pricing}
                                <option value="{$pricing->cycle()}"{if $requestedCycle == $pricing->cycle()} selected{/if}>
                                    {if $pricing->isYearly()}
                                        {$pricing->cycleInYears()} - {$pricing->yearlyPrice()}
                                    {else}
                                        {$pricing->cycleInMonths()} - {$pricing->monthlyPrice()}
                                    {/if}
                                </option>
                            {/foreach}
                        </select>

 

I changed {$pricing->cycleInMonths()} - {$pricing->monthlyPrice()} to  {$pricing->cycleInYears()} - {$pricing->yearlyPrice()} but no go.

Also the &billingcycle=annually works on hosting and reseller plans but not on VPS or Dedicated. Basically if you don't choose a domain it doesn't work.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated