72 $date = $this->localeDate->scopeDate(
$storeId);
75 $ruleData = $this->coreRegistry->registry(
'rule_data');
81 $key =
"{$date->format('Y-m-d H:i:s')}|{$wId}|{$gId}|{$pId}";
84 $gId =
$product->getCustomerGroupId();
86 $key =
"{$date->format('Y-m-d H:i:s')}|{$wId}|{$gId}|{$pId}";
90 if (!$this->rulePricesStorage->hasRulePrice($key)) {
91 $rulePrice = $this->resourceRuleFactory->create()->getRulePrice($date, $wId, $gId, $pId);
92 $this->rulePricesStorage->setRulePrice($key, $rulePrice);
94 if ($this->rulePricesStorage->getRulePrice($key) !==
false) {
95 $finalPrice = min(
$product->getData(
'final_price'), $this->rulePricesStorage->getRulePrice($key));
96 $product->setFinalPrice($finalPrice);
execute(\Magento\Framework\Event\Observer $observer)
elseif(isset( $params[ 'redirect_parent']))
__construct(RulePricesStorage $rulePricesStorage, Registry $coreRegistry, \Magento\CatalogRule\Model\ResourceModel\RuleFactory $resourceRuleFactory, TimezoneInterface $localeDate)