<modification>
<name>Таблицы размеров</name>
<version>3.0</version>
<code>size-chart</code>
<author>opencart2x.ru</author>
<link>https://opencart2x.ru</link>
<file path="catalog/controller/product/product.php">
<operation error="log">
<search><![CDATA[if ($product_info) {]]></search>
<add position="after"><![CDATA[/* Size Chart Starts */
$this->load->model('catalog/sizechart');
$sizechart_info = $this->model_catalog_sizechart->getSizeChartProduct($product_id);
if(!$sizechart_info) {
$sizechart_info = $this->model_catalog_sizechart->getSizeChartCategory($product_id);
}
if($sizechart_info) {
$data['sizechart_display'] = $sizechart_info['display'];
$data['sizechart_title'] = $sizechart_info['title'];
if($sizechart_info['display'] == 'popup') {
$data['sizechart_popup'] = $this->load->controller('product/sizechart/popup');
}else{
$data['sizechart_popup'] = '';
}
if($sizechart_info['display'] == 'above' || $sizechart_info['display'] == 'in' || $sizechart_info['display'] == 'tab') {
$data['sizechart_control'] = $this->load->controller('product/sizechart');
}else{
$data['sizechart_control'] = '';
}
}else{
$data['sizechart_display'] = '';
$data['sizechart_title'] = '';
$data['sizechart_control'] = '';
$data['sizechart_popup'] = '';
}
/* Size Chart Ends */]]></add>
</operation></file>
<file path="catalog/view/theme/*/template/product/product.twig">
<operation error="log">
<search><![CDATA[<div id="product"]]></search>
<add position="replace"><![CDATA[<!-- /* Size Chart Starts */ -->
{% if sizechart_display == 'popup' %}
{{ sizechart_popup }}
{% endif %}
<!-- /* Size Chart Ends */ -->
<div id="product"]]></add>
</operation>
<operation error="log">
<search><![CDATA[<div class="details__tabs"]]></search>
<add position="before"><![CDATA[<!-- /* Size Chart Starts */ -->
{% if sizechart_display == 'above' %}
{{ sizechart_control }}
{% endif %}
<!-- /* Size Chart Ends */ -->]]></add>
</operation>
<operation error="log">
<search><![CDATA[{% if (attribute_groups) %}]]></search>
<add position="before" offset="1"><![CDATA[<!-- /* Size Chart Starts */ -->
{% if sizechart_display == 'tab' %}
<button class="details__tabs-btn" data-tabs-btn="tab-sizechart">{{ sizechart_title }}
<svg class="icon-arrow-down">
<use xlink:href="catalog/view/theme/technics/sprites/sprite.svg#icon-arrow-down"></use>
</svg>
</button>
<div class="details__tabs-sizechart" data-tabs-content="tab-sizechart">
{{ sizechart_control }}
</div>
{% endif %}
<!-- /* Size Chart Ends */ -->]]></add>
</operation>
<operation error="log">
<search><![CDATA[<div class="tab-pane active" id="tab-description">]]></search>
<add position="after"><![CDATA[<!-- /* Size Chart Starts */ -->
{% if sizechart_display == 'in' %}
{{ sizechart_control }}
{% endif %}
<!-- /* Size Chart Ends */ -->]]></add>
</operation>
<operation error="log">
<search><![CDATA[<div class="tab-pane active" id="tab-description">{{ description }}</div>]]></search>
<add position="after"><![CDATA[<!-- /* Size Chart Starts */ -->
{% if sizechart_display == 'tab' %}
<div class="tab-pane" id="tab-sizechart">{{ sizechart_control }}</div>
{% endif %}
<!-- /* Size Chart Ends */ -->]]></add>
</operation>
</file>
<file path="admin/controller/common/column_left.php">
<operation>
<search><![CDATA[
if ($this->user->hasPermission('access', 'catalog/information')) {
]]></search>
<add position="before"><![CDATA[
if ($this->user->hasPermission('access', 'catalog/sizechart')) {
$catalog[] = array(
'name' => $this->language->get('text_sizechart'),
'href' => $this->url->link('catalog/sizechart', 'user_token=' . $this->session->data['user_token'], true),
'children' => array()
);
}
]]></add>
</operation>
</file>
<file path="admin/language/*/common/column_left.php">
<operation>
<search><![CDATA[
// Text
]]></search>
<add position="after"><![CDATA[
$_['text_sizechart'] = 'Таблицы размеров';
]]></add>
</operation>
</file>
</modification>