News:

Looking for documentation? Take a look on our wiki

Main Menu

Customfields on category view?

Started by jurismai, December 22, 2011, 08:25:22 AM

Previous topic - Next topic

jurismai

Is it possible to show custom fields on the categoy view? Just copy & paste from productdetails does not work.

Thanks

PRO

product details uses $this->   which will not work on product in category


Look in the product module and get the code.

jurismai

That's it! I just removed $this-> and it works...

Thank you!

nnoufal

How can add age field in Catgory admin page?

Eddzor

What is the code to copy? I have realy tried but cant get it to work

webbits

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      ?>

bytelord

Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!