VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Kiku on January 19, 2012, 11:58:03 AM

Title: Products in more than one category. Display cats?
Post by: Kiku on January 19, 2012, 11:58:03 AM
What about showing product categories on product page?

If I put in \templates\SOMETEMPLATE\html\com_virtuemart\productdetails\default.php

<?php echo $this->product->category_name ?>

it will show only one category a praduct is assigned to, I have many products which are included in two or even three categories.

Please someone figure it out, I've found a guide for VM 1.1.x (http://forum.virtuemart.net/index.php?topic=46439.0 (http://forum.virtuemart.net/index.php?topic=46439.0)) but obviously it doesn't work for VM 2.0

Thank you for any advice!
Title: Re: Products in more than one category. Display cats?
Post by: PRO on January 19, 2012, 13:28:31 PM
you could use the related categories file for this, but you would have to do it manually.
Title: Re: Products in more than one category. Display cats?
Post by: Kiku on January 19, 2012, 14:25:02 PM
Quote from: BanquetTables.pro on January 19, 2012, 13:28:31 PM
you could use the related categories file for this, but you would have to do it manually.

Thank you for your reply. That's some kind of solution, but as you said... manually. That's not the point. I'm sure someone who knows enough php language and VM can write that kind of modification. It's just the matter of time spent on it. I know very basics of whole structure of Joomla and VM - I'm a 100% beginner, so simply I can't do it  :-[ I even don't  know in which file functions are stored for the front end of shop  >:(
Title: Re: Products in more than one category. Display cats?
Post by: Kiku on January 22, 2012, 21:42:44 PM
Come on guys, anyone? Thought VM has bigger community :( Or maybe my question isn't correct? I'll donate if it's necessary.
Title: Re: Products in more than one category. Display cats?
Post by: bettondesign on February 20, 2012, 15:08:48 PM
I am also looking for the answer to this. This should be a basic part of any e-commerce framework.

I have used:
<?php echo $this->category->category_name?>
and
<?php echo $this->product->category_name?>
But they both give the same result. This seems to work in the same way as breadcrumbs in so far as it will display the category depending on how you navigate to the product.

If I find the answer I will post it here.
Title: Re: Products in more than one category. Display cats?
Post by: PRO on February 20, 2012, 15:14:41 PM
for the main category, the answer is here
http://forum.virtuemart.net/index.php?topic=92756.0

its the last code in 1st post
Title: Re: Products in more than one category. Display cats?
Post by: bettondesign on March 29, 2012, 11:26:39 AM
Still having no luck with this. It seems like it should be such as simple thing to fix but it's looking impossible.