/** * Method processSave() : add or update product object * * @module now_seo_links * @return object Product * * @see AdminProductsControllerCore::processSave() */ public function processSave() { $iIdProduct = Tools::getValue('id_product'); $aShops = Context::getContext()->shop->getContextListShopID(); $aLinkRewrite = array(); foreach (Language::getLanguages(true) as $aLang) { if (array_key_exists('link_rewrite_' . (int) $aLang['id_lang'], $_POST)) { $aLinkRewrite[(int) $aLang['id_lang']] = Tools::getValue('link_rewrite_' . (int) $aLang['id_lang']); } } // Check if name already exist foreach ($aLinkRewrite as $iIdLang => $sLinkRewrite) { if (Product::linkRewriteIsAlreadyUsed($iIdProduct, $sLinkRewrite, $iIdLang, $aShops)) { $this->errors[] = sprintf(Tools::displayError('Ce link_rewrite "%s" (%s) existe déjà pour un autre produit et ne peut être utilisé une nouvelle fois.'), $sLinkRewrite, Language::getIsoById($iIdLang)); } } return parent::processSave(); }