WellCommerce\Bundle\CouponBundle\Entity\CouponInterface::getModifierValue PHP Méthode

getModifierValue() public méthode

public getModifierValue ( ) : float
Résultat float
    public function getModifierValue() : float;

Usage Example

 private function calculateCouponModifier(CouponInterface $coupon, OrderInterface $order) : float
 {
     $modifierType = $coupon->getModifierType();
     $modifierValue = $coupon->getModifierValue();
     $baseCurrency = $coupon->getCurrency();
     $targetCurrency = $order->getCurrency();
     $totalGrossPrice = $order->getProductTotal()->getGrossPrice();
     if ('%' === $modifierType) {
         return $modifierValue / 100;
     }
     if ('-' === $modifierType) {
         $modifierValue = $this->currencyHelper->convert($modifierValue, $baseCurrency, $targetCurrency);
         return $modifierValue >= $totalGrossPrice ? 1 : $modifierValue / $totalGrossPrice;
     }
     return 1;
 }
All Usage Examples Of WellCommerce\Bundle\CouponBundle\Entity\CouponInterface::getModifierValue