WellCommerce\Bundle\ProductBundle\Entity\ProductInterface::getSellPrice PHP Method

getSellPrice() public method

public getSellPrice ( ) : DiscountablePrice
return WellCommerce\Bundle\AppBundle\Entity\DiscountablePrice
    public function getSellPrice() : DiscountablePrice;

Usage Example

 /**
  * {@inheritdoc}
  */
 public function calculateProduct(ShippingMethodInterface $shippingMethod, ProductInterface $product)
 {
     $baseCurrency = $product->getSellPrice()->getCurrency();
     $targetCurrency = $shippingMethod->getCurrency()->getCode();
     $totalGrossAmount = $this->currencyHelper->convert($product->getSellPrice()->getFinalGrossAmount(), $baseCurrency, $targetCurrency);
     $ranges = $shippingMethod->getCosts();
     $supportedRanges = $ranges->filter(function (ShippingMethodCostInterface $cost) use($totalGrossAmount) {
         return $cost->getRangeFrom() <= $totalGrossAmount && $cost->getRangeTo() >= $totalGrossAmount;
     });
     if ($supportedRanges->count()) {
         return $supportedRanges->first();
     }
     return null;
 }
All Usage Examples Of WellCommerce\Bundle\ProductBundle\Entity\ProductInterface::getSellPrice