Daniel Posted May 2, 2017 Share Posted May 2, 2017 Hey, I'm using productsinfo.php to add prices to our website but need to change the formatting slightly. The formatting I'm looking to get is: <span class=“dollar”>$</span>2<span class=“dec”>.49</span> Any ideas how I could format this? Being able to split the output into dollars and cents would be fine or adding the styling into productsinfo.php directly. Any help would be appreciated. Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 2, 2017 Share Posted May 2, 2017 it'd be easier to modify the feed rather than have it send a value and then adjust the output... assuming you're wanting to hardcode the $ into the feed output... $result = select_query("tblpricing", "", array("type" => "product", "currency" => $currencyID, "relid" => $pid)); $data = mysql_fetch_array($result); $splitter = explode(".", $data[$billingCycle]); $dollars = $splitter[0]; $cents = $splitter[1]; $price = '<span class="dollar">$</span>'.$dollars.'<span class="dec">.'.$cents.'</span>'; widgetOutput($price); you could trim that code down if you wanted to remove some unnecessary steps, but i've left it as is so you can see how it's done. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Nate Posted May 2, 2017 Share Posted May 2, 2017 Instead of trying to pull in html and then modify it, I would use the GetProducts API call, receive json data back and then use JS or a template to render your page. http://developers.whmcs.com/api-reference/getproducts/ 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.