Location: PHPKode > projects > HikaShop > front/views/product/tmpl/show.php
<?php
/**
 * @package		HikaShop for Joomla!
 * @version		1.4.3
 * @author		hikashop.com
 * @copyright	(C) 2010 HIKARI SOFTWARE. All rights reserved.
 * @license		GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>
<?php if(empty($this->element)){
	$app =& JFactory::getApplication();
	$app->enqueueMessage(JText::_('PRODUCT_NOT_FOUND'));
}else{
?>
<form action="<?php echo hikashop::completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form">
	<div id="hikashop_product_top_part" class="hikashop_product_top_part">
		<h2>
			<span id="hikashop_product_name_main" class="hikashop_product_name_main">
				<?php 
				echo $this->element->product_name;
				?>
			</span>
			<span id="hikashop_product_code_main" class="hikashop_product_code_main">
				<?php 
				echo $this->element->product_code;
				?>
			</span>
		</h2>
	</div>
	<div id="hikashop_product_left_part" class="hikashop_product_left_part">
		<div id="hikashop_product_image_main">
			<div id="hikashop_main_image_div">
			<?php 
			if(!empty($this->element->images)){
				$image = reset($this->element->images);
				echo $this->image->display($image->file_path,true,$image->file_name,'id="hikashop_main_image" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"','id="hikashop_main_image_link"');
				?>
				</div><div id="hikashop_small_image_div"><?php 
				if(count($this->element->images)>1){
					foreach($this->element->images as $image){
						echo $this->image->display($image->file_path,'hikashop_main_image',$image->file_name,'class="hikashop_child_image"');
					}
				}
			}
			?>
			</div>
		</div>
	</div>
	<div id="hikashop_product_right_part" class="hikashop_product_right_part">
		<span id="hikashop_product_price_main" class="hikashop_product_price_main">
			<?php 
			if($this->params->get('show_price')){
				$this->row =& $this->element;
				$this->setLayout('listing_price');
				echo $this->loadTemplate();
			} 
			?>
		</span><br />
		<?php if(isset($this->element->product_weight) && bccomp($this->element->product_weight,0,3)){ ?>
		<span id="hikashop_product_weight_main" class="hikashop_product_weight_main">
			<?php echo JText::_('PRODUCT_WEIGHT').': '.$this->element->product_weight.' '.JText::_($this->element->product_weight_unit); ?><br />
		</span>
		<?php
		}
		if(!empty($this->element->characteristics)){
			?><span id="hikashop_product_characteristics" class="hikashop_product_characteristics"><?php 
			echo $this->characteristic->displayFE($this->element,$this->params);
			?></span><br /><?php 
		}
		?>
		<?php if(!empty($this->itemFields)){?>
			<div id="hikashop_product_custom_item_info" class="hikashop_product_custom_item_info">
				<table width="100%">
				<?php 
				foreach($this->itemFields as $fieldName => $oneExtraField) {
					if(!empty($this->element->$fieldName)){ ?>
					<tr>
						<td class="key">
							<span id="hikashop_product_custom_item_name_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_item_name">
								<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
							</span>
						</td>
						<td>
							<span id="hikashop_product_custom_item_value_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_item_value">
								<?php echo $this->fieldsClass->display($oneExtraField,null,'data[\'item\'][\''.$oneExtraField->field_namekey.'\']'); ?>
							</span>
						</td>
					</tr>
				<?php } 
					}?>
				</table>
			</div>
		<?php } ?>
		<span id="hikashop_product_quantity_main" class="hikashop_product_quantity_main"><?php
			$this->row =& $this->element;
			$this->setLayout('quantity');
			echo $this->loadTemplate();
		?>
		</span>
		<?php if(!empty($this->fields)){?>
			<div id="hikashop_product_custom_info" class="hikashop_product_custom_info">
				<h4><?php echo JText::_('SPECIFICATIONS');?></h4>
				<table width="100%">
				<?php 
				$this->fieldsClass->prefix = '';
				foreach($this->fields as $fieldName => $oneExtraField) {
					if(!empty($this->element->$fieldName)){ ?>
					<tr>
						<td class="key">
							<span id="hikashop_product_custom_name_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_name">
								<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
							</span>
						</td>
						<td>
							<span id="hikashop_product_custom_value_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_value">
								<?php echo $this->fieldsClass->show($oneExtraField,$this->element->$fieldName); ?>
							</span>
						</td>
					</tr>
				<?php } 
					}?>
				</table>
			</div>
		<?php } ?>
		<span id="hikashop_product_id_main" class="hikashop_product_id_main">
			<input type="hidden" name="product_id" value="<?php echo $this->element->product_id; ?>" />
		</span>
	</div>
	<div id="hikashop_product_bottom_part" class="hikashop_product_bottom_part">
		<span id="hikashop_product_description_main" class="hikashop_product_description_main">
			<?php echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$this->element->product_description)); ?>
		</span>
		<span id="hikashop_product_url_main" class="hikashop_product_url_main">
			<?php 
			if(!empty($this->element->product_url)){
				echo JText::sprintf('MANUFACTURER_URL','<a href="'.$this->element->product_url.'" target="_blank">'.$this->element->product_url.'</a>');
			} ?>
		</span>
	</div>
	<input type="hidden" name="add" value="1"/>
	<input type="hidden" name="ctrl" value="product"/>
	<input type="hidden" name="task" value="updatecart"/>
</form>
<?php 
	if(!empty($this->element->variants)){
		foreach($this->element->variants as $variant){
			$variant_name = array();
			if(!empty($variant->characteristics)){
				foreach($variant->characteristics as $k => $ch){
					$variant_name[]=$ch->characteristic_id;
				}
			}
			$variant_name = implode('_',$variant_name);
			?>
			<div id="hikashop_product_image_<?php echo $variant_name;?>" style="display:none;">
				<div id="hikashop_main_image_div_<?php echo $variant_name;?>">
				<?php 
				if(!empty($variant->images)){
					$image = reset($variant->images);
					echo $this->image->display($image->file_path,true,$image->file_name,'id="hikashop_main_image_'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"','id="hikashop_main_image_'.$variant_name.'_link"');
					if(count($variant->images)>1){
						?>
					</div><div id="hikashop_small_image_div_<?php echo $variant_name;?>"><?php 
						foreach($variant->images as $image){
							echo $this->image->display($image->file_path,'hikashop_main_image_'.$variant_name,$image->file_name,'class="hikashop_child_image"');
						}
					}
				}
				?>
				</div>
			</div>
			<div id="hikashop_product_name_<?php echo $variant_name;?>" style="display:none;">
				<?php echo $variant->product_name;?>
			</div>
			<div id="hikashop_product_code_<?php echo $variant_name;?>" style="display:none;">
				<?php echo $variant->product_code;?>
			</div>
			<div id="hikashop_product_price_<?php echo $variant_name;?>" style="display:none;">
				<?php 
				if($this->params->get('show_price')){
					$this->row =& $variant;
					$this->setLayout('listing_price');
					echo $this->loadTemplate();
					?><br/><?php 
				} 
				?>
			</div>
			<div id="hikashop_product_quantity_<?php echo $variant_name;?>" style="display:none;">
				<?php
					$this->row =& $variant;
					$this->setLayout('quantity');
					echo $this->loadTemplate();
				?>
			</div>
			<div id="hikashop_product_description_<?php echo $variant_name;?>" style="display:none;">
				<?php echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$variant->product_description));?>
			</div>
			<div id="hikashop_product_weight_<?php echo $variant_name;?>" style="display:none;">
				<?php 
				if(isset($variant->product_weight) && bccomp($variant->product_weight,0,3)){
					echo $variant->product_weight.' '.JText::_($variant->product_weight_unit);
				}?><br />
			</div>
			<span id="hikashop_product_url_<?php echo $variant_name;?>" style="display:none;">
				<?php 
				if(!empty($variant->product_url)){
					echo JText::sprintf('MANUFACTURER_URL','<a href="'.$variant->product_url.'" target="_blank">'.$variant->product_url.'</a>');
				} ?>
			</span>
			<span id="hikashop_product_id_<?php echo $variant_name;?>">
				<input type="hidden" name="product_id" value="<?php echo $variant->product_id; ?>" />
			</span>
			<?php 
		}
	}
	$this->params->set('show_price_weight',0);
	?>
	<div class="hikashop_submodules" id="hikashop_submodules" style="clear:both">
		<?php 
		if(!empty($this->modules) && is_array($this->modules)){
			jimport('joomla.application.module.helper');
			foreach($this->modules as $module){
				echo JModuleHelper::renderModule($module);
			}
		}
		?>
	</div>
	<div class="hikashop_external_comments" id="hikashop_external_comments" style="clear:both">
	<?php 
	$config =& hikashop::config();
	if($config->get('comments_feature') == 'jcomments'){
		$comments = HIKASHOP_ROOT.'components'.DS.'com_jcomments'.DS.'jcomments.php';
		if (file_exists($comments)) {
			require_once($comments);
			echo JComments::showComments($this->element->product_id, 'com_hikashop', $this->element->product_name);
		}
	}elseif($config->get('comments_feature') == 'jomcomment'){
		$comments = HIKASHOP_ROOT.'plugins'.DS.'content'.DS.'jom_comment_bot.php';
		if (file_exists($comments)) {
			require_once($comments);
			echo jomcomment($this->element->product_id, 'com_hikashop');
		}
	}
	?>
	</div><?php 
}
Return current item: HikaShop