Hi,
How can I make my subcategories like my category page with thumbnails and view category button ?
Ty in advance
Dimitar
Subcategory Thumbnail
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Subcategory Thumbnail
Hi, sorry, I don't understand, subcategories have the same view like categories - the only one difference is that the back (up) button goes to parent category not to categories view
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 2
- Joined: 24 Mar 2016, 04:19
Re: Subcategory Thumbnail
Hi , thank you for your response ,the problemis this - in my prime category view is good you can see in the picture
http://imgur.com/0ZgcUcy
but when i go to subcategories ,it is like this
http://imgur.com/so15gUw
all categories and subcaterogies are made the same , and all of them have image
Ty
Dimitar
http://imgur.com/0ZgcUcy
but when i go to subcategories ,it is like this
http://imgur.com/so15gUw
all categories and subcaterogies are made the same , and all of them have image
Ty
Dimitar
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Subcategory Thumbnail
Hi, there is categories view - which display categories - when you go to category view, subcategories displayed here are not displayed in the category view like categories in categories view. This needs to be customized
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 1
- Joined: 21 Feb 2018, 16:09
Re: Subcategory Thumbnail
Hi!
I have same problem, how can i customize?
Thanks!
I have same problem, how can i customize?
Thanks!
-
- Phoca Member
- Posts: 12
- Joined: 25 May 2017, 17:18
Re: Subcategory Thumbnail
Hi. I have the same problem. How can I customize? Thank you
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Subcategory Thumbnail
Hi, you can edit the output or override the Phoca Cart component output with your template:
components\com_phocacart\views\category\tmpl\default_header.php
This part displays the subcategories:
If you want to display images there, the model must be customized (I will add this change to next version, so this will be no needed in future)
components\com_phocacart\models\category.php - line cca 238
FROM:
TO:
Example - the following code is a modification of above code to display image inside a tag (link to subcategory):
To customize the design - just use the template or Phoca Cart CSS. You can change the size of the thumbnails too:
FROM:
TO:
Jan
components\com_phocacart\views\category\tmpl\default_header.php
This part displays the subcategories:
Code: Select all
if (!empty($this->subcategories) && (int)$this->t['cv_display_subcategories'] > 0) {
echo '<div class="ph-subcategories">'.JText::_('COM_PHOCACART_SUBCATEGORIES') . ':</div>';
echo '<ul>';
$j = 0;
foreach($this->subcategories as $v) {
if ($j == (int)$this->t['cv_display_subcategories']) {
break;
}
echo '<li><a href="'.JRoute::_(PhocacartRoute::getCategoryRoute($v->id, $v->alias)).'">'.$v->title.'</a></li>';
$j++;
}
echo '</ul>';
echo '<hr />';
}
components\com_phocacart\models\category.php - line cca 238
FROM:
Code: Select all
$columns = 'c.id, c.parent_id, c.title, c.alias, COUNT(c.id) AS numdoc';
$groupsFull = 'c.id, c.parent_id, c.title, c.alias';
Code: Select all
$columns = 'c.id, c.parent_id, c.title, c.alias, c.image, COUNT(c.id) AS numdoc';
$groupsFull = 'c.id, c.parent_id, c.title, c.alias, c.image';
Example - the following code is a modification of above code to display image inside a tag (link to subcategory):
Code: Select all
if (!empty($this->subcategories) && (int)$this->t['cv_display_subcategories'] > 0) {
echo '<div class="ph-subcategories">'.JText::_('COM_PHOCACART_SUBCATEGORIES') . ':</div>';
echo '<ul>';
$j = 0;
foreach($this->subcategories as $v) {
$image = PhocacartImage::getThumbnailName($this->t['pathcat'], $v->image, 'medium');
if (isset($image->rel)) {
echo '<a href="'.JRoute::_(PhocacartRoute::getCategoryRoute($v->id, $v->alias)).'"><img src="'. JURI::base(true).'/'.$image->rel.'" alt="" class="img-responsive ph-image" /></a>';
}
if ($j == (int)$this->t['cv_display_subcategories']) {
break;
}
echo '<li><a href="'.JRoute::_(PhocacartRoute::getCategoryRoute($v->id, $v->alias)).'">'.$v->title.'</a></li>';
$j++;
}
echo '</ul>';
echo '<hr />';
}
FROM:
Code: Select all
$image = PhocacartImage::getThumbnailName($this->t['pathcat'], $v->image, 'medium');
Code: Select all
$image = PhocacartImage::getThumbnailName($this->t['pathcat'], $v->image, 'small');
If you find Phoca extensions useful, please support the project