Пример #1
0
 /**
  * {@inheritdoc}
  */
 protected function _construct()
 {
     $widget = $this->registry->registry('current_widget_instance');
     if ($widget) {
         $widgetParameters = $widget->getWidgetParameters();
         if (isset($widgetParameters['conditions'])) {
             $this->rule->loadPost($widgetParameters);
         }
     }
 }
Пример #2
0
 /**
  * @return \Magento\Rule\Model\Condition\Combine
  */
 protected function getConditions()
 {
     $conditions = $this->getData('conditions_encoded') ? $this->getData('conditions_encoded') : $this->getData('conditions');
     if ($conditions) {
         $conditions = $this->conditionsHelper->decode($conditions);
     }
     $this->rule->loadPost(['conditions' => $conditions]);
     return $this->rule->getConditions();
 }