Jump to content

Formatting productsinfo Feed


Daniel

Recommended Posts

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

Link to comment
Share on other sites

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. :idea:

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