Jump to content

Change productsinfo for divide prices?


kanum

Recommended Posts

Hi,

 

I need your help :)

 

From the productsinfo feeds how can I get the prices like get from productpricing?

 

I mean for example if I add annually how can I get the price divided by 12 and not the price of total as annual?

By but

feeds/productsinfo.php?pid=1&get=price&billingcycle=annually

I get for example: 60$ I pretend get the price as "montly" :)

 

Thanks

 

Want I need change:

 

<?php

require("../init.php");

/*
*** USAGE SAMPLES ***

<script language="javascript" src="feeds/productsinfo.php?pid=1&get=name"></script>

<script language="javascript" src="feeds/productsinfo.php?pid=1&get=description"></script>

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

<script language="javascript" src="feeds/productsinfo.php?pid=1&get=orderurl&carttpl=web20cart"></script>

*/

$result = select_query("tblproducts","",array("id"=>$pid));
$data = mysql_fetch_array($result);
$pid = $data['id'];
$name = $data['name'];
$description = $data['description'];

if (!$pid) widgetoutput('Product ID Not Found');

if ($get=="name") widgetoutput($name);

if ($get=="description") {
   $description = str_replace(array("\r","\n","\r\n"),"",nl2br($description));
   widgetoutput($description);
}

if ($get=="configoption") widgetoutput($data['configoption'].$configoptionnum);

if ($get=="orderurl") {
   $systemurl = ($CONFIG['SystemSSLURL']) ? $CONFIG['SystemSSLURL'].'/' : $CONFIG['SystemURL'].'/';
   if ($carttpl=="ajax") {
       widgetoutput($systemurl."order/?pid=$pid");
   } else {
       widgetoutput($systemurl."cart.php?a=add&pid=$pid&$carttpl=cart");
   }
}

if ($get=="price") {
   $currency = ($currency) ? getCurrency('',$currency) : getCurrency();
   $result = select_query("tblpricing","",array("type"=>"product","currency"=>$currency['id'],"relid"=>$pid));
   $data = mysql_fetch_array($result);
   $price = $data[$billingcycle];
   $price = formatCurrency($price);
   widgetoutput($price);
}

function widgetoutput($value) {
   echo "document.write('".addslashes($value)."');";
   exit;
}

?>

Link to comment
Share on other sites

You take the answer it gives you and divide it by 12 :)

LOL, is not the pretend as you know.

 

by adding:

 

feeds/productsinfo.php?pid=1&get=price&billingcycle=annually

My price is annually, but I pretend get the pricing divided ;) by feed from whmcs.

Edited by kanum
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