Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Commit

Permalink
added brand page support
Browse files Browse the repository at this point in the history
  • Loading branch information
ikenfin committed May 28, 2019
1 parent d9f1cf6 commit 7a00f39
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 84 deletions.
99 changes: 54 additions & 45 deletions install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,112 +6,121 @@
<author>ikenfin</author>
<link>http://freeocart.ru</link>

<file path="catalog/controller/account/voucher.php">
<!-- home page -->
<file path="catalog/controller/common/home.php">
<operation>
<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
<search><![CDATA[$data['column_left'] = $this->load->controller('common/column_left');]]></search>
<add position="before"><![CDATA[
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processMetaByKey('home', $this->document);
]]></add>
</operation>
</file>
<!-- product -->
<file path="catalog/controller/product/product.php">
<operation>
<search><![CDATA[$this->model_catalog_product->updateViewed($this->request->get['product_id']);]]></search>
<add position="after"><![CDATA[
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processMetaByKey('voucher', $this->document);
$this->model_extension_module_foc_auto_meta->processMetaTemplate('product', $product_info, $this->document);
]]></add>
</operation>
</file>

<file path="catalog/controller/module/faq.php">
<!-- category -->
<file path="catalog/controller/product/category.php">
<operation>
<search><![CDATA[$this->document->setTitle($data['heading_title']);]]></search>
<search><![CDATA[$data['limit'] = $limit;]]></search>
<add position="after"><![CDATA[
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processMetaByKey('faq', $this->document);
$this->model_extension_module_foc_auto_meta->processMetaTemplate('category', $category_info, $this->document);
]]></add>
</operation>
</file>

<file path="catalog/controller/product/special.php">
<!-- information -->
<file path="catalog/controller/information/information.php">
<operation>
<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
<search><![CDATA[$this->document->setKeywords($information_info['meta_keyword']);]]></search>
<add position="after"><![CDATA[
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processMetaByKey('products_special', $this->document);
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processMetaTemplate('information', $information_info, $this->document);
]]></add>
</operation>
</file>

<file path="catalog/controller/information/sitemap.php">
<!-- manufacturer page -->
<file path="catalog/controller/product/manufacturer.php">
<operation>
<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
<add position="after"><![CDATA[
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processMetaByKey('sitemap', $this->document);
$this->model_extension_module_foc_auto_meta->processMetaByKey('manufacturer', $this->document);
]]></add>
</operation>
</file>

<file path="catalog/controller/information/shop_rating.php">
<operation>
<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
<search><![CDATA[$this->document->setTitle($manufacturer_info['name']);]]></search>
<add position="after"><![CDATA[
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processMetaByKey('reviews', $this->document);
$this->model_extension_module_foc_auto_meta->processMetaTemplate('brand', $manufacturer_info, $this->document);
]]></add>
</operation>
</file>

<file path="catalog/controller/product/manufacturer.php">
<!-- voucher page -->
<file path="catalog/controller/account/voucher.php">
<operation>
<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
<add position="after"><![CDATA[
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processMetaByKey('manufacturer', $this->document);
$this->model_extension_module_foc_auto_meta->processMetaByKey('voucher', $this->document);
]]></add>
</operation>
</file>

<file path="catalog/controller/information/contact.php">
<!-- specials page -->
<file path="catalog/controller/product/special.php">
<operation>
<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
<add position="after"><![CDATA[
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processMetaByKey('contacts_page', $this->document);
$this->model_extension_module_foc_auto_meta->processMetaByKey('products_special', $this->document);
]]></add>
</operation>
</file>

<file path="catalog/controller/product/product.php">
<!-- sitemap page -->
<file path="catalog/controller/information/sitemap.php">
<operation>
<search><![CDATA[$this->model_catalog_product->updateViewed($this->request->get['product_id']);]]></search>
<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
<add position="after"><![CDATA[
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processProductMeta($this->document, $product_info);
$this->model_extension_module_foc_auto_meta->processMetaByKey('sitemap', $this->document);
]]></add>
</operation>
</file>

<file path="catalog/controller/product/category.php">
<!-- contacts page -->
<file path="catalog/controller/information/contact.php">
<operation>
<search><![CDATA[$data['limit'] = $limit;]]></search>
<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
<add position="after"><![CDATA[
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processCategoryMeta($this->document, $category_info);
$this->model_extension_module_foc_auto_meta->processMetaByKey('contacts_page', $this->document);
]]></add>
</operation>
</file>

<file path="catalog/controller/information/information.php">
<!-- modules settings -->
<!-- faq module page -->
<file path="catalog/controller/module/faq.php">
<operation>
<search><![CDATA[$this->document->setKeywords($information_info['meta_keyword']);]]></search>
<search><![CDATA[$this->document->setTitle($data['heading_title']);]]></search>
<add position="after"><![CDATA[
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processInformationMeta($this->document, $information_info);
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processMetaByKey('faq', $this->document);
]]></add>
</operation>
</file>

<file path="catalog/controller/common/home.php">
<!-- shop rating -->
<file path="catalog/controller/information/shop_rating.php">
<operation>
<search><![CDATA[$data['column_left'] = $this->load->controller('common/column_left');]]></search>
<add position="before"><![CDATA[
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processMetaByKey('home', $this->document);
<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
<add position="after"><![CDATA[
$this->load->model('extension/module/foc_auto_meta');
$this->model_extension_module_foc_auto_meta->processMetaByKey('reviews', $this->document);
]]></add>
</operation>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@

$_['field_foc_auto_meta_product_title'] = 'Product title template';
$_['field_foc_auto_meta_product_description'] = 'Product description template';

$_['field_foc_auto_meta_category_title'] = 'Category title template';
$_['field_foc_auto_meta_category_description'] = 'Category description template';

$_['field_foc_auto_meta_information_title'] = 'Information title template';
$_['field_foc_auto_meta_information_description'] = 'Information description template';

$_['field_foc_auto_meta_brand_title'] = 'Brand title template';
$_['field_foc_auto_meta_brand_description'] = 'Brand description template';

$_['force_replace'] = 'Force replace value with rendered template';

// additional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@

$_['field_foc_auto_meta_category_title'] = 'Шаблон заголовка категории';
$_['field_foc_auto_meta_category_description'] = 'Шаблон описания категории';

$_['field_foc_auto_meta_product_title'] = 'Шаблон заголовка продукта';
$_['field_foc_auto_meta_product_description'] = 'Шаблон описания продукта';

$_['field_foc_auto_meta_category_title'] = 'Шаблон заголовка категории';
$_['field_foc_auto_meta_category_description'] = 'Шаблон описания категории';

$_['field_foc_auto_meta_information_title'] = 'Шаблон заголовка статьи';
$_['field_foc_auto_meta_information_description'] = 'Шаблон описания статьи';

$_['field_foc_auto_meta_brand_title'] = 'Шаблон заголовка производителя';
$_['field_foc_auto_meta_brand_description'] = 'Шаблон описания производителя';

$_['force_replace'] = 'Установить принудительно';

// additional
Expand Down
14 changes: 14 additions & 0 deletions upload/admin/model/extension/module/foc_auto_meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,45 @@ public function defaultSettingsItem () {
self::SETTINGS_GROUP . '_force_replace_home_title' => false,
self::SETTINGS_GROUP . '_home_description' => '',
self::SETTINGS_GROUP . '_force_replace_home_description' => false,

self::SETTINGS_GROUP . '_product_title' => '',
self::SETTINGS_GROUP . '_force_replace_product_title' => false,
self::SETTINGS_GROUP . '_product_description' => '',
self::SETTINGS_GROUP . '_force_replace_product_description' => false,

self::SETTINGS_GROUP . '_category_title' => '',
self::SETTINGS_GROUP . '_force_replace_category_title' => false,
self::SETTINGS_GROUP . '_category_description' => '',
self::SETTINGS_GROUP . '_force_replace_category_description' => false,

self::SETTINGS_GROUP . '_information_title' => '',
self::SETTINGS_GROUP . '_force_replace_information_title' => false,
self::SETTINGS_GROUP . '_information_description' => '',
self::SETTINGS_GROUP . '_force_replace_information_description' => false,

self::SETTINGS_GROUP . '_brand_title' => '',
self::SETTINGS_GROUP . '_force_replace_brand_title' => false,
self::SETTINGS_GROUP . '_brand_description' => '',
self::SETTINGS_GROUP . '_force_replace_brand_description' => false,
// customize seo metatags on non-editable pages
self::SETTINGS_GROUP . '_contacts_page_title' => '',
self::SETTINGS_GROUP . '_contacts_page_description' => '',

self::SETTINGS_GROUP . '_manufacturer_title' => '',
self::SETTINGS_GROUP . '_manufacturer_description' => '',

self::SETTINGS_GROUP . '_reviews_title' => '',
self::SETTINGS_GROUP . '_reviews_description' => '',

self::SETTINGS_GROUP . '_sitemap_title' => '',
self::SETTINGS_GROUP . '_sitemap_description' => '',

self::SETTINGS_GROUP . '_products_special_title' => '',
self::SETTINGS_GROUP . '_products_special_description' => '',

self::SETTINGS_GROUP . '_voucher_title' => '',
self::SETTINGS_GROUP . '_voucher_description' => '',

self::SETTINGS_GROUP . '_faq_title' => '',
self::SETTINGS_GROUP . '_faq_description' => ''
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</div>
</div>


<!-- product -->
<div class="form-group">
<label class="control-label col-sm-2"><?php echo $labels['foc_auto_meta_product_title']; ?></label>
<div class="col-sm-10">
Expand Down Expand Up @@ -80,6 +80,7 @@
</div>
</div>

<!-- category -->
<div class="form-group">
<label class="control-label col-sm-2"><?php echo $labels['foc_auto_meta_category_title']; ?></label>
<div class="col-sm-10">
Expand Down Expand Up @@ -110,7 +111,7 @@
</div>
</div>


<!-- information -->
<div class="form-group">
<label class="control-label col-sm-2"><?php echo $labels['foc_auto_meta_information_title'] ?></label>
<div class="col-sm-10">
Expand Down Expand Up @@ -141,6 +142,37 @@
</div>
</div>

<!-- brand -->
<div class="form-group">
<label class="control-label col-sm-2"><?php echo $labels['foc_auto_meta_brand_title'] ?></label>
<div class="col-sm-10">
<textarea name="foc_auto_meta[<?php echo $language['language_id'] ?>][foc_auto_meta_brand_title]" rows="3" class="form-control"><?php echo $fam_settings[$language['language_id']]['foc_auto_meta_brand_title'] ?></textarea>
</div>
</div>

<div class="form-group">
<label class="control-label col-sm-2"><?php echo $labels['force_replace'] ?></label>
<div class="col-sm-10">
<input type="hidden" value="0" name="foc_auto_meta[<?php echo $language['language_id'] ?>][foc_auto_meta_force_replace_brand_title]">
<input type="checkbox" value="1" <?php if ($fam_settings[$language['language_id']]['foc_auto_meta_force_replace_brand_title']) : ?>checked<?php endif ?> name="foc_auto_meta[<?php echo $language['language_id'] ?>][foc_auto_meta_force_replace_brand_title]">
</div>
</div>

<div class="form-group">
<label class="control-label col-sm-2"><?php echo $labels['foc_auto_meta_brand_description'] ?></label>
<div class="col-sm-10">
<textarea name="foc_auto_meta[<?php echo $language['language_id'] ?>][foc_auto_meta_brand_description]" rows="3" class="form-control"><?php echo $fam_settings[$language['language_id']]['foc_auto_meta_brand_description'] ?></textarea>
</div>
</div>

<div class="form-group">
<label class="control-label col-sm-2"><?php echo $labels['force_replace'] ?></label>
<div class="col-sm-10">
<input type="hidden" value="0" name="foc_auto_meta[<?php echo $language['language_id'] ?>][foc_auto_meta_force_replace_brand_description]">
<input type="checkbox" value="1" <?php if ($fam_settings[$language['language_id']]['foc_auto_meta_force_replace_brand_description']) : ?>checked<?php endif ?> name="foc_auto_meta[<?php echo $language['language_id'] ?>][foc_auto_meta_force_replace_brand_description]">
</div>
</div>

<div class="form-group">
<div class="col-sm-12">
<h4><?php echo $label_additional; ?></h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
{% for language in languages %}
<div class="tab-pane {% if (language['language_id'] == language_id) %}active{% endif %}" id="language{{ language['language_id'] }}">

{# home #}
<div class="form-group">
<label class="control-label col-sm-2">{{ labels['foc_auto_meta_home_title'] }}</label>
<div class="col-sm-10">
Expand All @@ -50,6 +51,7 @@
</div>
</div>

{# product #}
<div class="form-group">
<label class="control-label col-sm-2">{{ labels['foc_auto_meta_product_title'] }}</label>
<div class="col-sm-10">
Expand Down Expand Up @@ -80,6 +82,7 @@
</div>
</div>

{# category #}
<div class="form-group">
<label class="control-label col-sm-2">{{ labels['foc_auto_meta_category_title'] }}</label>
<div class="col-sm-10">
Expand Down Expand Up @@ -110,6 +113,7 @@
</div>
</div>

{# information #}
<div class="form-group">
<label class="control-label col-sm-2">{{ labels['foc_auto_meta_information_title'] }}</label>
<div class="col-sm-10">
Expand Down Expand Up @@ -140,6 +144,37 @@
</div>
</div>

{# brand #}
<div class="form-group">
<label class="control-label col-sm-2">{{ labels['foc_auto_meta_brand_title'] }}</label>
<div class="col-sm-10">
<textarea name="foc_auto_meta[{{ language['language_id'] }}][foc_auto_meta_brand_title]" rows="3" class="form-control">{{ fam_settings[language['language_id']]['foc_auto_meta_brand_title'] }}</textarea>
</div>
</div>

<div class="form-group">
<label class="control-label col-sm-2">{{ labels['force_replace'] }}</label>
<div class="col-sm-10">
<input type="hidden" value="0" name="foc_auto_meta[{{ language['language_id'] }}][foc_auto_meta_force_replace_brand_title]">
<input type="checkbox" value="1" {% if (fam_settings[language['language_id']]['foc_auto_meta_force_replace_brand_title']) %}checked{% endif %} name="foc_auto_meta[{{ language['language_id'] }}][foc_auto_meta_force_replace_brand_title]">
</div>
</div>

<div class="form-group">
<label class="control-label col-sm-2">{{ labels['foc_auto_meta_brand_description'] }}</label>
<div class="col-sm-10">
<textarea name="foc_auto_meta[{{ language['language_id'] }}][foc_auto_meta_brand_description]" rows="3" class="form-control">{{ fam_settings[language['language_id']]['foc_auto_meta_brand_description'] }}</textarea>
</div>
</div>

<div class="form-group">
<label class="control-label col-sm-2">{{ labels['force_replace'] }}</label>
<div class="col-sm-10">
<input type="hidden" value="0" name="foc_auto_meta[{{ language['language_id'] }}][foc_auto_meta_force_replace_brand_description]">
<input type="checkbox" value="1" {% if (fam_settings[language['language_id']]['foc_auto_meta_force_replace_brand_description']) %}checked{% endif %} name="foc_auto_meta[{{ language['language_id'] }}][foc_auto_meta_force_replace_brand_description]">
</div>
</div>

<div class="form-group">
<div class="col-sm-12">
<h4>{{ label_additional }}</h4>
Expand Down
Loading

0 comments on commit 7a00f39

Please sign in to comment.