/** * prepare tags * * @return array */ protected function prepareTags() { $result = array(); if (is_array($this->currentProduct->tags) && array_key_exists($this->getPlugin()->getLanguageId(), $this->currentProduct->tags)) { foreach ($this->currentProduct->tags[$this->getPlugin()->getLanguageId()] as $number => $value) { $tagItem = new Shopgate_Model_Catalog_Tag(); $tagItem->setUid($number); $tagItem->setValue($value); $result[] = $tagItem; } } return $result; }
/** * set tags */ public function setTags() { $result = array(); $tags = explode(',', $this->item->getMetaKeyword()); foreach ($tags as $tag) { if (!ctype_space($tag) && !empty($tag)) { $tagItemObject = new Shopgate_Model_Catalog_Tag(); $tagItemObject->setValue(trim($tag)); $result[] = $tagItemObject; } } parent::setTags($result); }