OpenCart SEO fix#3 (meta)

Ещё один фикс, связанный с мета полями, которых по дефолту нет, но наличие не помешало бы.

Идём в файлик catalog\view\theme\default\template\common\header.tpl и добавляем строки:

<?php
#$pageURL = ‘http’;
$pageURL = ”;
#if ($_SERVER[“HTTPS”] == “on”) {$pageURL .= “s”;}
#$pageURL .= “://”;
if ($_SERVER[“SERVER_PORT”] != “80”) {
$pageURL .= $_SERVER[“SERVER_NAME”].”:”.$_SERVER[“SERVER_PORT”].$_SERVER[“REQUEST_URI”];
} else {
$pageURL .= $_SERVER[“SERVER_NAME”].$_SERVER[“REQUEST_URI”];
}

if (
(strpos($pageURL, ‘account’) !== false)
|| (strpos($pageURL, ‘checkout’) !== false)
|| (strpos($pageURL, ‘filter_name’) !== false)
|| (strpos($pageURL, ‘filter=’) !== false)
|| (strpos($pageURL, ‘/search’) !== false)
|| (strpos($pageURL, ‘search&amp;’) !== false)
|| (strpos($pageURL, ‘filter_tag’) !== false)
|| (strpos($pageURL, ‘/compare’) !== false)
|| (strpos($pageURL, ‘?sort’) !== false)
|| (strpos($pageURL, ‘sort=’) !== false)
|| (strpos($pageURL, ‘limit=’) !== false)
|| (strpos($pageURL, ‘&amp;limit’) !== false)
|| (strpos($pageURL, ‘filter_sub_category’) !== false)
|| (strpos($pageURL, ‘tracking=’) !== false)
|| (strpos($pageURL, ‘filter_description’) !== false)
|| (strpos($pageURL, ‘keyword’) !== false)
|| (strpos($pageURL, ‘order=’) !== false)
|| (strpos($pageURL, ‘/cart’) !== false)
|| (strpos($pageURL, ‘captcha’) !== false)
|| (strpos($pageURL, ‘manufacturer’) !== false)
|| (strpos($pageURL, ‘sitemap’) !== false)
|| (strpos($pageURL, ‘affiliate’) !== false)
|| (strpos($pageURL, ‘=DESC’) !== false)
|| (strpos($pageURL, ‘=ASC’) !== false)
|| (strpos($pageURL, ‘shop/?route’) !== false)
|| (strpos($pageURL, ‘/?route’) !== false)
|| (strpos($pageURL, ‘shop/?route’) !== false)
|| (strpos($pageURL, ‘keyword’) !== false)
|| (strpos($pageURL, ‘=rating’) !== false)
|| (strpos($pageURL, ‘common/home’) !== false)
|| (strpos($pageURL, ‘captcha’) !== false)
|| (strpos($pageURL, ‘=rating’) !== false)
|| (strpos($pageURL, ‘product/product&amp;path) !== false)
|| (strpos($pageURL, ‘product&amp;path) !== false)
)
{
echo ”
<meta name=\”robots\”              content=\”noindex\” />
<meta name=\”googlebot\”           content=\”noindex\” />
“;
} else {
echo ”
<meta name=\”revisit\”             content=\”30 days\” />
<meta name=\”revisit-after\”       content=\”30 days\” />
<meta name=\”robots\”              content=\”index, follow\” />
<meta name=\”googlebot\”           content=\”index, follow\” />
“;
}

?>

// кол-во дней выставить на своё усмотрение

//// кавычки сменить я так понимаю после wordpress нужно будет 🙂

Advertisements

About ОТЕЦъ

верю в сказки
This entry was posted in seo and tagged , , . Bookmark the permalink.

One Response to OpenCart SEO fix#3 (meta)

  1. I am not sure the place you are getting your information, however great topic. I needs to spend a while learning more or understanding more. Thanks for magnificent info I used to be looking for this information for my mission.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s