Esempio n. 1
0
 public function _map()
 {
     $rows = array();
     $this->_variants_rows = array();
     foreach ($this->getAssocMaps() as $assocId => $assocMap) {
         $row = $assocMap->map();
         reset($row);
         $row = current($row);
         if (!$assocMap->isSkip()) {
             $this->_variants_rows[] = $row;
         }
         $rows[] = $row;
     }
     $this->_original_variants_rows = $this->_variants_rows;
     $this->_is_variants = $this->validateVariants($this->_variants_rows);
     if ($this->_is_variants) {
         $rows = $this->_variants_rows;
     } else {
         if ($this->getConfigVar('for_us', 'apparel')) {
             // As stand alone apparel product - no variants.
             $rows = parent::_map();
             $rows = $this->formUsConfigurableNonVariant($rows);
         } else {
             $rows = parent::_map();
             $rows = $this->formOtherConfigurableNonVariant($rows);
         }
     }
     return $rows;
 }