Jump to content

Displaying "You save" price in product.tpl


vasikgreif

Recommended Posts

  • 2 months later...

I also wanted to display 'You Save'. What I did was create a new function using $product->getPrice (in product.php) and for the parameter $only_reduc, I changed the value to 'true'. For $usereduc, I changed the value to false.

This ensured that I got the Reduction Value.

Try and let me know if this info was helpful :-)

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...

sorry, missed your post. Here is the code.

/**
* Get product price
* Same as static function getPriceStatic, no need to specify product id
*
* @param boolean $tax With taxes or not (optional)
* @param integer $id_product_attribute Product attribute id (optional)
* @param integer $decimals Number of decimals (optional)
* @param integer $divisor Util when paying many time without frais (optional)
* @return float Product price in euros
*/
public function getPriceReduc($tax = true, $id_product_attribute = NULL, $decimals = 6, $divisor = NULL, $only_reduc = true, $usereduc = false, $quantity = 1)
{
return self::getPriceStatic(intval($this->id), $tax, $id_product_attribute, $decimals, $divisor, $only_reduc, $usereduc, $quantity);
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...