Hi Everyone,
Need your help, please. I am doing a site for a hair company which has colour charts for each product. I bought a commercial template. What I am trying to do:
I am trying to create an extra tab that will display a colour chart per product. There are currently two tabs namely "Description" and "Comment and Reviews"
I managed to look at the code and added an extra tab called colour chart.
I also created a custom field called "Col_Prod" which is of image type.
What I need to do now is to display that image in the added colour chart tab. I hope this is clearly described :)
Here is the code:
<div class="Fly-tabs">
<?php
jimport('joomla.html.pane');
$myTabs = & JPane::getInstance('tabs', array('startOffset'=>0));
$output = '';
$output .= $myTabs->startPane( 'pane' );
if ($this->product->product_desc) {
$output .= $myTabs->startPanel( JText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE') , 'tab1' );
$output .= '<div class="desc">' .$this->product->product_desc.'</div>';
$output .= $myTabs->endPanel();
}
if ($this->product->product_desc) {
$output .= $myTabs->startPanel( JText::_('Colour Chart') , 'tab2' );
$output .= '<div>' .$this->product->??????????</div>'; # <-----Dont know what to put in here to display that custom field <--------
$output .= $myTabs->endPanel();
}
if ($this->loadTemplate('reviews')) {
$output .= $myTabs->startPanel( JText::_('Comments and Reviews') , 'tab3' );
$output .= '<div>'.$this->loadTemplate('reviews').'</div>'.'<div>'.$this->product->event->afterDisplayContent.'</div>';
$output .= $myTabs->endPanel();
}
if (!empty($this->product->customfieldsRelatedCategories)) {
$output .= $myTabs->startPanel( JText::_('COM_VIRTUEMART_RELATED_CATEGORIES') , 'tab4' );
$output .= '<div style="overflow:hidden;">'. $this->loadTemplate('relatedcategories') .'</div>';
$output .= $myTabs->endPanel();
} // Product customfieldsRelatedCategories END
// Show child categories
if ($this->loadTemplate('showcategory')) {
$output .= $myTabs->startPanel( '<span>Subcategory</span>', 'tab5' );
$output .= '<div>'. $this->loadTemplate('showcategory') .'</div>';
$output .= $myTabs->endPanel();
}
$output .= $myTabs->startPanel( 'Video', 'tab6' );
$output .= '<div class="desc2">' .$this->product->product_desc.'</div>';
$output .= $myTabs->endPanel();
$output .= $myTabs->endPane();
echo $output;
?>
</div>
Can anyone please help. I have very very limited experience in coding, but do have a good development background.
Thanks
Hi
in your custom field settings put this in the layout position field: Col_Prod
And here the template code:
<div class="Fly-tabs">
<?php
jimport('joomla.html.pane');
$myTabs = & JPane::getInstance('tabs', array('startOffset'=>0));
$output = '';
$output .= $myTabs->startPane( 'pane' );
if ($this->product->product_desc) {
$output .= $myTabs->startPanel( JText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE') , 'tab1' );
$output .= '<div class="desc">' .$this->product->product_desc.'</div>';
$output .= $myTabs->endPanel();
}
if ($this->product->product_desc) {
$output .= $myTabs->startPanel( JText::_('Colour Chart') , 'tab2' );
$this->position='Col_Prod';
$output .= '<div>' . $this->loadTemplate('customfields') . '</div>';
$output .= $myTabs->endPanel();
}
if ($this->loadTemplate('reviews')) {
$output .= $myTabs->startPanel( JText::_('Comments and Reviews') , 'tab3' );
$output .= '<div>'.$this->loadTemplate('reviews').'</div>'.'<div>'.$this->product->event->afterDisplayContent.'</div>';
$output .= $myTabs->endPanel();
}
if (!empty($this->product->customfieldsRelatedCategories)) {
$output .= $myTabs->startPanel( JText::_('COM_VIRTUEMART_RELATED_CATEGORIES') , 'tab4' );
$output .= '<div style="overflow:hidden;">'. $this->loadTemplate('relatedcategories') .'</div>';
$output .= $myTabs->endPanel();
} // Product customfieldsRelatedCategories END
// Show child categories
if ($this->loadTemplate('showcategory')) {
$output .= $myTabs->startPanel( '<span>Subcategory</span>', 'tab5' );
$output .= '<div>'. $this->loadTemplate('showcategory') .'</div>';
$output .= $myTabs->endPanel();
}
$output .= $myTabs->startPanel( 'Video', 'tab6' );
$output .= '<div class="desc2">' .$this->product->product_desc.'</div>;
$output .= $myTabs->endPanel();
$output .= $myTabs->endPane();
echo $output;
?>
</div>
Regards Maik