Jump to content

I want to change the sort order of billing cycle choices


peeta

Recommended Posts

  • 2 weeks later...

sparky, thanks for the suggestion but I don't have a file called configureproduct.tpl. Please let me know where that file should be.

 

I got it done based on the suggestion though and so far it seems to be working ok. I use th 'boxes' order theme so I edited order-stepthree.tpl (which had no for loop for the billing cycle) lines 28 - 32 and re-ordered the options as below

 

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

 

As stated, it seems to be working fine but if it is going to cause any other problem please let me know.

Link to comment
Share on other sites

  • 1 year later...

but the issue nobody can seem to sort out is how to get the biannual/annual to be the default selected cycle.

 

seems like it hard coded to have the monthly billing cycle selected and changing the order of the cycles means nothing unless you have the annual/biannual as the default cycle

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

Very sorry to open up this old thread but needs must....

 

Matt has informed me that it is possible to pass the billing cycle in the direct order link to automatically select a value other than monthly.

 

I have been searching for a few days now for a method of setting the default 'selected' option for billing cycles. I want to have Annual be selected by deafault but it always defaults to the lower cycles like quarterly.

 

I know you can link directly to a product and pass the billingcycle parameter, but if visitors go straight to the list of products at whmcs_install_url/cart.php then i can't figure out how to pass any parameters from that page to set the default cycle.

 

Someone must know how to do this by now?

 

Thanks very much for any useful help or suggestions.

Link to comment
Share on other sites

I have almost cracked it on the 'cart' order template configureproduct.tpl:

 

<select name="billingcycle" onchange="submit()">

{if $pricing.annually}<option value="annually"{if $billingcycle eq "annually"} selected="selected"{/if}>{$pricing.annually}</option>{/if}

{if $pricing.semiannually}<option value="semiannually"{if $billingcycle eq "semiannually"} selected="selected"{/if}>{$pricing.semiannually}</option>{/if}

{if $pricing.quarterly}<option value="quarterly">{$pricing.quarterly}</option>{/if}

{if $pricing.monthly}<option value="monthly"{if $billingcycle eq "monthly"} selected="selected"{/if}>{$pricing.monthly}</option>{/if}

{if $pricing.biennially}<option value="biennially"{if $billingcycle eq "biennially"} selected="selected"{/if}>{$pricing.biennially}</option>{/if}

</select>

 

The remaining problems are that you cannot pass the 'quarterly' billing cycle to the product any more (if you needed to), and also when the 'Update Cart' button is clicked, the first time it brings the page back unchanged, then a second click on 'Update Cart' successfully passes on to the cart view page with the price break down etc correctly showing.

 

EDIT:

I just noticed that now (using the above changes) when the selection is changed using the drop-down menu, it immediately redirects to the checkout page...which is no good at all.

 

Many thanks.

Edited by 01jack
Link to comment
Share on other sites

Just FYI in case it helps anyone, the answer is to edit /templates/orderforms/web20cart/products.tpl and find

 

<td width="20%" align="center" valign="middle"><input type="button" value="{$LANG.ordernowbutton}"{if $product.qty eq "0"} disabled{/if} onclick="window.location='{$smarty.server.PHP_SELF}?a=add&pid={$product.pid}'" /></td>

 

and add to the url:

 

<td width="20%" align="center" valign="middle"><input type="button" value="{$LANG.ordernowbutton}"{if $product.qty eq "0"} disabled{/if} onclick="window.location='{$smarty.server.PHP_SELF}?a=add&pid={$product.pid}&billingcycle=annually'" /></td>

 

So you don't need to change configureproduct.tpl at all for this.

 

Peace

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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