News:

Looking for documentation? Take a look on our wiki

Main Menu

display custom field in sublayouts/products.php?

Started by baggiesmad, March 23, 2016, 23:02:49 PM

Previous topic - Next topic

baggiesmad

I'm trying to display a certain custom field within the template sublayouts/products.php.

I've tried the following:
<?php
echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'wpayments'));
?>


But it doesn't work and breaks the page.

Can anyone help?

Jumbo!

Products sub-layout does not have any property called "$this->product". You need to call the custom fields sub-layout within "foreach ($products as $product)" loop as below:

<?php echo shopFunctionsF::renderVmSubLayout('customfields', array('product' => $product'position' => 'wpayments')); ?>