There is no Script involved with this, it just misses the
Model Declaration in the Array!
Ernie
catalog/controller/product/category.php
OLD:
Code: Select all
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'minimum' => $result['minimum'] > 0 ? $result['minimum'] : 1,
'rating' => $result['rating'],
'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
);
NEW:
Code: Select all
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'model' => $result['model'],
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'minimum' => $result['minimum'] > 0 ? $result['minimum'] : 1,
'rating' => $result['rating'],
'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
);
/theme/template/product/category.tpl (Basic Output Code)
Code: Select all
<div>Model: <?php echo $product['model']; ?></div>
The revised VqMod would therefore look like this: (tested with OC v.2.2.x Default Theme)
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<modification>
<id><![CDATA[Product Model in Category]]></id>
<version><![CDATA[1.0]]></version>
<vqmver><![CDATA[2.5.x]]></vqmver>
<author><![CDATA[Ernie - IP_CAM]]></author>
<file name="catalog/controller/product/category.php">
<operation error="log">
<search position="after"><![CDATA[$result['name'],]]></search>
<add><![CDATA[
'model' => $result['model'],
]]></add>
</operation>
</file>
<file name="catalog/view/theme/*/template/product/category.tpl">
<operation error="log">
<search position="after"><![CDATA[<div class="caption">]]></search>
<add><![CDATA[
<div>Model: <?php echo $product['model']; ?></div>
]]></add>
</operation>
</file>
</modification>
---
PS: And here is another VqMod, to display the
Manufacturer the same way in the Category Section:
viewtopic.php?f=182&t=170072&p=645254#p645254
---