<?xml version="1.0" encoding="utf-8"?>
<modification>
  <name>Картинки для подкатегорий</name>
  <code>img-for-subcategory</code>
  <version>1</version>
  <author>valdemariuses</author>
  <link>http://oc-new.com/</link>
	<file path="catalog/controller/product/category.php">
        <operation>
            <search index="0"><![CDATA[
$data['categories'][] = array(
            ]]></search>
            <add position="replace" offset="3"><![CDATA[
				if ($result['image']) {
					$image = $this->model_tool_image->resize($result['image'], 100, 100);
				} else {
					$image = $this->model_tool_image->resize('placeholder.png', 100, 100);
				}
				
				$data['categories'][] = array(
					'name'  => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''),
					'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url),
					'thumb' => $image
				);
            ]]></add>
        </operation>
	</file>
	
	<file path="catalog/view/theme/*/template/product/category.tpl">
        <operation>
            <search index="0"><![CDATA[
<?php if ($categories) { ?>
            ]]></search>
            <add position="replace" offset="25"><![CDATA[
<?php if ($categories) { ?>
	<div class="col-sm-12">
	  <div>
		<h3><?php echo $text_refine; ?></h3>
	  </div>
	  <div style="text-align: center;">
		<div class="row">
		<?php foreach ($categories as $category) { ?>
		  <div class="col-md-4 col-sm-6 col-xs-6 for_subcats_pict">
			<div>
			<div class="img_for_subcats_pict"><a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['thumb']; ?>" alt="<?php echo $category['name']; ?>" /></a></div>
			<div class="txt_for_subcats_pict"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></div>
			</div>
		  </div>
		<?php } ?>
		</div>
	  </div>
	</div>
<?php } ?>
            ]]></add>
        </operation>
	</file>
	<file path="catalog/view/theme/*/stylesheet/stylesheet.css">
        <operation>
            <search><![CDATA[/* product list */]]></search>
            <add position="before"><![CDATA[
.for_subcats_pict > div {
	border: 1px solid #e5e5e5;
	box-shadow: 2px 2px 4px #e5e5e5;
	padding: 5px;
    display: -webkit-flex;
    display: -ms-flex;
    display: flex;
    -webkit-align-items: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
	flex-wrap: wrap;
	justify-content: center;
}
.img_for_subcats_pict {
	width: 30%;
	float: left;
}
.img_for_subcats_pict img {
	width: 100%;
}
.txt_for_subcats_pict {
	width: 70%;
	float: left;
}
            ]]></add>
        </operation>
	</file>
	<file path="catalog/view/theme/*/template/common/header.tpl">
        <operation>
            <search><![CDATA[<link href="catalog/view/theme/default/stylesheet/stylesheet.css" rel="stylesheet">]]></search>
            <add position="replace"><![CDATA[
<link href="system/storage/modification/catalog/view/theme/default/stylesheet/stylesheet.css" rel="stylesheet">
            ]]></add>
        </operation>
	</file>
</modification>