Hi there!
I need to display additional images at category pages. How do I do that? Normally default template doesn't display even a main image of category.
The minimum code is :
echo $this->category->images[0]->displayMediaThumb("",false);
in JOOMLAROOT\components\com_virtuemart\views\category\tmpl\default.php
or better in your template do an overide in
YOURTEMPLATE\html\com_virtuemart\category\default.php
Note : some stupid framework can have other subfolders, eg.warp framework used by yootheme, can have 3 or 4 subfolders, i searched 2 hours last day, because vmuikit now add own folder too for layout file overides.
Thank you. But it this code allowed me to display only main image. Additional images still doesn't work :'(
I think you must first get all the images because they are not available by default
$catModel = VmModel::getModel('Category');
$catModel->addImages($categories);
then echo the images
foreach ($category->images as $image) {
echo $image->displayMediaThumb("",false);
}
<?php
$catModel = VmModel::getModel('Category');
$catModel->addImages($categories);
foreach ($category->images as $image) {
echo $image->displayMediaThumb("",false);
}
?>
Like that? It doesn't work :(
Also I want them to be displayed like images in product - main image on top and additional images below. As I understand there should be separated code to do that?
Have you try my code?
echo $this->category->images[0]->displayMediaThumb("",false);
Quote from: Studio 42 on December 21, 2016, 09:46:48 AM
Have you try my code?
echo $this->category->images[0]->displayMediaThumb("",false);
Yes. I wrote you an answer above - it shows main image, but doesn't show additionals.
SO you have to mix my code with Tkheun code, this is the simplified code
<?php
$catModel = VmModel::getModel('Category');
$catModel->addImages($this->category);
foreach ($this->category->images as $image) {
echo $image->displayMediaThumb("",false);
}
?>
I appreciate your help! This time it worked. This is how it displayed images: http://igc.oscargo.ru/catalog/split-sistemy/comfort (http://igc.oscargo.ru/catalog/split-sistemy/comfort) and this is how I need it to be http://igc.oscargo.ru/catalog/split-sistemy/comfort/ras-rac-07nhg-detail (http://igc.oscargo.ru/catalog/split-sistemy/comfort/ras-rac-07nhg-detail)
Could you tell me how to split the code?
See default_images.php and default_images_additional.php in /components/com_virtuemart/views/productdetails/tmpl/.
Quote from: Ghost on December 21, 2016, 11:28:15 AM
See default_images.php and default_images_additional.php in /components/com_virtuemart/views/productdetails/tmpl/.
Looked thru both files. Couldn't make it work.
Mod edit: annoying bump message removed. Please read http://forum.virtuemart.net/index.php?topic=104795.0
read my answers the last is right and file is
in JOOMLAROOT\components\com_virtuemart\views\category\tmpl\default.php
or better in your template do an overide in
YOURTEMPLATE\html\com_virtuemart\category\default.php
Note : some stupid framework can have other subfolders, eg.warp framework used by yootheme, can have 3 or 4 subfolders, i searched 2 hours last day, because vmuikit now add own folder too for layout file overides.
Quote from: Studio 42 on December 22, 2016, 08:19:47 AM
read my answers the last is right and file is
I have read your answer. Have you read mine? Especially #8 where I sad that I need to split your code?
Last time
$catModel = VmModel::getModel('Category');
$catModel->addImages($this->category);
foreach ($this->category->images as $image) {
echo $image->displayMediaThumb("",false);
}
in JOOMLAROOT\components\com_virtuemart\views\category\tmpl\default.php
or better in your template do an overide in
YOURTEMPLATE\html\com_virtuemart\category\default.php
Note : some stupid framework can have other subfolders, eg.warp framework used by yootheme, can have 3 or 4 subfolders, i searched 2 hours last day, because vmuikit now add own folder too for layout file overides.
I cannot explain better.
Quote from: Studio 42 on December 22, 2016, 20:00:43 PM
I cannot explain better.
Just leave it. If you can't get that I DID IT but IT WORKS not the way I need, just move on.
Sorry for my English. Nowhere I can not find the like. How can I implement this? thanks for answers
http://babyonline.com.ua/tmp/images_probl.jpg