/** * @param array $params * @return mixed|string */ public function mapDirectiveUrl($params = array()) { $args = array('map' => $params['map']); $product = $this->getProduct(); switch ($this->getConfigVar('associated_products_link', 'configurable_products')) { case RocketWeb_GoogleBaseFeedGenerator_Model_Source_Assocprodslink::FROM_PARENT: $value = $this->getParentMap()->mapColumn($args['map']['column']); break; case RocketWeb_GoogleBaseFeedGenerator_Model_Source_Assocprodslink::FROM_ASSOCIATED_PARENT: if ($product->isVisibleInSiteVisibility()) { return parent::mapDirectiveUrl($params); } else { $value = $this->getParentMap()->mapColumn($args['map']['column']); } break; default: $value = $this->getParentMap()->mapColumn($args['map']['column']); } $typeId = $this->getParentMap()->getProduct()->getTypeId(); $linkAddUnique = $this->getConfigVar('associated_products_link_add_unique', 'apparel') && $this->getParentMap() && ($typeId == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE || $typeId == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE); if ($linkAddUnique) { $value = $this->addUrlUniqueParams($value, $this->getProduct(), $this->getParentMap()->getOptionCodes(), $typeId); } return $value; }