refactore currency calculations in ProductSaleElements
This commit is contained in:
76
core/lib/Thelia/Model/Tools/ProductPriceTools.php
Normal file
76
core/lib/Thelia/Model/Tools/ProductPriceTools.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Model\Tools;
|
||||
|
||||
/**
|
||||
* Utility class used to store price and promo price for a carte item.
|
||||
*
|
||||
* Class ProductPriceTools
|
||||
* @package Thelia\Model\Tools
|
||||
* @author Julien Chanséaume <jchanseaume@openstudio.fr>
|
||||
*/
|
||||
class ProductPriceTools
|
||||
{
|
||||
/**
|
||||
* The value for the price field.
|
||||
*
|
||||
* @var double
|
||||
*/
|
||||
protected $price;
|
||||
|
||||
/**
|
||||
* The value for the promoPrice field.
|
||||
*
|
||||
* @var double
|
||||
*/
|
||||
protected $promoPrice;
|
||||
|
||||
public function __construct($price, $promoPrice)
|
||||
{
|
||||
$this->price = $price;
|
||||
$this->promoPrice = $promoPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $price
|
||||
*/
|
||||
public function setPrice($price)
|
||||
{
|
||||
$this->price = $price;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $promoPrice
|
||||
*/
|
||||
public function setPromoPrice($promoPrice)
|
||||
{
|
||||
$this->promoPrice = $promoPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getPromoPrice()
|
||||
{
|
||||
return $this->promoPrice;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user