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

[Поддержка] Opencart 3 Custom H1 Products, Categories, Information pages


Recommended Posts

Opencart 3 Custom H1 Products, Categories, Information pages


Opencart 3 Custom H1 Products, Categories, Information pages


Модуль позволяет добавить H1 для товаров, категорий и статей в Opencart 3x

 

После 10 покупок - будет стал бесплатный

 

Техподдержка оказывается ТОЛЬКО купившим модуль либо заславшим на пиво

 

после обновления кеша модов в админке нужно зайти в категорию, в статью и в товар


  • Добавил
  • Добавлено
    25.06.2018
  • Категория
  • Системные требования
  • Метод активации
    Без активации
  • Ioncube Loader
    Нет
  • ocStore
    Несовместим
  • OpenCart.Pro, ocShop
    Несовместим
  • Обращение к серверу разработчика
    Нет

 

Link to comment
Share on other sites

  • 6 months later...
  • 2 months later...

Добрый день. После установки дополнения ломается сайт (все блоки растягиваются) и вместо слов кракозябры. Opencart 3.0.3.1. Может быть подскажете в чем может быть проблема? Спасибо!

Link to comment
Share on other sites


Проблема решена. Вдруг кому-то понадобится. Нужно зайти в админке в категорию, в товар и в страницу. Мне помогло. Разработчику уважуха за дополнение и помощь в решении проблемы.

Edited by Dufresne
Link to comment
Share on other sites


  • 4 months later...

Но ведь H1 автоматически добавляется для перечиcленных разделов: Products, Categories, Information pages

Для чего тогда данное дополнение?

Link to comment
Share on other sites


2 часа назад, Donni сказал:

Но ведь H1 автоматически добавляется для перечиcленных разделов: Products, Categories, Information pages

Для чего тогда данное дополнение?

Побуду капитан-очевидец
https://prnt.sc/ot71gn

Link to comment
Share on other sites

21 минуту назад, chukcha сказал:

Побуду капитан-очевидец
https://prnt.sc/ot71gn

 

:D вроде, понял.

Т. е. дополнение для Опенкарт 3, а для 3.0.3.2 RS оно не нужно. 

Завтра проверю и узнаю, если найду демо Опенкарт 3.

Edited by Donni
Link to comment
Share on other sites


9 часов назад, chukcha сказал:

нужно

 

Нужно для того, чтобы из админки вручную задать произвольный (более правильны/точный) H1.

Что-то не всегда до меня быстро доходят очевидные вещи...

 

Link to comment
Share on other sites


OpenCart 3.0.3.1rs
после установки модуля поля H1 появились в категориях и информационных статьях.

а в Продуктах не появились :(

 

глянул в storage/modifications - вроде как во все файлы прописались "добавки"

 

Link to comment
Share on other sites


  • 3 months later...
  • 8 months later...

Модуль стал без проблем. В категориях и товарах его не видно. В чем может быть проблема. Opencart 3.0.3.2. Буду благодарен за ответ.

Edited by green1976
Link to comment
Share on other sites


  • 7 months later...
  • 8 months later...
  • 9 months later...

вирішили туди ще виробників допиляти, но от біда не зберігає хоча поле в БД , може хто підкаже що не так?

 

<?xml version="1.0" encoding="utf-8"?>
<modification>
  <name>meta_h1 extended manufacturer</name>
  <code>meta_h1_extended</code>
  <author>spectre</author>
  <version>3</version>
  <link>https://freelancer.od.ua</link>
  <file path="admin/view/template/catalog/product_form.twig">
    <operation error="skip">
      <search><![CDATA[<label class="col-sm-2 control-label" for="input-meta-description{{ language.language_id }}">{{ entry_meta_description }}</label>]]></search>
      <add position="before" offset="1"><![CDATA[
				  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-meta-h1{{ language.language_id }}">H1</label>
                    <div class="col-sm-10">
                      <input type="text" name="product_description[{{ language.language_id }}][meta_h1]" value="{{ product_description[language.language_id] ? product_description[language.language_id].meta_h1 }}" id="input-meta-h1{{ language.language_id }}" class="form-control" />
					</div>
                  </div>
				]]></add>
    </operation>
  </file>
  <file path="admin/view/template/catalog/category_form.twig">
    <operation error="skip">
      <search><![CDATA[<label class="col-sm-2 control-label" for="input-meta-description{{ language.language_id }}">{{ entry_meta_description }}</label>]]></search>
      <add position="before" offset="1"><![CDATA[
				  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-meta-h1{{ language.language_id }}">H1</label>
                    <div class="col-sm-10">
                      <input type="text" name="category_description[{{ language.language_id }}][meta_h1]" value="{{ category_description[language.language_id] ? category_description[language.language_id].meta_h1 }}" id="input-meta-h1{{ language.language_id }}" class="form-control" />
					</div>
                  </div>
				]]></add>
    </operation>
  </file>
  <file path="admin/view/template/catalog/information_form.twig">
    <operation error="skip">
      <search><![CDATA[<label class="col-sm-2 control-label" for="input-meta-description{{ language.language_id }}">{{ entry_meta_description }}</label>]]></search>
      <add position="before" offset="1"><![CDATA[
				  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-meta-h1{{ language.language_id }}">H1</label>
                    <div class="col-sm-10">
                      <input type="text" name="information_description[{{ language.language_id }}][meta_h1]" value="{{ information_description[language.language_id] ? information_description[language.language_id].meta_h1 }}" id="input-meta-h1{{ language.language_id }}" class="form-control" />
					</div>
                  </div>
				]]></add>
    </operation>
  </file>
  <file path="admin/view/template/catalog/manufacturer_form.twig">
    <operation error="skip">
      <search><![CDATA[<label class="col-sm-2 control-label" for="input-meta-description{{ language.language_id }}">{{ entry_meta_description }}</label>]]></search>
      <add position="before" offset="1"><![CDATA[
				  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-meta-h1{{ language.language_id }}">{{ entry_meta_h1 }}</label>
                    <div class="col-sm-10">
                      <input type="text" name="manufacturer_description[{{ language.language_id }}][meta_h1]" value="{{ manufacturer_description[language.language_id] ? manufacturer_description[language.language_id].h1 }}" placeholder="{{ entry_meta_h1 }}" id="input-meta-h1{{ language.language_id }}" class="form-control" />
                    </div>
                  </div>
				]]></add>
    </operation>
  </file>
  <file path="admin/model/catalog/{product,category,information,manufacturer}*.php">
    <operation error="skip">
      <search><![CDATA[meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "']]></search>
      <add position="replace"><![CDATA[meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_h1 = '" . $this->db->escape($value['meta_h1']) . "']]></add>
    </operation>
    <operation error="skip">
      <search><![CDATA['meta_keyword'     => $result['meta_keyword']]]></search>
      <add position="replace"><![CDATA[
				'meta_keyword'     => $result['meta_keyword'],
				'meta_h1'     => $result['meta_h1']
				]]></add>
    </operation>
    <operation error="skip">
      <search><![CDATA[$product_description_data = array();]]></search>
      <add position="after"><![CDATA[
				$query = $this->db->query("DESC `" . DB_PREFIX . "product_description`");
				$fields = array();
				foreach($query->rows as $row) {
					$fields[] = $row['Field'];
				}
				if(!in_array("meta_h1", $fields)) {
					$this->db->query("ALTER TABLE `" . DB_PREFIX . "product_description` ADD `meta_h1` VARCHAR(255) NOT NULL AFTER `meta_keyword`");	
				}	
				]]></add>
    </operation>
    <operation error="skip">
      <search><![CDATA[$category_description_data = array();]]></search>
      <add position="after"><![CDATA[
				$query = $this->db->query("DESC `" . DB_PREFIX . "category_description`");
				$fields = array();
				foreach($query->rows as $row) {
					$fields[] = $row['Field'];
				}
				if(!in_array("meta_h1", $fields)) {
					$this->db->query("ALTER TABLE `" . DB_PREFIX . "category_description` ADD `meta_h1` VARCHAR(255) NOT NULL AFTER `meta_keyword`");	
				}	
				]]></add>
    </operation>
    <operation error="skip">
      <search><![CDATA[$information_description_data = array();]]></search>
      <add position="after"><![CDATA[
				$query = $this->db->query("DESC `" . DB_PREFIX . "information_description`");
				$fields = array();
				foreach($query->rows as $row) {
					$fields[] = $row['Field'];
				}
				if(!in_array("meta_h1", $fields)) {
					$this->db->query("ALTER TABLE `" . DB_PREFIX . "information_description` ADD `meta_h1` VARCHAR(255) NOT NULL AFTER `meta_keyword`");	
				}	
				]]></add>
    </operation>
    <operation error="skip">
      <search><![CDATA[$manufacturer_description_data = array();]]></search>
      <add position="after"><![CDATA[
				$query = $this->db->query("DESC `" . DB_PREFIX . "manufacturer_description`");
				$fields = array();
				foreach($query->rows as $row) {
					$fields[] = $row['Field'];
				}
				if(!in_array("meta_h1", $fields)) {
					$this->db->query("ALTER TABLE `" . DB_PREFIX . "manufacturer_description` ADD `meta_h1` VARCHAR(255) NOT NULL AFTER `meta_keyword`");	
				}	
				]]></add>
    </operation>
  </file>
  <file path="admin/model/catalog/manufacturer.php">
    <operation error="skip">
      <search><![CDATA['meta_keyword'      => $result['meta_keyword'],]]></search>
      <add position="after"><![CDATA[
				'meta_h1'     => $result['meta_h1'],
				]]></add>
    </operation>
    <operation error="skip">
      <search><![CDATA[public function editManufacturer($manufacturer_id, $data) {]]></search>
      <add position="after"><![CDATA[
				$this->db->query("DELETE FROM " . DB_PREFIX . "manufacturer_description WHERE manufacturer_id = '" . (int)$manufacturer_id . "'");

				foreach ($data['manufacturer_description'] as $language_id => $value) {
					$this->db->query("INSERT INTO " . DB_PREFIX . "manufacturer_description SET manufacturer_id = '" . (int)$manufacturer_id . "', language_id = '" . (int)$language_id . "', description = '" . $this->db->escape($value['description']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_h1 = '" . $this->db->escape($value['meta_h1']) . "'");
				}
				]]></add>
    </operation>
    <operation error="skip">
      <search><![CDATA[$manufacturer_id = $this->db->getLastId();]]></search>
      <add position="after"><![CDATA[
				foreach ($data['manufacturer_description'] as $language_id => $value) {
					$this->db->query("INSERT INTO " . DB_PREFIX . "manufacturer_description SET manufacturer_id = '" . (int)$manufacturer_id . "', language_id = '" . (int)$language_id . "', description = '" . $this->db->escape($value['description']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_h1 = '" . $this->db->escape($value['meta_h1']) . "'");
				}
				]]></add>
    </operation>
  </file>
  <file path="admin/controller/catalog/manufacturer.php">
    <operation error="skip">
      <search><![CDATA[if ($this->request->post['manufacturer_seo_url']) {]]></search>
      <add position="before"><![CDATA[
		foreach ($this->request->post['manufacturer_description'] as $language_id => $value) {
			if ((utf8_strlen($value['meta_title']) < 0) || (utf8_strlen($value['meta_title']) > 255)) {
				$this->error['meta_title'][$language_id] = $this->language->get('error_meta_title');
			}
			
			if ((utf8_strlen($value['meta_h1']) < 0) || (utf8_strlen($value['meta_h1']) > 255)) {
				$this->error['meta_h1'][$language_id] = $this->language->get('error_meta_h1');
			}
		}
				]]></add>
    </operation>
  </file>
  <file path="catalog/model/catalog/product.php">
    <operation error="skip">
      <search><![CDATA['meta_keyword'     => $query->row['meta_keyword'],]]></search>
      <add position="after"><![CDATA[
				'meta_h1'     => $query->row['meta_h1'],
				]]></add>
    </operation>
  </file>
  <file path="catalog/controller/product/product.php">
    <operation error="skip">
      <search><![CDATA[$data['heading_title'] = $product_info['name'];]]></search>
      <add position="after"><![CDATA[
				$data['heading_title'] = $product_info['meta_h1'] ? $product_info['meta_h1'] : $product_info['name'];
				]]></add>
    </operation>
  </file>
  <file path="catalog/controller/product/category.php">
    <operation error="skip">
      <search><![CDATA[$data['heading_title'] = $category_info['name'];]]></search>
      <add position="after"><![CDATA[
				$data['heading_title'] = $category_info['meta_h1'] ? $category_info['meta_h1'] : $category_info['name'];
				]]></add>
    </operation>
  </file>
  <file path="catalog/controller/information/information.php">
    <operation error="skip">
      <search><![CDATA[$data['heading_title'] = $information_info['title'];]]></search>
      <add position="after"><![CDATA[
				$data['heading_title'] = $information_info['meta_h1'] ? $information_info['meta_h1'] : $information_info['title'];
				]]></add>
    </operation>
  </file>
  <file path="catalog/controller/product/manufacturer.php">
    <operation error="skip">
      <search><![CDATA[$data['heading_title'] = $manufacturer_info['name'];]]></search>
      <add position="after"><![CDATA[
				$data['heading_title'] = $manufacturer_info['meta_h1'] ? $manufacturer_info['meta_h1'] : $manufacturer_info['name'];
				]]></add>
    </operation>
  </file>
</modification>

 

meta_h1_extended.xml

Link to comment
Share on other sites


В 13.10.2022 в 17:40, chukcha сказав:

а изменения  применились? в модели производителя?

<file path="admin/model/catalog/{product,category,information,manufacturer}*.php">
    

Так

IMG_20221014_130301_326.png

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • 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.