Skip to main content

Add custom field to product_view

More
12 years 8 months ago #139767 by anypc
Hi, I'm trying to add the field: csv_adviesprijs to my product listing.

I'm using DIV to show the products, you can see them here: www.verfgoedkoper.nl/index.php/verf-wijz...zende-aflak-wijzonol

I would like to add the field csv_adviesprijs just above the price in the shop. So it should look thesame as when you go to the normal prduct view:
www.verfgoedkoper.nl/index.php/verf-wijz...dekkend-hoogglanslak

Adviesprijs: [strike]26,65[/strike]
19,05

How do I add the custom field?

Thanx!

Proud of my website www.hetcomputerwinkeltje.nl

Currently just running catalog mode, but hope to go live soon again :)

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #139816 by Mohamed Thelji
Hi,
The solution will probably be to edit the "listing_div" or "listing_price" file of the "product" view of your front-end template through the page "Hikashop>Display->Views" and add your custom field.

Also can you show me how did your configured your custom field so that I can have more information to help you ?.
Thank you :).
The following user(s) said Thank You: anypc

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #139820 by anypc
Hi Mohamed,
Sure!

The listing_div looks like:
Code:
<?php /** * @package HikaShop for Joomla! * @version 2.0.0 * @author hikashop.com * @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?><?php $mainDivName=$this->params->get('main_div_name'); $carouselEffect=$this->params->get('carousel_effect'); $enableCarousel=$this->params->get('enable_carousel'); $textCenterd=$this->params->get('text_center'); $this->align="left"; if($textCenterd){ $this->align="center"; } $height=$this->params->get('image_height'); $width=$this->params->get('image_width'); $borderClass=""; if($this->params->get('border_visible',1) == 1){ $borderClass="hikashop_subcontainer_border"; } if($this->params->get('border_visible',1) == 2){ $borderClass="thumbnail"; } if(empty($width) && empty($height)){ $width=$this->image->main_thumbnail_x; $height=$this->image->main_thumbnail_y; } $exists=false; if(!empty($this->rows)){ $row=reset($this->rows); if(!empty($row->file_path)){ jimport('joomla.filesystem.file'); if(JFile::exists($row->file_path)){ $exists=true; }else{ $exists=false; } } } if(!$exists){ $config = hikashop_config(); $path = $config->get('default_image'); if($path == 'barcode.png'){ $file_path=HIKASHOP_MEDIA.'images'.DS.'barcode.png'; } if(!empty($path)){ jimport('joomla.filesystem.file'); if(JFile::exists($this->image->main_uploadFolder.$path)){ $exists=true; } }else{ $exists=false; } if($exists){ $file_path=$this->image->main_uploadFolder.$path; } }else{ $file_path=$this->image->main_uploadFolder.$row->file_path; } if(!empty($file_path)){ if(empty($width)){ $imageHelper=hikashop_get('helper.image'); list($theImage->width, $theImage->height) = getimagesize($file_path); list($width, $height) = $imageHelper->scaleImage($theImage->width, $theImage->height, 0, $height); } if(empty($height)){ $imageHelper=hikashop_get('helper.image'); list($theImage->width, $theImage->height) = getimagesize($file_path); list($width, $height) = $imageHelper->scaleImage($theImage->width, $theImage->height, $width, 0); } } $this->newSizes = new stdClass(); $this->newSizes->height=$height; $this->newSizes->width=$width; $this->image->main_thumbnail_y=$height; $this->image->main_thumbnail_x=$width; if(!empty($this->rows)){ $pagination = $this->config->get('pagination','bottom'); if(in_array($pagination,array('top','both')) && $this->params->get('show_limit') && $this->pageInfo->elements->total > $this->pageInfo->limit->value){ $this->pagination->form = '_top'; ?> <form action="<?php echo hikashop_currentURL();?>" method="post" name="adminForm_<?php echo $this->params->get('main_div_name').$this->category_selected;?>_top"> <div class="hikashop_subcategories_pagination hikashop_subcategories_pagination_top"> <?php echo $this->pagination->getListFooter($this->params->get('limit')); ?> <span class="hikashop_results_counter"><?php echo $this->pagination->getResultsCounter(); ?></span> </div> <input type="hidden" name="filter_order_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->value; ?>" /> <input type="hidden" name="filter_order_Dir_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->dir; ?>" /> <?php echo JHTML::_( 'form.token' ); ?> </form> <?php } ?> <div class="hikashop_subcategories"> <?php if($enableCarousel){ $this->setLayout('carousel'); echo $this->loadTemplate(); } else{ $columns = (int)$this->params->get('columns'); if(empty($columns) || $columns<1) $columns = 1; $width = (int)(100/$columns)-1; $current_column = 1; $current_row = 1; if($this->params->get('only_if_products','-1')=='-1'){ $config =& hikashop_config(); $defaultParams = $config->get('default_params'); $this->params->set('only_if_products',@$defaultParams['only_if_products']); } $only_if_products = $this->params->get('only_if_products',0); if(HIKASHOP_J30) { switch($columns) { case 12: case 6: case 4: case 3: case 2: case 1: $row_fluid = 12; $span = $row_fluid / $columns; break; case 10: case 8: case 7: $row_fluid = $columns; $span = 1; break; case 5: $row_fluid = 10; $span = 2; break; case 9: // special case $row_fluid = 10; $span = 1; break; } if($row_fluid == 12) echo '<div class="row-fluid"><ul class="thumbnails">'; else echo '<div class="row-fluid-'.$row_fluid.'"><ul class="thumbnails">'; } foreach($this->rows as $row){ if($only_if_products && $row->number_of_products<1) continue; if(!HIKASHOP_J30) { ?> <div class="hikashop_category hikashop_category_column_<?php echo $current_column; ?> hikashop_category_row_<?php echo $current_row; ?>" style="width:<?php echo $width;?>%;"> <div class="hikashop_container"> <div class="hikashop_subcontainer <?php echo $borderClass; ?>"> <?php } else { ?> <li class="span<?php echo $span; ?> hikashop_category hikashop_category_column_<?php echo $current_column; ?> hikashop_category_row_<?php echo $current_row; ?>"> <div class="hikashop_container"> <div class="hikashop_subcontainer <?php echo $borderClass; ?>"> <?php } $this->row =& $row; echo $this->loadTemplate($this->params->get('div_item_layout_type')); if($this->params->get('child_display_type','inherit')=='inherit'){ $config =& hikashop_config(); $defaultParams = $config->get('default_params'); $this->params->set('child_display_type',$defaultParams['child_display_type']); } if($this->params->get('child_limit','')==''){ $config =& hikashop_config(); $defaultParams = $config->get('default_params'); $this->params->set('child_limit',$defaultParams['child_limit']); } switch($this->params->get('child_display_type')){ case 'nochild': default: break; case 'allchildsexpand': $limit = $this->params->get('child_limit'); case 'allchilds': if(!empty($this->row->childs)){ ?> <ul class="hikashop_category_list"> <?php $i=0; foreach($this->row->childs as $child){ if($only_if_products && $child->number_of_products<1) continue; if(!empty($limit) && $i >= $limit){ break; } $i++; $link = hikashop_completeLink('category&task=listing&cid='.$child->category_id.'&name='.$child->alias.$this->menu_id); ?> <li class="hikashop_category_list_item"> <a href="<?php echo $link; ?>"> <?php echo $child->category_name; if($this->params->get('number_of_products',0)){ echo ' ('.$child->number_of_products.')'; } ?> </a> </li> <?php } ?> </ul> <?php } break; } if(!HIKASHOP_J30) { ?> </div> </div> </div> <?php } else { ?> </div> </div> </li> <?php } if($current_column>=$columns){ $current_row++; if(!HIKASHOP_J30) { ?> <div style="clear:both"></div> <?php } $current_column=0; } $current_column++; } if(HIKASHOP_J30) { echo '</ul></div>'; } } ?><div style="clear:both"></div> </div> <?php if(in_array($pagination,array('bottom','both')) && $this->params->get('show_limit') && $this->pageInfo->elements->total > $this->pageInfo->limit->value){ $this->pagination->form = '_bottom'; ?> <form action="<?php echo hikashop_currentURL();?>" method="post" name="adminForm_<?php echo $this->params->get('main_div_name').$this->category_selected;?>_bottom"> <div class="hikashop_subcategories_pagination hikashop_subcategories_pagination_bottom"> <?php echo $this->pagination->getListFooter($this->params->get('limit')); ?> <span class="hikashop_results_counter"><?php echo $this->pagination->getResultsCounter(); ?></span> </div> <input type="hidden" name="filter_order_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->value; ?>" /> <input type="hidden" name="filter_order_Dir_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->dir; ?>" /> <?php echo JHTML::_( 'form.token' ); ?> </form> <?php } } ?>

And the listing_price looks like:
Code:
<?php /** * @package HikaShop for Joomla! * @version 2.2.3 * @author hikashop.com * @copyright (C) 2010-2013 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?> <span class="hikashop_product_price_full"> <?php if(empty($this->row->prices)){ echo JText::_('FREE_PRICE'); }else{ $first=true; echo JText::_('PRICE_BEGINNING'); foreach($this->row->prices as $price){ if($first)$first=false; else echo JText::_('PRICE_SEPARATOR'); if(!empty($this->unit) && isset($price->unit_price)){ $price =& $price->unit_price; } if(!isset($price->price_currency_id))$price->price_currency_id = hikashop_getCurrency(); echo '<span class="hikashop_product_price">'; if($this->params->get('price_with_tax')){ echo $this->currencyHelper->format(@$price->price_value_with_tax,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){ echo $this->currencyHelper->format(@$price->price_value,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } if($this->params->get('show_original_price','-1')=='-1'){ $config =& hikashop_config(); $defaultParams = $config->get('default_params'); $this->params->set('show_original_price',$defaultParams['show_original_price']); } if($this->params->get('show_original_price') && !empty($price->price_orig_value)){ echo JText::_('PRICE_BEFORE_ORIG'); if($this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_orig_value_with_tax,$price->price_orig_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_orig_value,$price->price_orig_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo '</span> '; if(!empty($this->row->discount)){ if($this->params->get('show_discount',3)==3){ $config =& hikashop_config(); $defaultParams = $config->get('default_params'); $this->params->set('show_discount',$defaultParams['show_discount']); } if($this->params->get('show_discount')==1){ echo '<span class="hikashop_product_discount">'.JText::_('PRICE_DISCOUNT_START'); if(bccomp($this->row->discount->discount_flat_amount,0,5)!==0){ echo $this->currencyHelper->format(-1*$this->row->discount->discount_flat_amount,$price->price_currency_id); }else{ echo -1*$this->row->discount->discount_percent_amount.'%'; } echo JText::_('PRICE_DISCOUNT_END').'</span>'; }elseif($this->params->get('show_discount')==2){ echo '<span class="hikashop_product_price_before_discount">'.JText::_('PRICE_DISCOUNT_START'); if($this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_value_without_discount_with_tax,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_value_without_discount,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } if($this->params->get('show_original_price') && !empty($price->price_orig_value_without_discount_with_tax)){ echo JText::_('PRICE_BEFORE_ORIG'); if($this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_orig_value_without_discount_with_tax,$price->price_orig_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_orig_value_without_discount,$price->price_orig_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo JText::_('PRICE_DISCOUNT_END').'</span>'; } } } echo JText::_('PRICE_END'); } ?></span>

But these are both for category view. I need product view right?
This is product / listing_div:
Code:
<?php /** * @package HikaShop for Joomla! * @version 2.0.0 * @author hikashop.com * @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?><?php $mainDivName=$this->params->get('main_div_name'); $carouselEffect=$this->params->get('carousel_effect'); $enableCarousel=$this->params->get('enable_carousel'); $textCenterd=$this->params->get('text_center'); $this->align="left"; if($textCenterd){ $this->align="center"; } $height=$this->params->get('image_height'); $width=$this->params->get('image_width'); $this->borderClass=""; if($this->params->get('border_visible',1) == 1){ $this->borderClass="hikashop_subcontainer_border"; } if($this->params->get('border_visible',1) == 2){ $this->borderClass="thumbnail"; } if(empty($width) && empty($height)){ $width=$this->image->main_thumbnail_x; $height=$this->image->main_thumbnail_y; } $row = reset($this->rows); $this->image->checkSize($width,$height,$row); $this->newSizes= new stdClass(); $this->newSizes->height=$height; $this->newSizes->width=$width; $this->image->main_thumbnail_y=$height; $this->image->main_thumbnail_x=$width; if((!empty($this->rows) || !$this->module || JRequest::getVar('hikashop_front_end_main',0)) && $this->pageInfo->elements->total){ $pagination = $this->config->get('pagination','bottom'); if(in_array($pagination,array('top','both')) && $this->params->get('show_limit') && $this->pageInfo->elements->total){ $this->pagination->form = '_top'; ?> <form action="<?php echo hikashop_currentURL(); ?>" method="post" name="adminForm_<?php echo $this->params->get('main_div_name').$this->category_selected;?>_top"> <div class="hikashop_products_pagination hikashop_products_pagination_top"> <?php echo $this->pagination->getListFooter($this->params->get('limit')); ?> <span class="hikashop_results_counter"><?php echo $this->pagination->getResultsCounter(); ?></span> </div> <input type="hidden" name="filter_order_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->value; ?>" /> <input type="hidden" name="filter_order_Dir_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->dir; ?>" /> <?php echo JHTML::_( 'form.token' ); ?> </form> <?php } ?> <div class="hikashop_products"> <?php if(!empty($this->rows)){ if ($this->config->get('show_quantity_field')>=2) { ?> <form action="<?php echo hikashop_completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form_<?php echo $this->params->get('main_div_name'); ?>" enctype="multipart/form-data"> <?php } if($enableCarousel){ $this->setLayout('carousel'); echo $this->loadTemplate(); } else { $columns = (int)$this->params->get('columns'); if(empty($columns) || $columns<1) $columns = 1; $width = (int)(100/$columns)-1; $current_column = 1; $current_row = 1; if(HIKASHOP_J30) { switch($columns) { case 12: case 6: case 4: case 3: case 2: case 1: $row_fluid = 12; $span = $row_fluid / $columns; break; case 10: case 8: case 7: $row_fluid = $columns; $span = 1; break; case 5: $row_fluid = 10; $span = 2; break; case 9: // special case $row_fluid = 10; $span = 1; break; } if($row_fluid == 12) echo '<div class="row-fluid"><ul class="thumbnails">'; else echo '<div class="row-fluid-'.$row_fluid.'"><ul class="thumbnails">'; } foreach($this->rows as $row){ if(!HIKASHOP_J30) { ?> <div class="hikashop_product hikashop_product_column_<?php echo $current_column; ?> hikashop_product_row_<?php echo $current_row; ?>" style="width:<?php echo $width;?>%;"> <div class="hikashop_container"> <div class="hikashop_subcontainer <?php echo $this->borderClass; ?>"> <?php } else { ?> <li class="span<?php echo $span; ?> hikashop_product hikashop_product_column_<?php echo $current_column; ?> hikashop_product_row_<?php echo $current_row; ?>"> <div class="hikashop_container"> <div class="hikashop_subcontainer <?php echo $this->borderClass; ?>"> <?php } $this->row =& $row; $this->setLayout('listing_'.$this->params->get('div_item_layout_type')); echo $this->loadTemplate(); if(!HIKASHOP_J30) { ?> </div> </div> </div> <?php } else { ?> </div> </div> </li> <?php } if($current_column>=$columns){ $current_row++; if(!HIKASHOP_J30) { ?> <div style="clear:both"></div> <?php } $current_column=0; } $current_column++; } if(HIKASHOP_J30) { echo '</ul></div>'; } } ?> <div style="clear:both"></div> <?php if ($this->config->get('show_quantity_field')>=2) { $this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form_'.$this->params->get('main_div_name').'\')){ return hikashopModifyQuantity(\'\',field,1,\'hikashop_product_form_'.$this->params->get('main_div_name').'\'); } return false;'; $this->row = new stdClass(); $this->row->prices = array($this->row); $this->row->product_quantity = -1; $this->row->product_min_per_order = 0; $this->row->product_max_per_order = -1; $this->row->product_sale_start = 0; $this->row->product_sale_end = 0; $this->setLayout('quantity'); echo $this->loadTemplate(); if(!empty($this->ajax) && $this->config->get('redirect_url_after_add_cart','stay_if_cart')=='ask_user'){ ?> <input type="hidden" name="popup" value="1"/> <?php } ?> <input type="hidden" name="hikashop_cart_type_0" id="hikashop_cart_type_0" value="cart"/> <input type="hidden" name="add" value="1"/> <input type="hidden" name="ctrl" value="product"/> <input type="hidden" name="task" value="updatecart"/> <input type="hidden" name="return_url" value="<?php echo urlencode(base64_encode(urldecode($this->redirect_url)));?>"/> </form> <?php } } ?> </div> <?php if(in_array($pagination,array('bottom','both')) && $this->params->get('show_limit') && $this->pageInfo->elements->total){ $this->pagination->form = '_bottom'; ?> <form action="<?php echo hikashop_currentURL(); ?>" method="post" name="adminForm_<?php echo $this->params->get('main_div_name').$this->category_selected;?>_bottom"> <div class="hikashop_products_pagination hikashop_products_pagination_bottom"> <?php echo $this->pagination->getListFooter($this->params->get('limit')); ?> <span class="hikashop_results_counter"><?php echo $this->pagination->getResultsCounter(); ?></span> </div> <input type="hidden" name="filter_order_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->value; ?>" /> <input type="hidden" name="filter_order_Dir_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->dir; ?>" /> <?php echo JHTML::_( 'form.token' ); ?> </form> <?php } } ?>

and this is product / listing_img_title.php
Code:
<?php /** * @package HikaShop for Joomla! * @version 2.0.0 * @author hikashop.com * @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?><?php $link = hikashop_completeLink('product&task=show&cid='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway); if(!empty($this->row->extraData->top)) { echo implode("\r\n",$this->row->extraData->top); } if($this->config->get('thumbnail',1)){ ?><!-- PRODUCT NAME --><span class="hikashop_product_name"> <?php if($this->params->get('link_to_product_page',1)){ ?> <a href="<?php echo $link;?>"> <?php } echo $this->row->product_name; if($this->params->get('link_to_product_page',1)){ ?> </a> <?php } ?></span><!-- EO PRODUCT NAME --> <!-- PRODUCT IMG --> <div style="height:<?php echo $this->image->main_thumbnail_y;?>px;text-align:center;clear:both;" class="hikashop_product_image"> <div style="position:relative;text-align:center;clear:both;width:<?php echo $this->image->main_thumbnail_x;?>px;margin: auto;" class="hikashop_product_image_subdiv"> <?php if($this->params->get('link_to_product_page',1)){ ?> <a href="<?php echo $link;?>" title="<?php echo $this->escape($this->row->product_name); ?>"> <?php } echo $this->image->display(@$this->row->file_path,false,$this->escape($this->row->file_name), '' , '' , $this->image->main_thumbnail_x, $this->image->main_thumbnail_y); $main_thumb_x = $this->image->main_thumbnail_x; $main_thumb_y = $this->image->main_thumbnail_y; $this->classbadge->placeBadges($this->image, $this->row->badges, -10, 0); $this->image->main_thumbnail_x = $main_thumb_x; $this->image->main_thumbnail_y = $main_thumb_y; if($this->params->get('link_to_product_page',1)){ ?> </a> <?php } ?> </div> </div> <!-- EO PRODUCT IMG --> <!-- PRODUCT PRICE --> <?php } if($this->params->get('show_price','-1')=='-1'){ $config =& hikashop_config(); $this->params->set('show_price',$config->get('show_price')); } if($this->params->get('show_price')){ $this->setLayout('listing_price'); echo $this->loadTemplate(); } ?> <!-- EO PRODUCT PRICE --> <!-- PRODUCT CODE --> <span class='hikashop_product_code_list'> <?php if ($this->config->get('show_code')) { ?> <a href="<?php echo $link;?>"> <?php echo $this->row->product_code; ?> </a> <?php } ?> </span> <!-- EO PRODUCT CODE --> <?php if(!empty($this->row->extraData->afterProductName)) { echo implode("\r\n",$this->row->extraData->afterProductName); } ?> <!-- PRODUCT VOTE --> <?php if($this->params->get('show_vote_product')){ $this->setLayout('listing_vote'); echo $this->loadTemplate(); } ?> <!-- EO PRODUCT VOTE --> <!-- ADD TO CART BUTTON AREA --> <?php if($this->params->get('add_to_cart') || $this->params->get('add_to_wishlist')){ $this->setLayout('add_to_cart_listing'); echo $this->loadTemplate(); }?> <!-- EO ADD TO CART BUTTON AREA --> <!-- COMPARISON AREA --> <?php if(JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) { ?> <br/><?php if( $this->params->get('show_compare') == 1 ) { ?> <a class="hikashop_compare_button" href="<?php echo $link;?>" onclick="setToCompareList(<?php echo $this->row->product_id;?>,'<?php echo $this->escape($this->row->product_name); ?>',this); return false;"><?php echo JText::_('ADD_TO_COMPARE_LIST'); ?></a> <?php } else { ?> <input type="checkbox" class="hikashop_compare_checkbox" id="hikashop_listing_chk_<?php echo $this->row->product_id;?>" onchange="setToCompareList(<?php echo $this->row->product_id;?>,'<?php echo $this->escape($this->row->product_name); ?>',this);"><label for="hikashop_listing_chk_<?php echo $this->row->product_id;?>"><?php echo JText::_('ADD_TO_COMPARE_LIST'); ?></label> <?php } } ?> <!-- EO COMPARISON AREA --> <?php if(!empty($this->row->extraData->bottom)) { echo implode("\r\n",$this->row->extraData->bottom); } ?>

I think I need to add the code in this one, just above the <!-- product price --> line right?

I just don't know how to do that :)

For the record, I want the custom field 'csv_adviesprijs' to show here.

Proud of my website www.hetcomputerwinkeltje.nl

Currently just running catalog mode, but hope to go live soon again :)

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #139845 by nicolas
The code should be something like that:
<?php echo $this->row->csv_adviesprijs, ?>
The following user(s) said Thank You: anypc

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #139850 by anypc
I copied that into the file but now it shows a blank page :(

Proud of my website www.hetcomputerwinkeltje.nl

Currently just running catalog mode, but hope to go live soon again :)

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #139854 by nicolas
It means that your modification is not correct. Turn on the debug mode and error reporting options of the joomla configuration and you'll get an error message on that blank page tell you what's wrong.
The following user(s) said Thank You: anypc

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago - 12 years 8 months ago #139858 by anypc
Parse error: syntax error, unexpected '?> ' in /home/hubothuis/domains/verfgoedkoper.nl/public_html/templates/2014verfgoedkoper012/html/com_hikashop/product/listing_img_title.php on line 36

Code is now:
Code:
<?php /** * @package HikaShop for Joomla! * @version 2.0.0 * @author hikashop.com * @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?><?php $link = hikashop_completeLink('product&task=show&cid='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway); if(!empty($this->row->extraData->top)) { echo implode("\r\n",$this->row->extraData->top); } if($this->config->get('thumbnail',1)){ ?><!-- PRODUCT NAME --><span class="hikashop_product_name"> <?php if($this->params->get('link_to_product_page',1)){ ?> <a href="<?php echo $link;?>"> <?php } echo $this->row->product_name; if($this->params->get('link_to_product_page',1)){ ?> </a> <?php } ?></span><!-- EO PRODUCT NAME --> <!-- PRODUCT IMG --> <div style="height:<?php echo $this->image->main_thumbnail_y;?>px;text-align:center;clear:both;" class="hikashop_product_image"> <div style="position:relative;text-align:center;clear:both;width:<?php echo $this->image->main_thumbnail_x;?>px;margin: auto;" class="hikashop_product_image_subdiv"> <?php if($this->params->get('link_to_product_page',1)){ ?> <a href="<?php echo $link;?>" title="<?php echo $this->escape($this->row->product_name); ?>"> <?php } echo $this->image->display(@$this->row->file_path,false,$this->escape($this->row->file_name), '' , '' , $this->image->main_thumbnail_x, $this->image->main_thumbnail_y); $main_thumb_x = $this->image->main_thumbnail_x; $main_thumb_y = $this->image->main_thumbnail_y; $this->classbadge->placeBadges($this->image, $this->row->badges, -10, 0); $this->image->main_thumbnail_x = $main_thumb_x; $this->image->main_thumbnail_y = $main_thumb_y; if($this->params->get('link_to_product_page',1)){ ?> </a> <?php } ?> </div> </div> <!-- EO PRODUCT IMG --> <?php echo $this->row->csv_adviesprijs, ?> <!-- PRODUCT PRICE --> <?php } if($this->params->get('show_price','-1')=='-1'){ $config =& hikashop_config(); $this->params->set('show_price',$config->get('show_price')); } if($this->params->get('show_price')){ $this->setLayout('listing_price'); echo $this->loadTemplate(); } ?> <!-- EO PRODUCT PRICE --> <!-- PRODUCT CODE --> <span class='hikashop_product_code_list'> <?php if ($this->config->get('show_code')) { ?> <a href="<?php echo $link;?>"> <?php echo $this->row->product_code; ?> </a> <?php } ?> </span> <!-- EO PRODUCT CODE --> <?php if(!empty($this->row->extraData->afterProductName)) { echo implode("\r\n",$this->row->extraData->afterProductName); } ?> <!-- PRODUCT VOTE --> <?php if($this->params->get('show_vote_product')){ $this->setLayout('listing_vote'); echo $this->loadTemplate(); } ?> <!-- EO PRODUCT VOTE --> <!-- ADD TO CART BUTTON AREA --> <?php if($this->params->get('add_to_cart') || $this->params->get('add_to_wishlist')){ $this->setLayout('add_to_cart_listing'); echo $this->loadTemplate(); }?> <!-- EO ADD TO CART BUTTON AREA --> <!-- COMPARISON AREA --> <?php if(JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) { ?> <br/><?php if( $this->params->get('show_compare') == 1 ) { ?> <a class="hikashop_compare_button" href="<?php echo $link;?>" onclick="setToCompareList(<?php echo $this->row->product_id;?>,'<?php echo $this->escape($this->row->product_name); ?>',this); return false;"><?php echo JText::_('ADD_TO_COMPARE_LIST'); ?></a> <?php } else { ?> <input type="checkbox" class="hikashop_compare_checkbox" id="hikashop_listing_chk_<?php echo $this->row->product_id;?>" onchange="setToCompareList(<?php echo $this->row->product_id;?>,'<?php echo $this->escape($this->row->product_name); ?>',this);"><label for="hikashop_listing_chk_<?php echo $this->row->product_id;?>"><?php echo JText::_('ADD_TO_COMPARE_LIST'); ?></label> <?php } } ?> <!-- EO COMPARISON AREA --> <?php if(!empty($this->row->extraData->bottom)) { echo implode("\r\n",$this->row->extraData->bottom); } ?>

Proud of my website www.hetcomputerwinkeltje.nl

Currently just running catalog mode, but hope to go live soon again :)
Last edit: 12 years 8 months ago by anypc.

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #139859 by anypc
Found it!

The code you told me to past had a typo.

The , should be a ;

Now it works! :)

Thanx!!!

Proud of my website www.hetcomputerwinkeltje.nl

Currently just running catalog mode, but hope to go live soon again :)
The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.238 seconds
Powered by Kunena Forum