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:
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 />';
}
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:
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';
TO:
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 />';
}
To customize the design - just use the template or Phoca Cart CSS. You can change the size of the thumbnails too:
FROM:
Code: Select all
$image = PhocacartImage::getThumbnailName($this->t['pathcat'], $v->image, 'medium');
TO:
Code: Select all
$image = PhocacartImage::getThumbnailName($this->t['pathcat'], $v->image, 'small');
Jan