VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: jurismai on December 22, 2011, 08:25:22 AM

Title: Customfields on category view?
Post by: jurismai on December 22, 2011, 08:25:22 AM
Is it possible to show custom fields on the categoy view? Just copy & paste from productdetails does not work.

Thanks
Title: Re: Customfields on category view?
Post by: PRO on December 22, 2011, 11:04:34 AM
product details uses $this->   which will not work on product in category


Look in the product module and get the code.
Title: Re: Customfields on category view?
Post by: jurismai on December 22, 2011, 12:12:01 PM
That's it! I just removed $this-> and it works...

Thank you!
Title: Re: Customfields on category view?
Post by: nnoufal on February 07, 2012, 06:52:25 AM
How can add age field in Catgory admin page?
Title: Re: Customfields on category view?
Post by: Eddzor on February 14, 2012, 13:07:16 PM
What is the code to copy? I have realy tried but cant get it to work
Title: Re: Customfields on category view?
Post by: webbits on December 06, 2012, 02:24:08 AM
Please tell us what code?  And where to paste? 

What I pasted into category default.php trying various lines without using $this->.  From another forum $get -> was tried.  Nothing worked.  Please help!  Thank you.


         <?php // Display the quantity box ?>
         <!-- <label for="quantity<?php echo $this->product->virtuemart_product_id;?>" class="quantity_box"><?php echo JText::_('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label> -->
         <span class="quantity-box">
            <input  type="text" class="quantity-input" name="quantity[]" value="1" />
         </span>
         <span class="quantity-controls">
            <input type="button" class="quantity-controls quantity-plus" />
            <input type="button" class="quantity-controls quantity-minus" />
         </span>
         <?php // Display the quantity box END ?>
         
          <?php // Display Custom Fields ?>
          
              <?php


    if (!empty($this->product->customfieldsSorted['ontop'])) {

   $this->position = 'ontop';

   echo $this->loadTemplate('customfields');

    } // Product Custom ontop end

    ?>
   
       <?php // Display Custom Fields2 ?>
   
      <?php
    if (!empty($this->product->customfieldsSorted['normal'])) {


   echo $this->loadTemplate('customfields');

    } // Product custom_fields END      ?>
Title: Re: Customfields on category view?
Post by: bytelord on December 06, 2012, 09:02:42 AM
http://forum.virtuemart.net/index.php?topic=104557.0
https://forum.virtuemart.net/index.php?topic=100191.0