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();
Code: Select all
'model' => $result['model'],
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
Thank you very much for your helpKenberne1965 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 theand insertCode: Select all
$data['products'][] = array();
after the product_id variable assignment.Code: Select all
'model' => $result['model'],
it can then be accessed in the category.tpl file as
$product['model'] anywhere after the $products foreach statement.
Hope that Helps
I will give this a try and report back.
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
VQmod is great and it is the way to do it properly, but its also good to know how the code worksviethemes 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
Freelance Opencart 1.5.x and 2.x Developer - Available For Hire
Latest Opencart 2 Project --> http://www.falcon-rangecookers.co.uk
--- please reply only with verified data, that is: no 'I think', 'maybe' etc. ---
Please make sure you are add codedharam81 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
Code: Select all
'model' => $result['model'],
Code: Select all
$data['products'][] = array(
$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"> <?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
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>
EITHER this Line: (J.v.2.2.x)
Code: Select all
<search><![CDATA[<div class="description"><?php echo $product['description']; ?></div>]]></search>
Code: Select all
<search><![CDATA[<p class="description"><?php echo $product['description']; ?></p>]]></search>
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']
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...!
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.
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.
Users browsing this forum: No registered users and 3 guests