Jump to content

Can it be possible to display a product's Triennially price in monthly breakdown price using pricing feed code


Recommended Posts

Hello there,

Suppose my product price is

30/monthly

75/quarterly

120/semiannually

180/annually

$360/triennially.

If I want to display   in my html page the monthly cheapest price , I will take the option of triennially price . Generally I can use

<script language="javascript" src="feeds/productsinfo.php?pid=5&get=price&billingcycle=triennially&currency=1"></script>

But it need to display that price by monthly breakdown i.e. 10/month by using product pricing feed code.  

How can change the pricing feed code?

Link to comment
Share on other sites

17 hours ago, DareDevil67 said:

How can change the pricing feed code?

firstly, don't edit productsinfo.php as it would get overwritten during an update - so duplicate it and modify the copy and that should be safe from updating.

in the code there should be...

    $price = $data->$billingCycle;

after it, just add...

	if ($billingCycle = "triennially") {
		$price = number_format(($price / 36), 2);;
	}

when you pass "triennially" in the feed URL, then it should return a breakdown price for that cycle...

obviously, this can be expanded for the other cycles (just be modifying the division number, e.g 36, 24, 12, 6 etc) and you could expand it further to give you the option of returning the triennial amount, or a breakdown amount.

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