You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.5KB

  1. <?php
  2. namespace Lc\ShopBundle\Price\Services;
  3. use Doctrine\Common\Collections\Collection;
  4. use Lc\ShopBundle\Context\OrderProductInterface;
  5. use Lc\ShopBundle\Context\OrderShopInterface;
  6. use Lc\ShopBundle\Context\ProductFamilyInterface;
  7. use Lc\ShopBundle\Context\ProductInterface;
  8. use Lc\ShopBundle\Context\ProductPropertyInterface;
  9. use Lc\ShopBundle\Context\ReductionCatalogInterface;
  10. class ProductPriceUtils
  11. {
  12. use PriceUtilsTrait ;
  13. public function getPrice(ProductPropertyInterface $product)
  14. {
  15. if ($product->getBehaviorPriceInherited() == 'by-piece') {
  16. return $product->getPriceInherited();
  17. }
  18. elseif ($product->getBehaviorPriceInherited() == 'by-reference-unit') {
  19. if ($product->getQuantityInherited() > 0) {
  20. return $product->getPriceByRefUnitInherited() * ($product->getQuantityInherited() / $product->getUnitInherited()->getCoefficient());
  21. }
  22. }
  23. }
  24. public function getPriceWithTax(ProductPropertyInterface $product)
  25. {
  26. }
  27. public function getPriceWithTaxAndReduction(ProductPropertyInterface $product)
  28. {
  29. }
  30. public function getPriceByRefUnit(ProductPropertyInterface $product)
  31. {
  32. }
  33. public function getPriceByRefUnitWithTax(ProductPropertyInterface $product)
  34. {
  35. }
  36. public function getPriceByRefUnitWithTaxAndReduction(ProductPropertyInterface $product)
  37. {
  38. }
  39. }