Created
July 29, 2016 19:13
-
-
Save valdeir2000/e185f979763e927196a0740b6948bd15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<modification> | |
<name>Categories Page Product</name> | |
<code>valdeir_categories</code> | |
<version>1.0</version> | |
<author>Valdeir Santana</author> | |
<link>https://www.valdeirsantana.com.br</link> | |
<file path="admin/controller/catalog/product.php"> | |
<operation> | |
<search> | |
<![CDATA[$data['products'][] = array(]]> | |
</search> | |
<add position="before"> | |
<![CDATA[$category_name = $this->db->query("SELECT cd.name FROM `" . DB_PREFIX . "category_description` cd LEFT JOIN `" . DB_PREFIX . "product_to_category` pc ON (pc.category_id = cd.category_id) WHERE cd.language_id = ".(int)$this->config->get('config_language_id')." AND pc.product_id = ".(int)$result['product_id']." ORDER BY cd.category_id DESC LIMIT 1");]]> | |
</add> | |
</operation> | |
<operation> | |
<search> | |
<![CDATA['quantity' => $result['quantity'],]]> | |
</search> | |
<add position="after"> | |
<![CDATA['category_name' => isset($category_name->row['name']) ? $category_name->row['name'] : "Sem Categoria",]]> | |
</add> | |
</operation> | |
</file> | |
<file path="admin/view/template/catalog/product_list.tpl"> | |
<operation> | |
<search><![CDATA[<td class="text-right"><?php if ($sort == 'p.price') { ?>]]></search> | |
<add position="before"><![CDATA[<td class="text-right">Categorias</td>]]></add> | |
</operation> | |
<operation> | |
<search><![CDATA[<td class="text-right"><?php if ($product['special']) { ?>]]></search> | |
<add position="before"><![CDATA[<td class="text-right"><?php echo $product['category_name'] ?></td>]]></add> | |
</operation> | |
</file> | |
</modification> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment