Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Leaderboard

Popular Content

Showing content with the highest reputation on 10/30/2011 in all areas

  1. Тема для старых версий https://opencartforum.com/topic/937-seo-title-%d0%b8-h1-%d1%82%d1%8d%d0%b3%d0%b8-%d0%b3%d0%be%d1%82%d0%be%d0%b2%d0%be-%d0%b4%d0%be%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%ba%d0%b0/page__p__5981__hl__seo+title__fromsearch__1#entry5981 Для новой версии делаем следующее (все номера строк примерны): Пункт 1 Добавляем поле meta_title в обе таблицы oc_product_description и oc_category_description (ОС префикс, у вас он может быть другой). Поля создаем varchar(80) (255 максимальная длина поля) Пункт 2 Добавляем в /admin/view/template/catalog/category_form.tpl (например, строка 34): <tr> <td>Title</td> <td><input name="category_description[<?php echo $language['language_id']; ?>][meta_title]" size="100" value="<?php echo isset($category_description[$language['language_id'] ]) ? $category_description[$language['language_id']] ['meta_title'] : ''; ?>" /> </td> </tr>Добавляем в /admin/view/template/catalog/product_form.tpl (например, строка 34): <tr> <td>Title</td> <td> <input type="text" name="product_description[<?php echo $language['language_id']; ?>][meta_title]" value="<?php echo isset($product_description[$language['language_id'] ]) ? $product_description[$language['language_id']][ 'meta_title'] : ''; ?>" size="80"/> </td> </tr> Пункт 3 Заменяем в /admin/model/catalog/category.php (строка 12): foreach ($data['category_description'] as $language_id => $value) { $this->db->query("INSERT INTO " . DB_PREFIX . "category_description SET category_id = '" . (int)$category_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "'"); }НА foreach ($data['category_description'] as $language_id => $value) { $this->db->query("INSERT INTO " . DB_PREFIX . "category_description SET category_id = '" . (int)$category_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "'"); }Там же, строка 46, заменяем: foreach ($data['category_description'] as $language_id => $value) { $this->db->query("INSERT INTO " . DB_PREFIX . "category_description SET category_id = '" . (int)$category_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "'"); }НА foreach ($data['category_description'] as $language_id => $value) { $this->db->query("INSERT INTO " . DB_PREFIX . "category_description SET category_id = '" . (int)$category_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "'"); }Там же, строка 141, заменяем: foreach ($query->rows as $result) { $category_description_data[$result['language_id']] = array( 'name' => $result['name'], 'meta_keyword' => $result['meta_keyword'], 'meta_description' => $result['meta_description'], 'description' => $result['description'] ); }НА foreach ($query->rows as $result) { $category_description_data[$result['language_id']] = array( 'name' => $result['name'], 'meta_title' => $result['meta_title'], 'meta_keyword' => $result['meta_keyword'], 'meta_description' => $result['meta_description'], 'description' => $result['description'] ); } Этот код был для категорий. А теперь title для товара, заменяем в /admin/model/catalog/product.php (строка 12): foreach ($data['product_description'] as $language_id => $value) { $this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "'"); }НА foreach ($data['product_description'] as $language_id => $value) { $this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "'"); }строка 148: foreach ($data['product_description'] as $language_id => $value) { $this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "'"); }НА foreach ($data['product_description'] as $language_id => $value) { $this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "'"); }строка 460: foreach ($query->rows as $result) { $product_description_data[$result['language_id']] = array( 'name' => $result['name'], 'description' => $result['description'], 'meta_keyword' => $result['meta_keyword'], 'meta_description' => $result['meta_description'] ); }НА foreach ($query->rows as $result) { $product_description_data[$result['language_id']] = array( 'name' => $result['name'], 'meta_title' => $result['meta_title'], 'description' => $result['description'], 'meta_keyword' => $result['meta_keyword'], 'meta_description' => $result['meta_description'] ); } Пункт 4 Заменям в /catalog/controller/product/category.php : $this->document->setTitle($category_info['name']);НА if($category_info['meta_title'] == "") { $this->document->setTitle($category_info['name']); } else { $this->document->setTitle($category_info['meta_title']); } Заменям в /catalog/controller/product/product.php (строка 120): $this->document->setTitle($product_info['name']);НА if($product_info['meta_title'] == "") { $this->document->setTitle($product_info['name']); } else { $this->document->setTitle($product_info['meta_title']); } (workpro) Надо еще вписать в файл /catalog/model/catalog/product.php строка 19 вместо: 'name' => $query->row['name'],две строки: 'name' => $query->row['name'], 'meta_title' => $query->row['meta_title'], Проверяйте код на правильность, после того как вставили.
    1 point
  2. В конце файла catalog\view\theme\default\template\product\category. tpl находиш строку display('list');и меняеш вот так display('grid');
    1 point
  3. За Вас нужно шаблон переделать? Тогда Вам в платный раздел. Зная html и css можно самому справится. Где искать я вам сказал.
    0 points
Guest
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.