News:

Looking for documentation? Take a look on our wiki

Main Menu

How to show custom field in product list

Started by salim, July 23, 2012, 07:40:35 AM

Previous topic - Next topic

salim

Hi

I creat custom field and they are only  in product details's page. how can I show them in list of product in category view?

salim

Any idea?

I found This code but it only work in product details, not in category.


<div id="warranty-text"><strong>This is the Warranty Div</strong>
<?php if (!empty($this->product->customfieldsSorted['warranty'])) {
   $this->position='warranty';
   echo $this->loadTemplate('customfields'); } ?></div>

This code is in this forum:
http://forum.virtuemart.net/index.php?topic=99225.0

_stu

After much searching and trying lots of different suggestions, this is what worked for me.

Question: How to add custom fields to the category page?
Answer: From http://forum.virtuemart.net/index.php?topic=99225.msg344246#msg344246
<?php $custom_title null
if (!empty(
$product->customfields)) {
foreach (
$product->customfields as $field) {
if (
$field->is_hidden //OSP http://forum.virtuemart.net/index.php?topic=99320.0
continue;
if (
$field->display) { ?>

<span class="product-field-display"><?php echo $field->display ?></span>
<?php ?> <?php ?> <?php }  ?>


Thank you, lipes!