News:

Looking for documentation? Take a look on our wiki

Main Menu

Related products not showing

Started by hibiscus, November 24, 2011, 04:55:34 AM

Previous topic - Next topic

hibiscus

I'm trying to get related products to show but although the heading gets displayed the actual product data is blank.

Here's the code:

<?php if (!empty($this->product->customfieldsRelatedProducts)) { ?>
       <h3><?php echo JText::_('COM_VIRTUEMART_RELATED_PRODUCTS'?></h3>
      <?php
      
foreach ($this->product->customfieldsRelatedProducts as $field) { ?>

      <div style="display:inline-block;" class="product-field product-field-type-<?php echo $field->field_type ?>">
         <span class="product-field-display"><?php echo $field->display ?></span>
         <span class="product-field-desc"><?php echo jText::_($field->custom_field_desc?></span>
         </div>
      <?php 
   } 
// Product customfieldsRelatedProducts END
?>

  </div>


If I actually look at what the contents of the $field variables are all I'm seeing is blank data:

object(stdClass)#182 (17) {
  ["virtuemart_custom_id"]=>
  string(1) "1"
  ["custom_parent_id"]=>
  string(1) "0"
  ["admin_only"]=>
  string(1) "0"
  ["custom_title"]=>
  string(31) "COM_VIRTUEMART_RELATED_PRODUCTS"
  ["custom_tip"]=>
  string(35) "COM_VIRTUEMART_RELATED_PRODUCTS_TIP"
  ["value"]=>
  string(0) ""
  ["custom_field_desc"]=>
  string(36) "COM_VIRTUEMART_RELATED_PRODUCTS_DESC"
  ["field_type"]=>
  string(1) "R"
  ["is_list"]=>
  string(1) "0"
  ["is_hidden"]=>
  string(1) "0"
  ["published"]=>
  string(1) "1"
  ["virtuemart_customfield_id"]=>
  string(1) "5"
  ["custom_value"]=>
  string(3) "156"
  ["custom_param"]=>
  string(0) ""
  ["custom_price"]=>
  NULL
  ["ordering"]=>
  string(1) "0"
  ["display"]=>
  string(0) ""


Am I doing something wrong or is VM somehow getting bad data for the related products?

Thanks for your help.

JtouchMobile.com

Did you set related products for the product with you are viewing/debugging?
It is fine with my end, VM 1.9.8 RC2M + J1.7.3
Author of Jtouch - Mobile solution for Joomla & VirtueMart
http://www.jtouchmobile.com

hibiscus

Quote from: MobileMeWs on November 24, 2011, 08:05:46 AM
Did you set related products for the product with you are viewing/debugging?
It is fine with my end, VM 1.9.8 RC2M + J1.7.3

Sorry for the very long delayed response.  Thanks for the suggestion.  Yes, the related products are set in the database.  If I browse to the product in the back end I see the related products but in the template I get nothing displaying.

deejayM

Hi


Was a solution for this found , I have exactly the same problem.

Joomla! 2.5.6
virtuemart 2.0.8c 

any ideas on a fix ?