/** * @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; }
public function _afterMap($rows) { if (!$this->_is_variants) { parent::_afterMap($rows); } return $this; }
/** * @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); }