public function __construct($id_category = null, $id_lang = null, $id_shop = null) { parent::__construct($id_category, $id_lang, $id_shop); $this->id_image = $this->id && file_exists(_PS_CAT_IMG_DIR_ . (int) $this->id . '.jpg') ? (int) $this->id : false; $this->image_dir = _PS_CAT_IMG_DIR_; $row = Meta::getEgCEOWords('category', $id_category); $this->meta_title = isset($row['meta_title']) ? $row['meta_title'] : $this->meta_title; $this->meta_title = Meta::replaceCity($this->meta_title); $this->meta_keywords = Meta::replaceCity($this->meta_keywords); $this->meta_description = Meta::replaceCity($this->meta_description); $this->description = isset($row['description']) ? $row['description'] : $this->description; $this->description = Meta::replaceCity($this->description); }
/** * @since 1.5.0 */ public static function completeMetaTags($meta_tags, $default_value, Context $context = null) { if (!$context) { $context = Context::getContext(); } if (empty($meta_tags['meta_title'])) { $meta_tags['meta_title'] = $default_value . ' - ' . Configuration::get('PS_SHOP_NAME') . ' %city_name'; } if (empty($meta_tags['meta_description'])) { $meta_tags['meta_description'] = Configuration::get('PS_META_DESCRIPTION', $context->language->id) ? Configuration::get('PS_META_DESCRIPTION', $context->language->id) : ''; } if (empty($meta_tags['meta_keywords'])) { $meta_tags['meta_keywords'] = Configuration::get('PS_META_KEYWORDS', $context->language->id) ? Configuration::get('PS_META_KEYWORDS', $context->language->id) : ''; } $meta_tags = Meta::replaceCity($meta_tags); return $meta_tags; }