Beispiel #1
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);
 }