Post by shields » Fri Nov 04, 2016 8:41 pm

I would like to display manufacturer field below the image and above the product name in the category grid view?

Newbie

Posts

Joined
Sat Nov 29, 2014 11:22 pm

Post by paulfeakins » Fri Nov 04, 2016 10:53 pm

Have you searched for extensions that do this?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by shields » Fri Nov 04, 2016 11:03 pm

I can find plenty of extensions that allow you to add custom fields to product display, modify the layout of fields etc..etc..but all in product display, nothing for the category grid view.

Newbie

Posts

Joined
Sat Nov 29, 2014 11:22 pm

Post by IP_CAM » Sat Nov 05, 2016 2:20 am

Strictly technically, you find your answer on this, if you check this Post.
viewtopic.php?f=182&t=170030&p=645249#p645249
---
I only changed, in the VqMod below:
1. in the category.php Line:
'model' => $result['model'],
to:
'manufacturer' => $result['manufacturer'],

2. in the category.tpl Line:
<div>Model: <?php echo $product['model']; ?></div>
to:
<div>Manufacturer: <?php echo $product['manufacturer']; ?></div>

and it should function, just like on the OC v.2.2.x - themed image shown below!
Good Luck! ;)
Ernie

VqMod: manufacturer_to_category.xml (tested on OpenCart v.2.2.x)

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<modification>
<id><![CDATA[Manufacturer Name in Category]]></id>
<version><![CDATA[1.0]]></version>
<vqmver><![CDATA[2.5.1]]></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[
   'manufacturer'  => $result['manufacturer'],
]]></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>Manufacturer: <?php echo $product['manufacturer']; ?></div>
]]></add>
</operation>
</file>   
</modification>
Last edited by IP_CAM on Tue Nov 08, 2016 10:36 am, edited 2 times in total.

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by igalsm » Tue Nov 08, 2016 10:28 am

Hi, i'm using 2.2, should it work the same way? i tried but get an error..

New member

Posts

Joined
Tue Sep 27, 2016 4:26 am

Post by IP_CAM » Tue Nov 08, 2016 10:38 am

Never just mention 'AN ERROR' again, always inform, what error occurred, otherways, there is no help! :-\
But download my latest VqMod, shown above, and make sure,
that NOT even a Single white space GAP exists, BEFORE:
<?xml version="1.0" encoding="UTF-8" ?>
It has been tested with a Default Theme OC v.2.2.x here:
http://www.jti.li

Good Luck ;)
Ernie

BUT, to be honest, I believe to have seen this as a default optional Function somewhere in the admin Section. ???

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by igalsm » Wed Nov 09, 2016 5:10 am

IP_CAM wrote:Never just mention 'AN ERROR' again, always inform, what error occurred, otherways, there is no help! :-\
But download my latest VqMod, shown above, and make sure,
that NOT even a Single white space GAP exists, BEFORE:
<?xml version="1.0" encoding="UTF-8" ?>
It has been tested with a Default Theme OC v.2.2.x here:
http://www.jti.li

Good Luck ;)
Ernie

BUT, to be honest, I believe to have seen this as a default optional Function somewhere in the admin Section. ???
Thanks for your help, there is no such option in the admin.
It works good! Is it possible to make it work in the search page? manufacturer page? specials? featured?

Thank you Very Much

New member

Posts

Joined
Tue Sep 27, 2016 4:26 am

Post by IP_CAM » Wed Nov 09, 2016 7:45 am

Sure, and you have all the knowledge, as shown in my sample Code above, and on the other Page, linked in the above Post, to, by example, make the same work, i.E., in the
search Section, as I just checked on.
You then only have to change the VqMod Content, from:

Code: Select all

<file name="catalog/controller/product/category.php">
to:

Code: Select all

<file name="catalog/controller/product/search.php">
and from:

Code: Select all

<file name="catalog/view/theme/*/template/product/category.tpl">
to:

Code: Select all

<file name="catalog/view/theme/*/template/product/search.tpl">
to likely make such work.

It's always the xxx.tpl file, in the Theme/template/... Section, in connection with it's xxx.php file, in the corresponding controller/... Section, required, to make such work!

Technically, you could add all the different Routines into one single VqMod,
or then, create one for each Task. I did not check on other Files, but at least
some of them could be 'handled' the same way, to make this Function visible,
I assume!
Good Luck ;)
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by igalsm » Sun Nov 13, 2016 11:15 pm

Hi I managed to do that even managed to add this to featured module, bestsellers and cpecials.
Only have one problem, in the bestsellers module it shows the wrong brand..
What can be the reason for that?

Thanks

New member

Posts

Joined
Tue Sep 27, 2016 4:26 am

Post by distinct » Mon Feb 19, 2018 5:40 am

i have tried to modify this for 1.5.6.4 but have not had any success I think i am missing something. would you be able to help with the code to add the manufacture name to the category list on the 1.5.6.4?
TIA

Newbie

Posts

Joined
Wed Aug 31, 2011 11:12 am

Post by IP_CAM » Mon Feb 19, 2018 2:26 pm

Well, it heavy depends on the THEME used, in my Responsive and Default 1.5.6.4+ Themes,
this VqMod works, as shown on the image below.
Good Luck! ;)
Ernie

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<modification>
<id><![CDATA[Manufacturer Name in Category]]></id>
<version><![CDATA[1.0]]></version>
<vqmver><![CDATA[2.5.1]]></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[
   'manufacturer'  => $result['manufacturer'],
]]></add>
</operation>
</file>
<file name="catalog/view/theme/*/template/product/category.tpl">
<operation error="log">
<search position="after"><![CDATA[<?php echo $product['name']; ?></a></h4>]]></search>
<add><![CDATA[
   <div>Manufacturer: <?php echo $product['manufacturer']; ?></div>
]]></add>
</operation>
</file>   
</modification>
Image

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 106 guests