I've searched everywhere and cant find a way to put the categories a product is filed under to show on the product page in OC2.0.3.1
There is a forum topic on it with code for v1.5x but it doesn't work for v2.0.3.1
Has anybody implemented this?
Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.
I can make a extension on the default theme.
http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension
Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme
Extra Positions PRO, Custom JavaScript, Custom CSS and others
I wasn't looking for a paid extension as such though.... but if I know the code to check and replace I would learn more. I'm learning about vqmod which is cool but the code to find to replace isn't so easy always lol.
I'm confused why categories, just like other elements don't show in the core default templates as it is.
I'm on a default template.
Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.
The code will be very similar I would think, maybe just need a slight tweak
Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.
No but the link within that post may help. It's a vqmod guide but obviously doesnt work for 2.0.3.1
http://forum.opencart.com/viewtopic.php?f=131&t=109349
Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.
Quick one though, will this show if a product is assigned to multiple categories also?
Will check it out when i get home
Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.
Thank you once again. I just dont understand why this kind of stuff is not part of the core but oh well, that's another story lol
Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.
Ernie
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>Show Linked Categories on Product page</id>
<version>1</version>
<vqmver>2.5.1</vqmver>
<author>http://www.opencart-extensions.co.uk</author>
<file name="catalog/controller/product/product.php">
<operation error="log">
<search position="after" index="1"><![CDATA[$product_info = $this->model_catalog_product->getProduct($product_id);]]></search>
<add><![CDATA[
$data['text_linked_categories'] = $this->language->get('text_linked_categories');
$query_linked_categories = $this->model_catalog_product->getCategories($product_id);
$linked_categories = array();
foreach( $query_linked_categories as $linked_category_data ) {
$linked_category = $this->model_catalog_category->getCategory($linked_category_data['category_id']);
$linked_category_info['id'] = $linked_category_data['category_id'];
$linked_category_info['href'] = $this->url->link('product/category', 'path=' . $linked_category_data['category_id']);
$linked_category_info['name'] = $linked_category['name'];
$linked_categories[] = $linked_category_info;
}
]]></add>
</operation>
<operation error="log">
<search position="before"><![CDATA[$data['manufacturer'] = $product_info['manufacturer'];]]></search>
<add><![CDATA[
$data['linked_categories'] = $linked_categories;
]]></add>
</operation>
</file>
<file name="catalog/language/*/product/product.php">
<operation error="log">
<search position="before"><![CDATA[$_['text_manufacturer']]]></search>
<add><![CDATA[
$_['text_linked_categories'] = 'Categories:';
]]></add>
</operation>
</file>
<file name="catalog/view/theme/*/template/product/product.tpl">
<operation error="log">
<search position="before"><![CDATA[<li><?php echo $text_model; ?> <?php echo $model; ?></li>]]></search>
<add><![CDATA[
<?php if( $linked_categories ){ ?>
<li><?php echo $text_linked_categories; ?>
<?php foreach( $linked_categories as $linked_category ){ ?>
<a href="<?php echo $linked_category['href']; ?>"><?php echo $linked_category['name']; ?></a>
<?php } ?>
</li>
<?php } ?>
]]></add>
</operation>
</file>
</modification>
to be seen here momentarely (only, because I use another Mod for this!

http://www.bigmax.ch/oc22/index.php?rou ... duct_id=40
---
My Github OC Site: https://github.com/IP-CAM
5'000 + FREE OC Extensions, on the World's largest Github OC Repository Archive Site.
Usually, those, who cannot live, without belonging to the TOP, have to pay,dharam81 wrote:This seems not working on 2.3.0.2 version, any update please?
to keep their Frontrunner-Status

Ernie
My Github OC Site: https://github.com/IP-CAM
5'000 + FREE OC Extensions, on the World's largest Github OC Repository Archive Site.
download and enjoy


Cheers
Attachments
Ernie's rewrote code
Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here
Users browsing this forum: No registered users and 1 guest