Post by longcount » Thu Jul 23, 2015 5:48 pm

Hello

I am using Opencart Version 2.0.3.1 and the Journal 2.5.4 theme.

I want to display model number/reference on category grid and list view under product image and description.

I wondered if this is possible?

Thanks in advance :)

Newbie

Posts

Joined
Thu Jul 23, 2015 5:44 pm

Post by Kenberne1965 » Thu Jul 23, 2015 8:55 pm

Anything is possible ;)

Im not sure how advanced you are? but you would need to edit the catalog/controller/product/category.php file and look for the

Code: Select all

$data['products'][] = array(); 
and insert

Code: Select all

'model' 	  => $result['model'],
after the product_id variable assignment.

it can then be accessed in the category.tpl file as

$product['model'] anywhere after the $products foreach statement.

Hope that Helps

Freelance Opencart 1.5.x and 2.x Developer - Available For Hire
Latest Opencart 2 Project --> http://www.falcon-rangecookers.co.uk


User avatar
Active Member

Posts

Joined
Wed Apr 22, 2015 9:37 pm
Location - Doncaster, UK

Post by longcount » Thu Jul 23, 2015 9:01 pm

Kenberne1965 wrote:Anything is possible ;)

Im not sure how advanced you are? but you would need to edit the catalog/controller/product/category.php file and look for the

Code: Select all

$data['products'][] = array(); 
and insert

Code: Select all

'model' 	  => $result['model'],
after the product_id variable assignment.

it can then be accessed in the category.tpl file as

$product['model'] anywhere after the $products foreach statement.

Hope that Helps
Thank you very much for your help :)

I will give this a try and report back.

Newbie

Posts

Joined
Thu Jul 23, 2015 5:44 pm

Post by viethemes » Thu Jul 23, 2015 9:10 pm

I have made a VQMOD extension to do that. You can download it here: https://www.dropbox.com/s/njh8ligmordw2 ... t.xml?dl=0.
No need to modify core files directly :)

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


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by longcount » Thu Jul 23, 2015 9:34 pm

Thank you to both of you :)

Newbie

Posts

Joined
Thu Jul 23, 2015 5:44 pm

Post by Kenberne1965 » Fri Jul 24, 2015 7:12 am

viethemes wrote:I have made a VQMOD extension to do that. You can download it here: https://www.dropbox.com/s/njh8ligmordw2 ... t.xml?dl=0.
No need to modify core files directly :)
VQmod is great and it is the way to do it properly, but its also good to know how the code works ;D

Freelance Opencart 1.5.x and 2.x Developer - Available For Hire
Latest Opencart 2 Project --> http://www.falcon-rangecookers.co.uk


User avatar
Active Member

Posts

Joined
Wed Apr 22, 2015 9:37 pm
Location - Doncaster, UK

Post by michael2820 » Fri Feb 19, 2016 2:55 am

Viethemes: thank you very much. And the visitor (and I) can search "model" in the main search function, great.

--- please reply only with verified data, that is: no 'I think', 'maybe' etc. ---


User avatar
Active Member

Posts

Joined
Sun May 15, 2011 8:16 pm
Location - Denmark ver. 2.1.0.2

Post by dharam81 » Sat Oct 08, 2016 5:04 am

Hi All.

i am trying to implement this but getting error for my category grid/list product page:

Notice: Undefined index: model in template/product/category.tpl on line 147

any suggestion to fix this please?

My Ver is 2.3.0.2

Active Member

Posts

Joined
Mon Apr 30, 2012 8:26 pm

Post by opencartboost » Sat Oct 08, 2016 7:40 am

dharam81 wrote:Hi All.

i am trying to implement this but getting error for my category grid/list product page:

Notice: Undefined index: model in template/product/category.tpl on line 147

any suggestion to fix this please?

My Ver is 2.3.0.2
Please make sure you are add code

Code: Select all

'model'		  => $result['model'],
after

Code: Select all

$data['products'][] = array(

Active Member

Posts

Joined
Thu Jul 09, 2015 5:59 am

Post by dharam81 » Sat Oct 08, 2016 2:46 pm

catalog/controller/product/category.php

$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'model' => $result['model'],

catalog/view/theme/journal2/template/product/category.tpl

<div class="product-details">
<div class="caption">
<h4 class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></h4>
<h5 class="model">&nbsp;<?php echo $product['model']; ?></h5>
<p class="description"><?php echo $product['description']; ?></p>

Front End Error :
Notice: Undefined index: model in
catalog/view/theme/journal2/template/product/category.tpl on line 147

Active Member

Posts

Joined
Mon Apr 30, 2012 8:26 pm

Post by opencartboost » Sat Oct 08, 2016 4:00 pm

Try clear cache. If still doesn't work please contact theme developer. Should be easy for him.

Active Member

Posts

Joined
Thu Jul 09, 2015 5:59 am

Post by dharam81 » Sat Oct 08, 2016 4:25 pm

Thanks its working now i think it was cache issue post change

cheers

Active Member

Posts

Joined
Mon Apr 30, 2012 8:26 pm

Post by hassanpk » Sat Oct 22, 2016 2:43 pm

Same issue Journal theme
Any Solutions some body help me

Newbie

Posts

Joined
Fri Oct 21, 2016 6:39 pm

Post by hassanpk » Sat Nov 12, 2016 1:39 pm

Thanks My issue solved I have only change Journal theme version and code.

Thanks again everybody

Newbie

Posts

Joined
Fri Oct 21, 2016 6:39 pm

Post by kinuschan » Tue Jan 10, 2017 4:53 pm

hassanpk wrote:Thanks My issue solved I have only change Journal theme version and code.

Thanks again everybody
Can you advice how to solved and change the Jornal theme version/code ?
thanks

Newbie

Posts

Joined
Sat Mar 21, 2015 9:02 pm

Post by IP_CAM » Wed Jan 11, 2017 6:39 am

Look at this little image: :laugh:
http://www.openshop.li/downloads/Model_ ... stings.jpg
and if you like, what you see, download this sectionwise built + so easy to handle OcMod:
http://www.openshop.li/downloads/show_m ... .ocmod.zip
Thanks to Viethemes, for the input!
---
To make it possibly work for (some) JOURNAL Files, in the OcMod Extension File,
find this (OC-2 Default Theme) OcMod Anchor Tag LINE , one of a few, in the Theme-Template
related lower Sections of the OcMod:

Code: Select all

<search><![CDATA[<div class="caption">]]></search>
and replace all those lines, as shown above, with:
EITHER this Line: (J.v.2.2.x)

Code: Select all

<search><![CDATA[<div class="description"><?php echo $product['description']; ?></div>]]></search>
OR then, this Line: (J.v.2.5.x)

Code: Select all

<search><![CDATA[<p class="description"><?php echo $product['description']; ?></p>]]></search>
depending on the Theme Version you use.
Whereby, the plain OcMod ANCHOR LINK TAG CODE, TO CHANGE, is:
<div class="description"><?php echo $product['description']; ?></div>
or:
<p class="description"><?php echo $product['description']; ?></p>
everything else is just part of the OcMod-Routine itself ! ;)

You can first crosscheck, by example in your ... theme ... /template/product/category.tpl, wich
one exists, probably either starting/ending with a <p ...>...</p> , or then a <div ...>...</div>
and if not, if at least some rather similar Line exists, then to be used as valid OcMod Anchor Tag Line,
by searching for:

Code: Select all

class="description"><?php echo $product['description']
In addition, and depending of, if you want to have the MODEL Display before the Description
Display, change in ALL the sections, in the xxx.tpl file-related OcMod Sections:
from:
<add position="after">
to:
<add position="before">
and you could even add an OFFSET-Value, like
<add position="before" offset="2"> (2 written or empty! lines up from the 'anchor-tag-line')
<add position="after" offset="2"> (2 written or empty! lines down from the 'anchor-tag-line')
to move it up or down one or more lines, to look and match better.
Just be careful, to so not 'inserting' it into another routine, section, or somewhere, possibly active
only under certain conditions...! 8)
Then, it should work! But you will find out, I'm sure !

And NEVER forget, if you work on VqMods or OcMods, EVERY empty (White-)SPACE / GAP
is 'handled' like/as a piece of CODE, a SEARCH Routine may never find something, if it suddently
contains anything different from what it's exactly looking for, from the beginning [ to the end ]]
<search><![CDATA[123456 654654 aabbbc qrtz]]></search>, and if you do it like this:
<search><![CDATA[ 123456 654654 aabbbc qrtz]]></search>, it can possibly never be found.
Basic Rule Number ONE!

By Nature of things, you could remove some xxx.tpl - related sections,
from <file ... > to </file> , in the OcMod, if you don't want to have the Model
Number visible on screen, where it exists by OcMod-Default !

More similar 'Functions' could be enabled, if one uses Modules, displaying other 'Selections'
of Products, but basically working the same way - by just adding one (adapted) Routine each
to the .../controller/... and the .../template/... Section of the OcMod, just to mention this.

Journal-untested, good Luck ! ;)
Ernie
Can be seen here momentarely:
http://www.jti.li/shop/

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 kinuschan » Wed Jan 11, 2017 12:40 pm

Dear IP CAM,

Thanks for your kindly reply. :)
I have installed your extension. its perfectly running on OC 2.3.0.2 and J.v.2.8.5 :good:
Thanks ;)

Newbie

Posts

Joined
Sat Mar 21, 2015 9:02 pm

Post by IP_CAM » Wed Jan 11, 2017 1:19 pm

Good for you !
Take Care... ;)
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
Who is online

Users browsing this forum: No registered users and 3 guests