VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: matrixkiko on April 04, 2012, 08:49:29 AM

Title: Search results layout
Post by: matrixkiko on April 04, 2012, 08:49:29 AM
Hi
When searching for products, it also displays the catagory's on top of the page.
How do i disable this?
Title: Re: Search results layout
Post by: balai on April 04, 2012, 11:35:23 AM
Hi

Go to VM Configuration->Templates->and uncheck the "Show Children Category"
Title: Re: Search results layout
Post by: matrixkiko on April 04, 2012, 16:00:33 PM
thank you very much!
Title: Re: Search results layout
Post by: lipes on April 04, 2012, 16:21:15 PM
Balai: its possible to display the product final price in search results too? tks
Title: Re: Search results layout
Post by: PRO on April 04, 2012, 18:09:13 PM
Quote from: lipes on April 04, 2012, 16:21:15 PM
Balai: its possible to display the product final price in search results too? tks


Thats all that shows in mine, because I have mine setup to show only that price.

How is your price settings setup?
Title: Re: Search results layout
Post by: lipes on April 04, 2012, 18:36:01 PM
http://img684.imageshack.us/img684/4980/unt2m.png
Title: Re: Search results layout
Post by: PRO on April 04, 2012, 19:45:21 PM
lipes, what price is showing?

and make sure your category override has the most current price code.

Title: Re: Search results layout
Post by: lipes on April 04, 2012, 19:55:40 PM
oh.. sorry!! My mistake. I was talking about to show the price in search plugin - joomla search or advanced results / vm search..
(thus avoided, or not, that users do more clicks only see the product price. and improving the response time too)

My Categories are fine and show all prices impeccable!! :)
Title: Re: Search results layout
Post by: moshi on April 17, 2012, 15:48:51 PM
I have the same issue when searching for products, it also displays the categories on top of the page.

If i disable this with:

Go to VM Configuration->Templates->and uncheck the "Show Children Category"

does not show the other category levels (subcategories)!!

I'll appreciate your help!

Title: Re: Search results layout
Post by: PRO on April 17, 2012, 15:52:59 PM


What I do is wrap the childlist in an if statement

<?php
$searchnone=JRequest::getVar('keyword',0);
if (empty($searchnone)) {?>





<?php } ?>
Title: Re: Search results layout
Post by: moshi on May 01, 2012, 00:35:24 AM
Thank you but i am a beginer, could you please help me wrapping this statament to the following childlist code:


<?php
/* Show child categories */

if ( VmConfig::get('showCategory',1) ) {
   if ($this->category->haschildren) {

      // Category and Columns Counter
      $iCol = 1;
      $iCategory = 1;

      // Calculating Categories Per Row
      $categories_per_row = VmConfig::get ( 'categories_per_row', 3 );
      $category_cellwidth = ' width'.floor ( 100 / $categories_per_row );

      // Separator
      $verticalseparator = " vertical-separator";
      ?>

      <div class="category-view">

      <?php // Start the Output
      if(!empty($this->category->children)){
      foreach ( $this->category->children as $category ) {

         // Show the horizontal seperator
         if ($iCol == 1 && $iCategory > $categories_per_row) { ?>
         <div class="horizontal-separator"></div>
         <?php }

         // this is an indicator wether a row needs to be opened or not
         if ($iCol == 1) { ?>
         <div class="row">
         <?php }

         // Show the vertical seperator
         if ($iCategory == $categories_per_row or $iCategory % $categories_per_row == 0) {
            $show_vertical_separator = ' ';
         } else {
            $show_vertical_separator = $verticalseparator;
         }

         // Category Link
         $caturl = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id );

            // Show Category ?>
            <div class="category floatleft<?php echo $category_cellwidth . $show_vertical_separator ?>">
               <div class="spacer">
                  <h2>
                     <a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
                     <?php echo $category->category_name ?>
                     <br />
                     <?php // if ($category->ids) {
                        echo $category->images[0]->displayMediaThumb("",false);
                     //} ?>
                     </a>
                  </h2>
               </div>
            </div>
         <?php
         $iCategory ++;

      // Do we need to close the current row now?
      if ($iCol == $categories_per_row) { ?>
      <div class="clear"></div>
      </div>
         <?php
         $iCol = 1;
      } else {
         $iCol ++;
      }
   }
   }
   // Do we need a final closing row tag?
   if ($iCol != 1) { ?>
      <div class="clear"></div>
      </div>
   <?php } ?>
</div>
<?php }
} ?>

   <div id="bottom-pagination"><?php echo $this->vmPagination->getPagesLinks(); ?><span style="float:right"><?php echo $this->vmPagination->getPagesCounter(); ?></span></div>
</div>
<?php } ?>
Title: Re: Search results layout
Post by: PRO on May 01, 2012, 12:36:16 PM
Quote from: moshigigeis on May 01, 2012, 00:35:24 AM
Thank you but i am a beginer, could you please help me wrapping this statament to the following childlist code:


<?php
/* Show child categories */
$searchnone=JRequest::getVar('keyword',0);

if ( VmConfig::get('showCategory',1) ) && (empty($searchnone)) {
   if ($this->category->haschildren) {

      // Category and Columns Counter
      $iCol = 1;
      $iCategory = 1;

      // Calculating Categories Per Row
      $categories_per_row = VmConfig::get ( 'categories_per_row', 3 );
      $category_cellwidth = ' width'.floor ( 100 / $categories_per_row );

      // Separator
      $verticalseparator = " vertical-separator";
      ?>

      <div class="category-view">

      <?php // Start the Output
      if(!empty($this->category->children)){
      foreach ( $this->category->children as $category ) {

         // Show the horizontal seperator
         if ($iCol == 1 && $iCategory > $categories_per_row) { ?>
         <div class="horizontal-separator"></div>
         <?php }

         // this is an indicator wether a row needs to be opened or not
         if ($iCol == 1) { ?>
         <div class="row">
         <?php }

         // Show the vertical seperator
         if ($iCategory == $categories_per_row or $iCategory % $categories_per_row == 0) {
            $show_vertical_separator = ' ';
         } else {
            $show_vertical_separator = $verticalseparator;
         }

         // Category Link
         $caturl = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id );

            // Show Category ?>
            <div class="category floatleft<?php echo $category_cellwidth . $show_vertical_separator ?>">
               <div class="spacer">
                  <h2>
                     <a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
                     <?php echo $category->category_name ?>
                     <br />
                     <?php // if ($category->ids) {
                        echo $category->images[0]->displayMediaThumb("",false);
                     //} ?>
                     </a>
                  </h2>
               </div>
            </div>
         <?php
         $iCategory ++;

      // Do we need to close the current row now?
      if ($iCol == $categories_per_row) { ?>
      <div class="clear"></div>
      </div>
         <?php
         $iCol = 1;
      } else {
         $iCol ++;
      }
   }
   }
   // Do we need a final closing row tag?
   if ($iCol != 1) { ?>
      <div class="clear"></div>
      </div>
   <?php } ?>
</div>
<?php }
} ?>

   <div id="bottom-pagination"><?php echo $this->vmPagination->getPagesLinks(); ?><span style="float:right"><?php echo $this->vmPagination->getPagesCounter(); ?></span></div>
</div>
<?php } ?>



U can try that

I just modified this

<?php
/* Show child categories */
$searchnone=JRequest::getVar('keyword',0);

if ( VmConfig::get('showCategory',1) ) && (empty($searchnone)) {