示例#1
0
 /**
  * @param Product $saleableItem
  * @param float $quantity
  * @param CalculatorInterface $calculator
  * @param SaleableInterface $bundleProduct
  * @param ManagerInterface $eventManager
  * @param DiscountCalculator $discountCalculator
  */
 public function __construct(Product $saleableItem, $quantity, CalculatorInterface $calculator, SaleableInterface $bundleProduct, ManagerInterface $eventManager, DiscountCalculator $discountCalculator)
 {
     parent::__construct($saleableItem, $quantity, $calculator);
     $this->bundleProduct = $bundleProduct;
     $this->eventManager = $eventManager;
     $this->discountCalculator = $discountCalculator;
 }
示例#2
0
 /**
  * @param Product $saleableItem
  * @param float $quantity
  * @param CalculatorInterface $calculator
  * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
  * @param PriceModifierInterface $modifier
  * @param \Magento\Framework\Store\StoreManagerInterface $storeManager
  */
 public function __construct(Product $saleableItem, $quantity, CalculatorInterface $calculator, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency, PriceModifierInterface $modifier, \Magento\Framework\Store\StoreManagerInterface $storeManager)
 {
     $this->priceCurrency = $priceCurrency;
     $this->priceModifier = $modifier;
     $this->storeManager = $storeManager;
     parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
 }
示例#3
0
 /**
  * @param Product $saleableItem
  * @param float $quantity
  * @param Calculator $calculator
  * @param TimezoneInterface $dateTime
  * @param StoreManager $storeManager
  * @param Session $customerSession
  * @param RuleFactory $catalogRuleResourceFactory
  */
 public function __construct(Product $saleableItem, $quantity, Calculator $calculator, TimezoneInterface $dateTime, StoreManager $storeManager, Session $customerSession, RuleFactory $catalogRuleResourceFactory)
 {
     parent::__construct($saleableItem, $quantity, $calculator);
     $this->dateTime = $dateTime;
     $this->storeManager = $storeManager;
     $this->customerSession = $customerSession;
     $this->resourceRuleFactory = $catalogRuleResourceFactory;
 }
示例#4
0
 /**
  * @param Product $saleableItem
  * @param float $quantity
  * @param CalculatorInterface $calculator
  * @param Session $customerSession
  */
 public function __construct(Product $saleableItem, $quantity, CalculatorInterface $calculator, Session $customerSession)
 {
     $quantity = $quantity ?: 1;
     parent::__construct($saleableItem, $quantity, $calculator);
     $this->customerSession = $customerSession;
     if ($saleableItem->hasCustomerGroupId()) {
         $this->customerGroup = (int) $saleableItem->getCustomerGroupId();
     } else {
         $this->customerGroup = (int) $this->customerSession->getCustomerGroupId();
     }
 }
示例#5
0
 /**
  * @param Product $saleableItem
  * @param float $quantity
  * @param CalculatorInterface $calculator
  * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
  * @param Session $customerSession
  * @param GroupManagementInterface $groupManagement
  */
 public function __construct(Product $saleableItem, $quantity, CalculatorInterface $calculator, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency, Session $customerSession, GroupManagementInterface $groupManagement)
 {
     $quantity = $quantity ?: 1;
     parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
     $this->customerSession = $customerSession;
     $this->groupManagement = $groupManagement;
     if ($saleableItem->hasCustomerGroupId()) {
         $this->customerGroup = (int) $saleableItem->getCustomerGroupId();
     } else {
         $this->customerGroup = (int) $this->customerSession->getCustomerGroupId();
     }
 }
 /**
  * @return SaleableInterface
  */
 public function getProduct()
 {
     if ($this->bundleProduct->getPriceType() == Price::PRICE_TYPE_DYNAMIC) {
         return parent::getProduct();
     } else {
         return $this->bundleProduct;
     }
 }
示例#7
0
 /**
  * @param Product $saleableItem
  * @param float $quantity
  * @param CalculatorInterface $calculator
  * @param TimezoneInterface $localeDate
  */
 public function __construct(Product $saleableItem, $quantity, CalculatorInterface $calculator, TimezoneInterface $localeDate)
 {
     parent::__construct($saleableItem, $quantity, $calculator);
     $this->localeDate = $localeDate;
 }
 /**
  * @param SaleableInterface $saleableItem
  * @param float $quantity
  * @param CalculatorInterface $calculator
  * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
  * @param array $excludeAdjustment
  */
 public function __construct(SaleableInterface $saleableItem, $quantity, CalculatorInterface $calculator, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency, $excludeAdjustment = null)
 {
     parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
     $this->excludeAdjustment = $excludeAdjustment;
 }
示例#9
0
 /**
  * @param Product $saleableItem
  * @param float $quantity
  * @param CalculatorInterface $calculator
  */
 public function __construct(Product $saleableItem, $quantity, CalculatorInterface $calculator)
 {
     parent::__construct($saleableItem, $quantity, $calculator);
     $this->basePrice = $this->priceInfo->getPrice(BasePrice::PRICE_CODE);
 }
 /**
  * @param Product $saleableItem
  * @param float $quantity
  * @param CalculatorInterface $calculator
  * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
  * @param TimezoneInterface $localeDate
  */
 public function __construct(Product $saleableItem, $quantity, CalculatorInterface $calculator, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency, TimezoneInterface $localeDate)
 {
     parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
     $this->localeDate = $localeDate;
 }
 /**
  * @param \Magento\Framework\Pricing\SaleableInterface $saleableItem
  * @param float $quantity
  * @param \Magento\Framework\Pricing\Adjustment\CalculatorInterface $calculator
  * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
  * @param PriceResolverInterface $priceResolver
  */
 public function __construct(\Magento\Framework\Pricing\SaleableInterface $saleableItem, $quantity, \Magento\Framework\Pricing\Adjustment\CalculatorInterface $calculator, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency, PriceResolverInterface $priceResolver)
 {
     parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
     $this->priceResolver = $priceResolver;
 }
示例#12
0
 /**
  * @param Product $saleableItem
  * @param float $quantity
  * @param CalculatorInterface $calculator
  * @param PriceModifierInterface $modifier
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  */
 public function __construct(Product $saleableItem, $quantity, CalculatorInterface $calculator, PriceModifierInterface $modifier, \Magento\Store\Model\StoreManagerInterface $storeManager)
 {
     $this->priceModifier = $modifier;
     $this->storeManager = $storeManager;
     parent::__construct($saleableItem, $quantity, $calculator);
 }
 /**
  * @param Product $saleableItem
  * @param float $quantity
  * @param BundleCalculatorInterface $calculator
  * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
  * @param BundleSelectionFactory $bundleSelectionFactory
  */
 public function __construct(Product $saleableItem, $quantity, BundleCalculatorInterface $calculator, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency, BundleSelectionFactory $bundleSelectionFactory)
 {
     $this->selectionFactory = $bundleSelectionFactory;
     parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
     $this->product->setQty($this->quantity);
 }
示例#14
0
 /**
  * @param Product $saleableItem
  * @param float $quantity
  * @param BundleCalculatorInterface $calculator
  * @param BundleSelectionFactory $bundleSelectionFactory
  */
 public function __construct(Product $saleableItem, $quantity, BundleCalculatorInterface $calculator, BundleSelectionFactory $bundleSelectionFactory)
 {
     $this->selectionFactory = $bundleSelectionFactory;
     parent::__construct($saleableItem, $quantity, $calculator);
     $this->product->setQty($this->quantity);
 }
示例#15
0
 /**
  * @param Product $saleableItem
  * @param float $quantity
  * @param CalculatorInterface $calculator
  * @param Session $customerSession
  */
 public function __construct(Product $saleableItem, $quantity, CalculatorInterface $calculator, Session $customerSession)
 {
     parent::__construct($saleableItem, $quantity, $calculator);
     $this->customerSession = $customerSession;
 }
 public function testGetQuantity()
 {
     $this->assertEquals(1, $this->price->getQuantity());
 }
 /**
  * {@inheritdoc}
  */
 public function getMinRegularAmount()
 {
     if (null === $this->minRegularAmount) {
         $this->minRegularAmount = $this->doGetMinRegularAmount() ?: parent::getAmount();
     }
     return $this->minRegularAmount;
 }
示例#18
0
 /**
  * @param Product $saleableItem
  * @param float $quantity
  * @param CalculatorInterface $calculator
  * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
  * @param Session $customerSession
  */
 public function __construct(Product $saleableItem, $quantity, CalculatorInterface $calculator, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency, Session $customerSession)
 {
     parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
     $this->customerSession = $customerSession;
 }