Jump to content

how to show monthly breakdown price with @


Recommended Posts

Hello,

currently monthly breakdown price is show a ( - ) hyphen and i want to show ( @ ) instead of hyphen. please suggest how can i do it. actually i want to show the more long billing term client choose client will get the more low price.

thanks in advance.

bfe99515d4.png

Link to comment
Share on other sites

On 06/04/2019 at 12:43, Jonh Carter said:

currently monthly breakdown price is show a ( - ) hyphen and i want to show ( @ ) instead of hyphen. please suggest how can i do it. actually i want to show the more long billing term client choose client will get the more low price.

long answer (e.g a tutorial on how to calculate/show savings per cycle)...

medium answer would be to use a hook to replace the - with @ ...

<?php

/**
* Modify BillingCycle Dropdown In Configure Product Cart Page Hook
* @author brian!
*/
 
function cart_modify_billingcycle_dropdown($vars)
{
	$billingcycles = array('monthly','quarterly','semiannually','annually','biennially','triennially');
	if ($vars['templatefile']=='configureproduct'){
		$pricing = $vars['pricing'];
		foreach ($billingcycles as $cycle) {
			if (!empty($pricing[$cycle])) {
				$pricing[$cycle] = str_replace(' - ',' @ ',$pricing[$cycle]);
			}
		}
		return array("pricing" => $pricing);
	}
}
add_hook("ClientAreaPageCart", 1, "cart_modify_billingcycle_dropdown");

iHxWmfu.png

short answer would be to edit configureproduct.tpl and change...

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

to...

<option value="monthly"{if $billingcycle eq "monthly"} selected{/if}>
	{$pricing.monthly|replace:' - ':' @ '}
</option>

... and then do the same for the other recurring cycles...

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