Jump to content

Using $pricing.monthly value in an if else statement


studeggle

Recommended Posts

I am trying to customize my template so if the monthly pricing is $0.00 it just shows Monthly, as $0.00 for my company always means price is set by options so customer is just selecting there billing cycle. But I can't seem to find a proper equal value for that or an alternative variable.

 

{if $pricing.monthly}<option value="monthly"{if $billingcycle eq "monthly"} selected="selected"{/if}>{if $pricing.monthly != "$0.00 USD Monthly"}{$pricing.monthly}</option>{else}Monthly</option>{/if}{/if}

 

The above code allways outputs the $0.00 USD Month in the selection box (or price if there is a monthly price) instead of the else. And if I set it to != then it allways outputs the else of Monthly.

 

Please Help :-)

Link to comment
Share on other sites

I finally got this working for anyone interested in using it

 

For those looking to change there billing cycle to just read monthly (and perhaps quarterly.. ect) when the price is set by options, but at the same time properly display a monthly price when there is a set monthly price the following edit to the template will do it.

 

 

New template

Warning code may not come through correctly, some boards are not keeping code completely as code, review the attached copy of the template.

Code:

{if $pricing.monthly}<option value="monthly"{if $billingcycle eq "monthly"} selected="selected"{/if}>{if $pricing.rawpricing.monthly != "0.00"}{$pricing.monthly}</option>{else}Monthly</option>{/if}{/if}

 

 

 

This edit is just the monthly part, but the lines after in the template for quarterly, semiannual, ect simply change $pricing.rawpricing.monthly to $pricing.rawpricing.quarterly(or whatever cycle you are messing with).

 

You will be editing the configureproduct.tpl file, there is one in each folder inside of orderforms. I use the one in the cart folder but if that doesn't work you may have your install setup to use a different one, they each have there own look but the variables should remain available in all and hence the edit work in all.

 

Hope you enjoy, feel free to holler if you have trouble

configureproduct.zip

Link to comment
Share on other sites

  • 1 month later...

okay i want this but for products.tpl how do i go about that? or if i could remove billing cycle completely from products.tpl.

 

because my prices are based on configuration options not monthly so that monthly 0.00 looks ugly.

 

Thanks

 

Edit:

I was able to remove the 1 Month Price - $0.00 by removing the following code

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

</select>

 

Can anyone tell me if this will effect the billing system in any way?

Edited by reck3d
Found something out.
Link to comment
Share on other sites

  • 2 months later...

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