Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hello!

 

I'm using the Quantity Price Breaks Per Product Price Table Formatter contribution found here.

 

I managed to mess around with includes/classes/PriceFormatter.php to change '% savings' to 'total' by adding this function:

 

function getTotal($qty, $discount_price) {

$total = '$' . $qty * $discount_price;

  return $total;
 }

 

Now, how do I modify that function to always show 2 decimal places, instead of 1 or 0 like it does now? See my site here.

 

Thanks!!

Posted

use the osc functions

 

function getTotal($qty, $discount_price) {
 global $currencies;
 $total = $currencies->display_price($discount_price,0, $qty);
 return $total;
}

 

hard-coding currencies only give you trouble. And you may want to change the 0 to the tax amount depends how you've setup your store.

Posted
use the osc functions

 

function getTotal($qty, $discount_price) {
 global $currencies;
 $total = $currencies->display_price($discount_price,0, $qty);
 return $total;
}

 

hard-coding currencies only give you trouble. And you may want to change the 0 to the tax amount depends how you've setup your store.

 

Enigma, thank you so much!!!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...