Location: PHPKode > projects > HikaShop > front/views/product/tmpl/cart.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 
$this->setLayout('listing_price');
$this->params->set('show_quantity_field', -1);
$desc = $this->params->get('comp_description');
if(empty($desc)){
	$this->params->set('comp_description',JText::_('CART_EMPTY'));
}
if(!headers_sent()){
	header( 'Cache-Control: no-store, no-cache, must-revalidate' );
	header( 'Cache-Control: post-check=0, pre-check=0', false );
	header( 'Pragma: no-cache' );
}
?>
<div id="hikashop_cart" class="hikashop_cart">
	<?php 
	if(empty($this->rows)){
		echo $this->params->get('comp_description');
	}else{
	$row_count = 1;
	global $Itemid;
	$url_itemid='';
	if(!empty($Itemid)){
		$url_itemid='&Itemid='.$Itemid;
	}
	if($this->params->get('small_cart')){
		$this->row=$this->total;
		if($this->params->get('show_cart_quantity',1)){
			$qty = 0;
			foreach($this->rows as $i => $row){
				if(empty($row->cart_product_quantity)) continue;
				$qty+=$row->cart_product_quantity;
			}
			$text = JText::sprintf('X_ITEMS_FOR_X',$qty,$this->loadTemplate());
		}else{
			$text = JText::sprintf('TOTAL_IN_CART_X',$this->loadTemplate());
		} ?>
		<a class="hikashop_small_cart_checkout_link" href="<?php echo hikashop::completeLink('checkout'.$url_itemid); ?>">
			<span class="hikashop_small_cart_total_title"><?php echo $text; ?></span>
		</a><?php 
		if($this->params->get('show_cart_delete',1)){
			$delete = hikashop::completeLink('product&task=cleancart');
			if(strpos($delete,'?')){
				$delete.='&';
			}else{
				$delete.='?';
			} ?>
		<a class="hikashop_small_cart_clean_link" href="<?php echo $delete.'url='. urlencode(hikashop::currentURL('url')); ?>" >
			<img src="<?php echo HIKASHOP_IMAGES . 'delete2.png';?>" border="0" alt="clean cart" />
		</a><?php 
		}
	}else{
	?>
	<form action="<?php echo hikashop::completeLink('product&task=updatecart'.$url_itemid,false,true); ?>" method="post" name="hikashop_cart_form">
		<table width="100%">
			<thead>
				<tr>
					<th class="hikashop_cart_title">
						<?php echo JText::_('CART_PRODUCT_NAME'); ?>
					</th>
					<?php if($this->params->get('show_cart_quantity',1)){
						$row_count++; ?>
						<th class="hikashop_cart_title">
							<?php echo JText::_('CART_PRODUCT_QUANTITY'); ?>
						</th>
					<?php }
					if($this->params->get('show_cart_price',1)){
						$row_count++; ?>
					<th class="hikashop_cart_title">
						<?php echo JText::_('CART_PRODUCT_PRICE'); ?>
					</th>
					<?php }
					if($this->params->get('show_cart_delete',1)){
						$row_count++; ?>
					<th class="hikashop_cart_title">
					</th>
					<?php }
					if($row_count<2){ ?>
					<th></th>
					<?php }?>
				</tr>
			</thead>
			<tbody>
				<?php 
					$k = 0;
					foreach($this->rows as $i => $row){
						if(empty($row->cart_product_quantity)) continue;
						?>
						<tr class="<?php echo "row$k"; ?>">
							<td>
								<a href="<?php echo hikashop::completeLink('product&task=show&cid='.$row->product_id.$url_itemid);?>" ><?php echo $row->product_name; ?></a>
							</td>
							<?php if($this->params->get('show_cart_quantity',1)){ ?>
							<td>
								<input id="hikashop_cart_quantity_<?php echo $row->product_id;?>" type="text" name="data[<?php echo $row->product_id;?>]" class="hikashop_product_quantity_field" value="<?php echo $row->cart_product_quantity; ?>" onchange="return hikashopModifyQuantity(<?php echo $row->product_id;?>,this)" />
							</td>
							<?php }
							if($this->params->get('show_cart_price',1)){ ?>
							<td>
								<?php 
								$this->row=&$row;
								$this->cart_product_price = true;
								echo $this->loadTemplate();
								?>
							</td>
							<?php }
							if($this->params->get('show_cart_delete',1)){ ?>
							<td>
								<a href="<?php echo hikashop::completeLink('product&task=updatecart&product_id='.$row->product_id.'&quantity=0&url='.$this->params->get('url')); ?>" onclick="var qty_field = document.getElementById('hikashop_cart_quantity_<?php echo $row->product_id;?>'); qty_field.value=0; return hikashopModifyQuantity(<?php echo $row->product_id;?>,qty_field);" ><img src="<?php echo HIKASHOP_IMAGES . 'delete2.png';?>" border="0" alt="remove product" /></a>
							</td>
							<?php }
							if($row_count<2){ ?>
							<td></td>
							<?php }?>
						</tr>
						<?php 
						$k = 1-$k;
					}
				?>
			</tbody>
			<?php if($this->params->get('show_cart_price',1)){ ?>
			<tfoot>
				<tr>
					<td colspan="<?php echo $row_count;?>">
						<hr></hr>
					</td>
				</tr>
				<tr>
					<?php if($this->params->get('show_cart_quantity',1)){ ?>
						<td>
						</td>
					<?php }?>
					<td>
						<?php echo JText::_('HIKASHOP_TOTAL'); ?>
					</td>
					<td>
					<?php 
						$this->row=$this->total;
						echo $this->loadTemplate();
					?>
					</td>
					<?php if($this->params->get('show_cart_delete',1)){ ?>
						<td>
						</td>
					<?php }?>
				</tr>
			</tfoot>
			<?php } ?>
		</table>
			<?php  
			if($this->params->get('show_cart_quantity',1)){ ?>
				<noscript>
					<input type="submit" class="button" name="refresh" value="<?php echo JText::_('REFRESH_CART');?>"/>
				</noscript>
			<?php }
		if($this->params->get('show_cart_proceed',1)){ 
			echo $this->cart->displayButton(JText::_('PROCEED_TO_CHECKOUT'),'checkout',$this->params,hikashop::completeLink('checkout'.$url_itemid),'');
		} ?>
		<input type="hidden" name="url" value="<?php echo $this->params->get('url');?>"/>
		<input type="hidden" name="ctrl" value="product"/>
		<input type="hidden" name="task" value="updatecart"/>
	</form>
	<?php }
	} ?>
</div>
<div class="clear_both"></div>
<?php 
if(JRequest::getWord('tmpl','')=='component'){
	exit;
}
Return current item: HikaShop