/**
  * @param $params
  * @param $attributes_codes
  * @return string
  */
 public function mapDirectiveVariantAttributes($params = array())
 {
     // try to get value from parent first
     $value = $this->hasParentMap() ? $this->getParentMap()->mapDirectiveVariantAttributes($params) : '';
     if (empty($value)) {
         $value = parent::mapDirectiveVariantAttributes($params);
     }
     return $value;
 }
Exemple #2
0
 public function _afterMap($rows)
 {
     if (!$this->_is_variants) {
         parent::_afterMap($rows);
     }
     return $this;
 }
Exemple #3
0
 /**
  * @param array $params
  * @return string
  */
 protected function mapDirectiveAvailability($params = array())
 {
     $map = $params['map'];
     // Set the Static Value / overwrite
     $default_value = isset($map['default_value']) ? $map['default_value'] : "";
     if ($default_value != "") {
         $stock_status = trim(strtolower($default_value));
         if (array_search($stock_status, $this->getConfig()->getAllowedStockStatuses()) === false) {
             $stock_status = $this->getConfig()->getOutOfStockStatus();
         }
         return $this->cleanField($stock_status, $params);
     }
     // Set the computed configurable stock status
     if ($this->hasAssociatedStockStatus() && $this->getAssociatedStockStatus() == $this->getConfig()->getOutOfStockStatus()) {
         return $this->cleanField($this->getAssociatedStockStatus(), $params);
     }
     return parent::mapDirectiveAvailability($params);
 }