Move the categories above text

  • Posts: 234
  • Thank you received: 4
12 years 2 months ago #61234

Hello,

I have tried to find it but can't how I can move the sub categories on the above text which is written on the main category.

Many Thanks
Iain

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
12 years 2 months ago #61238

Hi

Edit the view "Category / listing" in HikaShop > Display > Views.

And put the code:

    if($this->params->get('show_description',1)&&!empty($this->element->category_description)){
      ?>
      <div class="hikashop_category_description_content">
      <?php echo JHTML::_('content.prepare',$this->element->category_description); ?>
      </div>
      <?php
    }?>

At the end of the code.

Please Log in or Create an account to join the conversation.

  • Posts: 234
  • Thank you received: 4
12 years 2 months ago #61244

Hello,

I have done that and there is no change.

For an example please visit

www.draganfly.co.uk/index.php/ariel/cate...electrical-equipment

I would like the categories above the text.

Many Many thanks
Iain

<?php
/**
* @package HikaShop for Joomla!
* @version 1.5.4
* @author hikashop.com
* @copyright (C) 2010-2011 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?>
<div id="<?php echo $this->params->get('main_div_name');?>" class="hikashop_category_information hikashop_categories_listing_main">
<?php
if(version_compare(JVERSION,'1.6','<')){
$title = 'show_page_title';
}else{
$title = 'menu_text';
}
if($this->module){
$title = 'showtitle';
}
if($this->params->get($title) && JRequest::getVar('hikashop_front_end_main',0)){
?>
<h1>
<?php echo $this->params->get('page_title'); ?>
</h1>
<?php
}
if(!$this->module){
if(($this->params->get('show_image') && !empty($this->element->file_path))|| ($this->params->get('show_description')&&!empty($this->element->category_description))){
?>
<div class="hikashop_category_description">
<?php
if($this->params->get('show_image') && !empty($this->element->file_path)){
jimport('joomla.filesystem.file');
if(JFile::exists($this->image->getPath($this->element->file_path,false))){
?>
<img src="<?php echo $this->image->getPath($this->element->file_path); ?>" class="hikashop_category_image"/>
<?php
}
}
if($this->params->get('show_description')&&!empty($this->element->category_description)){
?>
<div class="hikashop_category_description_content">
<?php echo JHTML::_('content.prepare',$this->element->category_description); ?>
</div>
<?php
}
?>
</div>
<?php
}
if(!empty($this->fields)){ ?>
<div id="hikashop_category_custom_info_main" class="hikashop_category_custom_info_main">
<h4><?php echo JText::_('CATEGORY_ADDITIONAL_INFORMATION');?></h4>
<table width="100%">
<?php
$this->fieldsClass->prefix = '';
foreach($this->fields as $fieldName => $oneExtraField) {
if(!empty($this->element->$fieldName)){ ?>
<tr class="hikashop_category_custom_<?php echo $oneExtraField->field_namekey;?>_line">
<td class="key">
<span id="hikashop_category_custom_name_<?php echo $oneExtraField->field_id;?>" class="hikashop_category_custom_name">
<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
</span>
</td>
<td>
<span id="hikashop_category_custom_value_<?php echo $oneExtraField->field_id;?>" class="hikashop_category_custom_value">
<?php echo $this->fieldsClass->show($oneExtraField,$this->element->$fieldName); ?>
</span>
</td>
</tr>
<?php }
}?>
</table>
</div>
<?php }
}
$layout_type = $this->params->get('layout_type');
if($layout_type=='table') $layout_type = 'div';
$html = $this->loadTemplate($layout_type);
if(!empty($html)) echo '<div class="hikashop_subcategories_listing">'.$html.'</div>';
if(!$this->module){
if(!empty($this->modules)){
$html = '';
jimport('joomla.application.module.helper');
foreach($this->modules as $module){
$html .= JModuleHelper::renderModule($module);
}
if(!empty($html)){
echo '<div class="hikashop_submodules" style="clear:both">'.$html.'</div>';
}

}
}

</div>
if($this->params->get('show_description',1)&&!empty($this->element->category_description)){
?>
<div class="hikashop_category_description_content">
<?php echo JHTML::_('content.prepare',$this->element->category_description); ?>
</div>
<?php
}?>

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
12 years 2 months ago #61248

You need to cut and paste the code, not just copy it.

Are you sure that you edit the file in the good template ?

Please Log in or Create an account to join the conversation.

  • Posts: 234
  • Thank you received: 4
12 years 2 months ago #61259

Well, I put the code as written at the bottom but it then came up with error in Line 104 since ?> and </div> were in twice, so I removed them. I am editing category / listing.php

When I remove the extra bits of code the page loads but the footer jumps to the top..
www.draganfly.co.uk/index.php/ariel/cate...electrical-equipment

Thank you for your very quick reply.

Yours
Iain

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
12 years 2 months ago #61277

I think that one tag is missing, that's why the footer jump to the top.

Your code need to be like:

<?php
/**
 * @package    HikaShop for Joomla!
 * @version    1.5.9
 * @author    hikashop.com
 * @copyright  (C) 2010-2012 HIKARI SOFTWARE. All rights reserved.
 * @license    GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>
<?php
ob_start();
if(version_compare(JVERSION,'1.6','<')){
  $title = 'show_page_title';
}else{
  $title = 'show_page_heading';
}
$titleType='h1';
if($this->module){
  $title = 'showtitle';
  $titleType='h2';
}
if($this->params->get($title) && JRequest::getVar('hikashop_front_end_main',0)){
  ?>
  <<?php echo $titleType; ?>>
  <?php echo $this->params->get('page_title'); ?>
  </<?php echo $titleType; ?>>
  <?php
}
if(!$this->module){
  if(($this->params->get('show_image') && !empty($this->element->file_path))|| ($this->params->get('show_description')&&!empty($this->element->category_description))){
    ?>
    <div class="hikashop_category_description">
    <?php
    if($this->params->get('show_image') && !empty($this->element->file_path)){
      jimport('joomla.filesystem.file');
      if(JFile::exists($this->image->getPath($this->element->file_path,false))){
      ?>
      <img src="<?php echo $this->image->getPath($this->element->file_path); ?>" class="hikashop_category_image"/>
      <?php
      }
    }
    ?>
    </div>
  <?php
  }
  if(!empty($this->fields)){ ?>
    <div id="hikashop_category_custom_info_main" class="hikashop_category_custom_info_main">
      <h4><?php echo JText::_('CATEGORY_ADDITIONAL_INFORMATION');?></h4>
      <table width="100%">
      <?php
      $this->fieldsClass->prefix = '';
      foreach($this->fields as $fieldName => $oneExtraField) {
        if(!empty($this->element->$fieldName)){ ?>
        <tr class="hikashop_category_custom_<?php echo $oneExtraField->field_namekey;?>_line">
          <td class="key">
            <span id="hikashop_category_custom_name_<?php echo $oneExtraField->field_id;?>" class="hikashop_category_custom_name">
              <?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
            </span>
          </td>
          <td>
            <span id="hikashop_category_custom_value_<?php echo $oneExtraField->field_id;?>" class="hikashop_category_custom_value">
              <?php echo $this->fieldsClass->show($oneExtraField,$this->element->$fieldName); ?>
            </span>
          </td>
        </tr>
      <?php }
        }?>
      </table>
    </div>
<?php }
}
$layout_type = $this->params->get('layout_type');
if(empty($layout_type) || $layout_type=='table') $layout_type = 'div';
$html = $this->loadTemplate($layout_type);
if(!empty($html)) echo '<div class="hikashop_subcategories_listing">'.$html.'</div>';
if(!$this->module){
  if(!empty($this->modules)){
    $html = '';
    jimport('joomla.application.module.helper');
    foreach($this->modules as $module){
      $html .= JModuleHelper::renderModule($module);
    }
    if(!empty($html)){
      echo '<div class="hikashop_submodules" style="clear:both">'.$html.'</div>';
    }

  }
}
$html = ob_get_clean();
if(!empty($html)){ ?>
  <div id="<?php echo $this->params->get('main_div_name');?>" class="hikashop_category_information hikashop_categories_listing_main">
    <?php echo $html; ?>
  </div>
<?php }  
    if($this->params->get('show_description',1)&&!empty($this->element->category_description)){
      ?>
      <div class="hikashop_category_description_content">
      <?php echo JHTML::_('content.prepare',$this->element->category_description); ?>
      </div>
      <?php
    }
?>

The following user(s) said Thank You: mad-q

Please Log in or Create an account to join the conversation.

  • Posts: 234
  • Thank you received: 4
12 years 2 months ago #61284

You star, many thanks

Iain

Please Log in or Create an account to join the conversation.

Time to create page: 0.074 seconds
Powered by Kunena Forum