Recommended PrestShop Version

Thanks for choosing Agile.
For customers using our Agile Multiple Seller module and its accessry modules, we highly recommend to use PrestaShop 1.6x or 1.7.5 or lower. PrestaShop has made some changes in versions higher than 1.7.6 that makes it possible or very difficult to implement some of features via hooks, or override, since required hooks or override is not available.

Sept. 05, 2019

This section introduce how to set up the Agile PrestaShop SEO enabled tag cloud module.

 

Instructions for installation:

1.  Login into your back office, and click on the "Modules" option.
2.  Un-install the existing standard "Tags block" module if it is currently installed.
3.  Look for the "Agile SEO Tag module", and click install.  The module will be installed automatically.
4.  Click the "Configure" link on the "Agile SEO tag module", and set "Tags displayed" to the number you want displayed.
5.  This step is different for PrestaShop versions 1.3x and 1.4x.


For PrestaShop 1.3x:

Modify the file "/admin???/tabs/AdminGenertator.php" (note, 'admin???' means the folder of your back office, usually it is renamed) and look for following two lines (around line# 192):

        $tab['RewriteRule']['content']['^lang-([a-z]{2})/(.*)$'] = '$2?isolang=$1 [QSA,L,E]';
        return $tab;

Insert the line below in between the above two lines.:

        $tab['RewriteRule']['content']['^tags/(.*)$'] = 'search.php?tag=$1 [QSA,L,E]';


For prestaShop 1.4x:

Insert the following code into the function generateHtaccess() in the file "/classes/Tools.php" as shown in the screenshot:

        //cloud tag search
        $tab['RewriteRule']['content']['^tags/(.*)$'] = 'search.php?tag=$1 [QSA,L,E]';

Agile-PrestaShop-SEO-Tag-Tools

 

Next, modify the file "/classes/Tool.php", and find the following code block in the function getMetaTags():

                /* CMS specifics meta tags */
            elseif ($id_cms = self::getValue('id_cms'))
            {
                $row = Db::getInstance()->getRow('
                SELECT `meta_title`, `meta_description`, `meta_keywords`
                FROM `'._DB_PREFIX_.'cms_lang`
                WHERE id_lang = '.intval($id_lang).' AND id_cms = '.intval($id_cms));
                if ($row)
                {
                    $row['meta_title'] = $row['meta_title'].' - '.Configuration::get('PS_SHOP_NAME');
                    return self::completeMetaTags($row, $row['meta_title']);
                }
            }


Add following block of code directly after above code:

            else
            {
                $tag = self::getValue('tag');
                 if(isset($tag) AND strlen($tag)>0)
                        {
                            $row['meta_title'] = $tag . " - " .Configuration::get('PS_SHOP_NAME');
                            $row['meta_description'] = $tag;
                            $row['meta_keywords'] = $tag;
                            return self::completeMetaTags($row, $row['meta_title']);
                        }
            }

Agile-PrestaShop-SEO-Tag-Tools-01


Finally, go to the back office, click on the Preference option, and in the "Friendly URL" section regenerate the htaccess file.