Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

Как сделать чтобы при смене размера товара менялась и цена?


Vladymir

Recommended Posts

Или без денежных пайпаловских запар http://loco.ru/mater...ption-selection

Вчера пытался делать как написано но ничего не получилось

может есть еще какие то способы?

Надіслати
Поділитися на інших сайтах


  • 2 weeks later...

Возможно кому-то поможет. Для 1.5.1.3

catalogviewthemedefaulttemplatecommonheader.tpl

<?php if (isset($_SERVER['HTTP_USER_AGENT']) && !strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6')) echo '<?xml version="1.0" encoding="UTF-8"?>'. "n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>" xml:lang="<?php echo $lang; ?>">
<head>
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<?php if ($icon) { ?>
<link href="<?php echo $icon; ?>" rel="icon" />
<?php } ?>
<?php foreach ($links as $link) { ?>
<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
<?php } ?>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/stylesheet.css" />
<?php foreach ($styles as $style) { ?>
<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" />
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/external/jquery.cookie.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<!--[if IE]>
<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4-iefix.js"></script>
<![endif]-->
<script type="text/javascript" src="catalog/view/javascript/jquery/tabs.js"></script>
<script type="text/javascript" src="catalog/view/javascript/common.js"></script>

<link rel="stylesheet" type="text/css" href="catalog/view/javascript/tree_category/dtree.css" />
<?php foreach ($scripts as $script) { ?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php } ?>
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie7.css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie6.css" />
<script type="text/javascript" src="catalog/view/javascript/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('#logo img');
</script>
<![endif]-->
<?php echo $google_analytics; ?>
<script type="text/javascript">
$(document).ready(function() {
$('.option').change(function() {
var OriginalPrice = $('#thisIsOriginal').text();
if (isNaN(parseInt(OriginalPrice.substring(0, 1))))
{
var OriginalCurrency = OriginalPrice.substring(0,1);
//alert(OriginalCurrency);
OriginalPrice = OriginalPrice.substring(1);
var newPriceValue = $('.option :selected').text();
var position1 = newPriceValue.indexOf("(");
var position2 = newPriceValue.indexOf(")");
var signFinalPriceValue=newPriceValue.substring(position1+1, position1+2);
position1 = position1+3;
var finalPriceValue = newPriceValue.substring(position1, position2);
if(finalPriceValue.indexOf(',') == -1)
{
finalPriceValue = "0";
}
if (signFinalPriceValue=="-")
finalPriceValue = parseFloat(-finalPriceValue.replace(",",".")) + parseFloat(OriginalPrice.replace(",","."));
else
finalPriceValue = parseFloat(finalPriceValue.replace(",",".")) + parseFloat(OriginalPrice.replace(",","."));
finalPriceValue = finalPriceValue.toFixed(2);
$('#priceUpdate').text(OriginalCurrency + finalPriceValue.replace(".",","));
}
else
{
var OriginalCurrency = OriginalPrice.substring(OriginalPrice.length-3, OriginalPrice.length);
OriginalPrice = OriginalPrice.substring();
var newPriceValue = $('.option :selected').text();
var position1 = newPriceValue.indexOf("(");
var position2 = newPriceValue.indexOf(")");
position1 = position1+1;
var finalPriceValue = newPriceValue.substring(position1, position2-4);
if(finalPriceValue.indexOf(',') == -1)
{
finalPriceValue = "0";
}
finalPriceValue = parseFloat(finalPriceValue.replace(",",".")) + parseFloat(OriginalPrice.replace(",","."));
finalPriceValue = finalPriceValue.toFixed(2);
$('#priceUpdate').text(finalPriceValue.replace(".",",") + OriginalCurrency);
}
});
});
</script>

</head>
<body>
<div id="container">
<div id="header">
  <?php if ($logo) { ?>
  <div id="logo"><a href="<?php echo $home; ?>"><img src="/image/data/dog.gif" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a></div>
  <?php } ?>
  <?php if (count($languages) > 1) { ?>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
	<div id="language"><?php echo $text_language; ?><br />
	  <?php foreach ($languages as $language) { ?>
	   <img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" title="<?php echo $language['name']; ?>" onclick="$('input[name='language_code']').attr('value', '<?php echo $language['code']; ?>').submit(); $(this).parent().parent().submit();" />
	  <?php } ?>
	  <input type="hidden" name="language_code" value="" />
	  <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
	</div>
  </form>
  <?php } ?>
  <?php if (count($currencies) > 1) { ?>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
	<div id="currency"><?php echo $text_currency; ?><br />
	  <?php foreach ($currencies as $currency) { ?>
	  <?php if ($currency['code'] == $currency_code) { ?>
	  <?php if ($currency['symbol_left']) { ?>
	  <a title="<?php echo $currency['title']; ?>"><b><?php echo $currency['symbol_left']; ?></b></a>
	  <?php } else { ?>
	  <a title="<?php echo $currency['title']; ?>"><b><?php echo $currency['symbol_right']; ?></b></a>
	  <?php } ?>
	  <?php } else { ?>
	  <?php if ($currency['symbol_left']) { ?>
	  <a title="<?php echo $currency['title']; ?>" onclick="$('input[name='currency_code']').attr('value', '<?php echo $currency['code']; ?>').submit(); $(this).parent().parent().submit();"><?php echo $currency['symbol_left']; ?></a>
	  <?php } else { ?>
	  <a title="<?php echo $currency['title']; ?>" onclick="$('input[name='currency_code']').attr('value', '<?php echo $currency['code']; ?>').submit(); $(this).parent().parent().submit();"><?php echo $currency['symbol_right']; ?></a>
	  <?php } ?>
	  <?php } ?>
	  <?php } ?>
	  <input type="hidden" name="currency_code" value="" />
	  <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
	</div>
  </form>
  <?php } ?>
  <div id="cart">
	<div class="heading">
	  <h4><?php echo $text_cart; ?></h4>
	  <a><span id="cart_total"><?php echo $text_items; ?></span></a></div>
	<div class="content"></div>
  </div>
  <div id="search">
	<div class="button-search"></div>
	<?php if ($filter_name) { ?>
	<input type="text" name="filter_name" value="<?php echo $filter_name; ?>" />
	<?php } else { ?>
	<input type="text" name="filter_name" value="<?php echo $text_search; ?>" onclick="this.value = '';" onkeydown="this.style.color = '#000000';" />
	<?php } ?>
  </div>
  <!-- <div id="welcome">
	<?php if (!$logged) { ?>
	<?php echo $text_welcome; ?>
	<?php } else { ?>
	<?php echo $text_logged; ?>
	<?php } ?>
  </div> -->
  <div class="links"><!-- <a href="<?php echo $home; ?>"><?php echo $text_home; ?> --></a><a href="<?php echo $wishlist; ?>" id="wishlist_total"><?php echo $text_wishlist; ?></a><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a><a href="<?php echo $cart; ?>"><?php echo $text_cart; ?></a><a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>
</div>
<?php if ($categories) { ?>
<div id="menu">
  <ul>
	<?php foreach ($categories as $category) { ?>
	<li><?php if ($category['active']) { ?>
<a href="<?php echo $category['href']; ?>" class="active"><?php echo $category['name']; ?></a>
<?php } else { ?>
<a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php } ?>
	  <?php if ($category['children']) { ?>
	  <div>
		<?php for ($i = 0; $i < count($category['children']);) { ?>
		<ul>
		  <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
		  <?php for (; $i < $j; $i++) { ?>
		  <?php if (isset($category['children'][$i])) { ?>
		  <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
		  <?php } ?>
		  <?php } ?>
		</ul>
		<?php } ?>
	  </div>
	  <?php } ?>
	</li>
	<?php } ?>
  </ul>
</div>
<?php } ?>
<div id="notification"></div>

catalogviewthemedefaulttemplateproductproduct.tpl

<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
<div id="thisIsOriginal" style="visibility: hidden; height:0px;"><?php echo $price; ?></div>
  <div class="breadcrumb">
	<?php foreach ($breadcrumbs as $breadcrumb) { ?>
	<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
	<?php } ?>
  </div>
  <h1><?php echo $heading_title; ?></h1>
  <div class="product-info">
	<?php if ($thumb || $images) { ?>
	<div class="left">
	  <?php if ($thumb) { ?>
	  <div class="image"><a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox"><img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image" /></a></div>
	  <?php } ?>
	  <?php if ($images) { ?>
	  <div class="image-additional">
		<?php foreach ($images as $image) { ?>
		<a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox"><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a>
		<?php } ?>
	  </div>
	  <?php } ?>
	</div>
	<?php } ?>
	<div class="right">
	  <div class="description">
		<?php if ($manufacturer) { ?>
		<span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
		<?php } ?>
		<span><?php echo $text_model; ?></span> <?php echo $model; ?><br />
		<span><?php echo $text_reward; ?></span> <?php echo $reward; ?><br />
		<span><?php echo $text_stock; ?></span> <?php echo $stock; ?></div>
	  <?php if ($price) { ?>
	  <div class="price"><?php echo $text_price; ?>
		<?php if (!$special) { ?>


  <span id="priceUpdate"><?php echo $price; ?></span>
	  


		<?php } else { ?>
<?php echo $price; ?>
		 <span class="price-old"><?php echo $price; ?></span> <span class="price-new"><span id="priceUpdate"><?php echo $special; ?></span></span>
		<?php } ?>
		<br />
		<?php if ($tax) { ?>
		<span class="price-tax"><?php echo $text_tax; ?> <?php echo $tax; ?></span><br />
		<?php } ?>
		<?php if ($points) { ?>
		<span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span> <br />
		<?php } ?>
		<?php if ($discounts) { ?>
		<br />
		<div class="discount">
		  <?php foreach ($discounts as $discount) { ?>
		  <?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><br />
		  <?php } ?>
		</div>
		<?php } ?>
	  </div>
	  <?php } ?>
	  <?php if ($options) { ?>
	  <div class="options">
		<h2><?php echo $text_option; ?></h2>
		<br />
		<?php foreach ($options as $option) { ?>
		<?php if ($option['type'] == 'select') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		<select name="option[<?php echo $option['product_option_id']; ?>]">
   <option value=""><?php echo $text_select; ?></option>
   <?php foreach ($option['option_value'] as $option_value) { ?>
   <option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
   <?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><span id="newPrice"><?php echo $option_value['price']; ?></span>)
  <!-- (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>) -->
		(<?php echo $option_value['price_full']; ?>)

   <?php } ?>
   </option>
   <?php } ?>
   </select>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'radio') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <?php foreach ($option['option_value'] as $option_value) { ?>
		  <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
	  


<label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
			<?php if ($option_value['price']) { ?>
		  

<!-- (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>) -->
			(<?php echo $option_value['price_full']; ?>)	


   <?php } ?>
		  </label>


		
<br />
		  <?php } ?>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'checkbox') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <?php foreach ($option['option_value'] as $option_value) { ?>
		  <input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
		  <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
			<?php if ($option_value['price']) { ?>
		  

<!-- (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>) -->
		   (<?php echo $option_value['price_full']; ?>)	  


	<?php } ?>
		  </label>




		  <br />
		  <?php } ?>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'image') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
			<table class="option-image">
			  <?php foreach ($option['option_value'] as $option_value) { ?>
			  <tr>
				<td style="width: 1px;"><input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" /></td>
				<td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" /></label></td>
				<td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
					<?php if ($option_value['price']) { ?>
					(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
					<?php } ?>
				  </label></td>
			  </tr>
			  <?php } ?>
			</table>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'text') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'textarea') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <textarea name="option[<?php echo $option['product_option_id']; ?>]" cols="40" rows="5"><?php echo $option['option_value']; ?></textarea>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'file') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <a id="button-option-<?php echo $option['product_option_id']; ?>" class="button"><span><?php echo $button_upload; ?></span></a>
		  <input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" />
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'date') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="date" />
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'datetime') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="datetime" />
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'time') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="time" />
		</div>
		<br />
		<?php } ?>
		<?php } ?>
	  </div>
	  <?php } ?>
	  <div class="cart">
		<div><?php echo $text_qty; ?>
		  <input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" />
		  <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
		   <a id="button-cart" class="button"><span><?php echo $button_cart; ?></span></a></div>
		<div><span>   <?php echo $text_or; ?>   </span></div>
		<div><a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a><br />
		  <a onclick="addToCompare('<?php echo $product_id; ?>');"><?php echo $button_compare; ?></a></div>
		<?php if ($minimum > 1) { ?>
		<div class="minimum"><?php echo $text_minimum; ?></div>
		<?php } ?>
	  </div>
	  <?php if ($review_status) { ?>
	  <div class="review">
		<div><img src="catalog/view/theme/default/image/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" />  <a onclick="$('a[href='#tab-review']').trigger('click');"><?php echo $reviews; ?></a>  |  <a onclick="$('a[href='#tab-review']').trigger('click');"><?php echo $text_write; ?></a></div>
		<div class="share"><!-- AddThis Button BEGIN -->
		  <div class="addthis_default_style"><a class="addthis_button_compact"><?php echo $text_share; ?></a> <a class="addthis_button_email"></a><a class="addthis_button_print"></a> <a class="addthis_button_facebook"></a> <a class="addthis_button_twitter"></a></div>
		  <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
		  <!-- AddThis Button END -->
		</div>
	  </div>
	  <?php } ?>
	</div>
  </div>
  <div id="tabs" class="htabs"><a href="#tab-description"><?php echo $tab_description; ?></a>
	<?php if ($attribute_groups) { ?>
	<a href="#tab-attribute"><?php echo $tab_attribute; ?></a>
	<?php } ?>
	<?php if ($review_status) { ?>
	<a href="#tab-review"><?php echo $tab_review; ?></a>
	<?php } ?>
	<?php if ($products) { ?>
	<a href="#tab-related"><?php echo $tab_related; ?> (<?php echo count($products); ?>)</a>
	<?php } ?>
  </div>
  <div id="tab-description" class="tab-content"><?php echo $description; ?></div>
  <?php if ($attribute_groups) { ?>
  <div id="tab-attribute" class="tab-content">
	<table class="attribute">
	  <?php foreach ($attribute_groups as $attribute_group) { ?>
	  <thead>
		<tr>
		  <td colspan="2"><?php echo $attribute_group['name']; ?></td>
		</tr>
	  </thead>
	  <tbody>
		<?php foreach ($attribute_group['attribute'] as $attribute) { ?>
		<tr>
		  <td><?php echo $attribute['name']; ?></td>
		  <td><?php echo $attribute['text']; ?></td>
		</tr>
		<?php } ?>
	  </tbody>
	  <?php } ?>
	</table>
  </div>
  <?php } ?>
  <?php if ($review_status) { ?>
  <div id="tab-review" class="tab-content">
	<div id="review"></div>
	<h2 id="review-title"><?php echo $text_write; ?></h2>
	<b><?php echo $entry_name; ?></b><br />
	<input type="text" name="name" value="" />
	<br />
	<br />
	<b><?php echo $entry_review; ?></b>
	<textarea name="text" cols="40" rows="8" style="width: 98%;"></textarea>
	<span style="font-size: 11px;"><?php echo $text_note; ?></span><br />
	<br />
	<b><?php echo $entry_rating; ?></b> <span><?php echo $entry_bad; ?></span> 
	<input type="radio" name="rating" value="1" />
	 
	<input type="radio" name="rating" value="2" />
	 
	<input type="radio" name="rating" value="3" />
	 
	<input type="radio" name="rating" value="4" />
	 
	<input type="radio" name="rating" value="5" />
	  <span><?php echo $entry_good; ?></span><br />
	<br />
	<b><?php echo $entry_captcha; ?></b><br />
	<input type="text" name="captcha" value="" />
	<br />
	<img src="index.php?route=product/product/captcha" alt="" id="captcha" /><br />
	<br />
	<div class="buttons">
	  <div class="right"><a id="button-review" class="button"><span><?php echo $button_continue; ?></span></a></div>
	</div>
  </div>
  <?php } ?>
  <?php if ($products) { ?>
  <div id="tab-related" class="tab-content">
	<div class="box-product">
	  <?php foreach ($products as $product) { ?>
	  <div>
		<?php if ($product['thumb']) { ?>
		<div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
		<?php } ?>
		<div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
		<?php if ($product['price']) { ?>
		<div class="price">
		  <?php if (!$product['special']) { ?>
		  <?php echo $product['price']; ?>
		  <?php } else { ?>
		  <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
		  <?php } ?>
		</div>
		<?php } ?>
		<?php if ($product['rating']) { ?>
		<div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
		<?php } ?>
		<a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a></div>
	  <?php } ?>
	</div>
  </div>
  <?php } ?>
  <?php if ($tags) { ?>
  <div class="tags"><b><?php echo $text_tags; ?></b>
	<?php foreach ($tags as $tag) { ?>
	<a href="<?php echo $tag['href']; ?>"><?php echo $tag['tag']; ?></a>,
	<?php } ?>
  </div>
  <?php } ?>
  <?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
$('.fancybox').fancybox({cyclic: true});
//--></script>
<script type="text/javascript"><!--
$('#button-cart').bind('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/cart/update',
		type: 'post',
		data: $('.product-info input[type='text'], .product-info input[type='hidden'], .product-info input[type='radio']:checked, .product-info input[type='checkbox']:checked, .product-info select, .product-info textarea'),
		dataType: 'json',
		success: function(json) {
			$('.success, .warning, .attention, information, .error').remove();
		  
			if (json['error']) {
				if (json['error']['warning']) {
					$('#notification').html('<div class="warning" style="display: none;">' + json['error']['warning'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
			  
					$('.warning').fadeIn('slow');
				}
			  
				for (i in json['error']) {
					$('#option-' + i).after('<span class="error">' + json['error'][i] + '</span>');
				}
			}	
					  
			if (json['success']) {
				$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
				  
				$('.success').fadeIn('slow');
				  
				$('#cart_total').html(json['total']);
			  
				$('html, body').animate({ scrollTop: 0 }, 'slow');
			}  
		}
	});
});
//--></script>
<?php if ($options) { ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/ajaxupload.js"></script>
<?php foreach ($options as $option) { ?>
<?php if ($option['type'] == 'file') { ?>
<script type="text/javascript"><!--
new AjaxUpload('#button-option-<?php echo $option['product_option_id']; ?>', {
	action: 'index.php?route=product/product/upload',
	name: 'file',
	autoSubmit: true,
	responseType: 'json',
	onSubmit: function(file, extension) {
		$('#button-option-<?php echo $option['product_option_id']; ?>').after('<img src="catalog/view/theme/default/image/loading.gif" class="loading" style="padding-left: 5px;" />');
	},
	onComplete: function(file, json) {
		$('.error').remove();
	  
		if (json.success) {
			alert(json.success);
		  
			$('input[name='option[<?php echo $option['product_option_id']; ?>]']').attr('value', json.file);
		}
	  
		if (json.error) {
			$('#option-<?php echo $option['product_option_id']; ?>').after('<span class="error">' + json.error + '</span>');
		}
	  
		$('.loading').remove();  
	}
});
//--></script>
<?php } ?>
<?php } ?>
<?php } ?>
<script type="text/javascript"><!--
$('#review .pagination a').live('click', function() {
	$('#review').slideUp('slow');
	  
	$('#review').load(this.href);
  
	$('#review').slideDown('slow');
  
	return false;
});		  
$('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');
$('#button-review').bind('click', function() {
	$.ajax({
		type: 'POST',
		url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',
		dataType: 'json',
		data: 'name=' + encodeURIComponent($('input[name='name']').val()) + '&text=' + encodeURIComponent($('textarea[name='text']').val()) + '&rating=' + encodeURIComponent($('input[name='rating']:checked').val() ? $('input[name='rating']:checked').val() : '') + '&captcha=' + encodeURIComponent($('input[name='captcha']').val()),
		beforeSend: function() {
			$('.success, .warning').remove();
			$('#button-review').attr('disabled', true);
			$('#review-title').after('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" /> <?php echo $text_wait; ?></div>');
		},
		complete: function() {
			$('#button-review').attr('disabled', false);
			$('.attention').remove();
		},
		success: function(data) {
			if (data.error) {
				$('#review-title').after('<div class="warning">' + data.error + '</div>');
			}
		  
			if (data.success) {
				$('#review-title').after('<div class="success">' + data.success + '</div>');
							  
				$('input[name='name']').val('');
				$('textarea[name='text']').val('');
				$('input[name='rating']:checked').attr('checked', '');
				$('input[name='captcha']').val('');
			}
		}
	});
});
//--></script>
<script type="text/javascript"><!--
$('#tabs a').tabs();
//--></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript"><!--
if ($.browser.msie && $.browser.version == 6) {
	$('.date, .datetime, .time').bgIframe();
}
$('.date').datepicker({dateFormat: 'yy-mm-dd'});
$('.datetime').datetimepicker({
	dateFormat: 'yy-mm-dd',
	timeFormat: 'h:m'
});
$('.time').timepicker({timeFormat: 'h:m'});
//--></script>
<?php echo $footer; ?>

Выглядит это так

Изображение

  • +1 2
Надіслати
Поділитися на інших сайтах


Второй вариант (мне нравится намного больше, но есть проблема. При цене, например 45,45 - в измененной цене будет показывать 45,40 (а в корзине показывает правильную цену). Округляет сотые копейки, может кто-то найдет причину - будет замечательно, а я пока без сотых копеек забиваю цену)

Во-первых, в опциях теперь можно писать реальную цену товара, а не +какая-то сумма к цене в данных.

Во-вторых, в витрине будет показывать "цена от" и та цена, которую Вы поставите в данных. Выглядит это так:

ИзображениеИзображение

Все файлы (целиком), которые менялись:

/catalog/language/russian/product/product.php

<?php
// Text
$_['text_search']	   = 'Поиск';
$_['text_brand']		= 'Производитель';
$_['text_manufacturer'] = 'Производитель:';
$_['text_model']		= 'Модель:';
$_['text_reward']	   = 'Бонусные баллы:';
$_['text_points']	   = 'Цена в бонусных баллах:';
$_['text_stock']		= 'Наличие:';
$_['text_instock']	  = 'В наличии';
$_['text_price']		= 'Цена от:';
$_['text_tax']		  = 'С налогом:';
$_['text_discount']	 = '%s или более %s';
$_['text_option']	   = 'Опции:';
$_['text_qty']		  = 'Количество:';
$_['text_minimum']	  = 'Минимальное количество заказа этого товара: %s';
$_['text_or']		   = '- или -';
$_['text_reviews']	  = 'Отзывов: %s';
$_['text_write']		= 'Оставить отзыв';
$_['text_no_reviews']   = 'Ещё никто не оставил отзыв о товаре.';
$_['text_note']		 = '<span style="color: #FF0000;">Внимание:</span> HTML не поддерживается! Используйте обычный текст.';
$_['text_share']		= 'Поделиться';
$_['text_success']	  = 'Спасибо за Ваш отзыв. Он отправлен администратору на утверждение.';
$_['text_upload']	   = 'Файл успешно загружен на сервер!';
$_['text_wait']		 = 'Подождите пожалуйста!';
$_['text_tags']		 = 'Метки:';
$_['text_error']		= 'Товар не найден!';

// Entry
$_['entry_name']		= 'Ваше Имя:';
$_['entry_review']	  = 'Ваш отзыв:';
$_['entry_rating']	  = 'Оценка:';
$_['entry_good']		= 'Хорошо';
$_['entry_bad']		 = 'Плохо';
$_['entry_captcha']	 = 'Введите код, указанный на картинке:';

// Tabs
$_['tab_description']   = 'Описание';
$_['tab_attribute']	 = 'Характеристики';
$_['tab_review']		= 'Отзывы (%s)';
$_['tab_related']	   = 'Похожие товары';

// Error
$_['error_name']		= 'Название отзыва должно быть от 3 до 25 символов!';
$_['error_text']		= 'Текст отзыва должен быть от 25 до 1000 символов!';
$_['error_rating']	  = 'Пожалуйста, выберите оценку!';
$_['error_captcha']	 = 'Код, указанный на картинке, введен неверно!';
$_['error_upload']	  = 'Требуется загрузка файла!';
$_['error_filename']	= 'Имя файла должно быть от 3 до 128 символов!';
$_['error_filetype']	= 'Неправильное расширение файла!';
?>
</p>

/system/library/cart.php

<?php
	final class Cart {
		 public function __construct($registry) {
		  $this->config = $registry->get('config');
		  $this->customer = $registry->get('customer');
		  $this->session = $registry->get('session');
		  $this->db = $registry->get('db');
		  $this->tax = $registry->get('tax');
		  $this->weight = $registry->get('weight');

		  if (!isset($this->session->data['cart']) || !is_array($this->session->data['cart'])) {
				$this->session->data['cart'] = array();
		   }
	   }
		  
		 public function getProducts() {
		  $product_data = array();
		
		   foreach ($this->session->data['cart'] as $key => $quantity) {
				$product = explode(':', $key);
				$product_id = $product[0];
			 $stock = true;

			 // Options
				if (isset($product[1])) {
				  $options = unserialize(base64_decode($product[1]));
				} else {
				  $options = array();
				}
			
				$product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.date_available <= NOW() AND p.status = '1'");
				
			 if ($product_query->num_rows) {
				   $option_price = 0;
				$option_points = 0;
				$option_weight = 0;

				   $option_data = array();
		
				   foreach ($options as $product_option_id => $option_value) {
				   $option_query = $this->db->query("SELECT po.product_option_id, po.option_id, od.name, o.type FROM " . DB_PREFIX . "product_option po LEFT JOIN `" . DB_PREFIX . "option` o ON (po.option_id = o.option_id) LEFT JOIN " . DB_PREFIX . "option_description od ON (o.option_id = od.option_id) WHERE po.product_option_id = '" . (int)$product_option_id . "' AND po.product_id = '" . (int)$product_id . "' AND od.language_id = '" . (int)$this->config->get('config_language_id') . "'");
				  
				   if ($option_query->num_rows) {
					  if ($option_query->row['type'] == 'select' || $option_query->row['type'] == 'radio') {
						 $option_value_query = $this->db->query("SELECT pov.option_value_id, ovd.name, pov.quantity, pov.subtract, pov.price, pov.price_prefix, pov.points, pov.points_prefix, pov.weight, pov.weight_prefix FROM " . DB_PREFIX . "product_option_value pov LEFT JOIN " . DB_PREFIX . "option_value ov ON (pov.option_value_id = ov.option_value_id) LEFT JOIN " . DB_PREFIX . "option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) WHERE pov.product_option_value_id = '" . (int)$option_value . "' AND pov.product_option_id = '" . (int)$product_option_id . "' AND ovd.language_id = '" . (int)$this->config->get('config_language_id') . "'");
						
						 if ($option_value_query->num_rows) {
							if ($option_value_query->row['price_prefix'] == '+') {
							   $option_price += $option_value_query->row['price'];
							} elseif ($option_value_query->row['price_prefix'] == '-') {
							   $option_price -= $option_value_query->row['price'];
							} elseif ($option_value_query->row['price_prefix'] == '=') {
							   $option_price = $option_value_query->row['price'];}
						  

							if ($option_value_query->row['points_prefix'] == '+') {
							   $option_points += $option_value_query->row['points'];
							} elseif ($option_value_query->row['points_prefix'] == '-') {
							   $option_points -= $option_value_query->row['points'];
							}
												
							if ($option_value_query->row['weight_prefix'] == '+') {
							   $option_weight += $option_value_query->row['weight'];
							} elseif ($option_value_query->row['weight_prefix'] == '-') {
							   $option_weight -= $option_value_query->row['weight'];
							}
						  
							if ($option_value_query->row['subtract'] && (!$option_value_query->row['quantity'] || ($option_value_query->row['quantity'] < $quantity))) {
							   $stock = false;
							}
						  
							$option_data[] = array(
							   'product_option_id'	   => $product_option_id,
							   'product_option_value_id' => $option_value,
							   'option_id'			   => $option_query->row['option_id'],
							   'option_value_id'		 => $option_value_query->row['option_value_id'],
							   'name'					=> $option_query->row['name'],
							   'option_value'			=> $option_value_query->row['name'],
							   'type'					=> $option_query->row['type'],
							   'quantity'				=> $option_value_query->row['quantity'],
							   'subtract'				=> $option_value_query->row['subtract'],
							   'price'				   => $option_value_query->row['price'],
							   'price_prefix'			=> $option_value_query->row['price_prefix'],
							   'points'				  => $option_value_query->row['points'],
							   'points_prefix'		   => $option_value_query->row['points_prefix'],						  
							   'weight'				  => $option_value_query->row['weight'],
							   'weight_prefix'		   => $option_value_query->row['weight_prefix']
							);					  
						 }
					  } elseif ($option_query->row['type'] == 'checkbox' && is_array($option_value)) {
						 foreach ($option_value as $product_option_value_id) {
							$option_value_query = $this->db->query("SELECT pov.option_value_id, ovd.name, pov.quantity, pov.subtract, pov.price, pov.price_prefix, pov.points, pov.points_prefix, pov.weight, pov.weight_prefix FROM " . DB_PREFIX . "product_option_value pov LEFT JOIN " . DB_PREFIX . "option_value ov ON (pov.option_value_id = ov.option_value_id) LEFT JOIN " . DB_PREFIX . "option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) WHERE pov.product_option_value_id = '" . (int)$product_option_value_id . "' AND pov.product_option_id = '" . (int)$product_option_id . "' AND ovd.language_id = '" . (int)$this->config->get('config_language_id') . "'");
						  
							if ($option_value_query->num_rows) {
							   if ($option_value_query->row['price_prefix'] == '+') {
								  $option_price += $option_value_query->row['price'];
							   } elseif ($option_value_query->row['price_prefix'] == '-') {
								  $option_price -= $option_value_query->row['price'];
							   } elseif ($option_value_query->row['price_prefix'] == '=') {
							   $option_price = $option_value_query->row['price'];}
							  

							   if ($option_value_query->row['points_prefix'] == '+') {
								  $option_points += $option_value_query->row['points'];
							   } elseif ($option_value_query->row['points_prefix'] == '-') {
								  $option_points -= $option_value_query->row['points'];
							   }
												  
							   if ($option_value_query->row['weight_prefix'] == '+') {
								  $option_weight += $option_value_query->row['weight'];
							   } elseif ($option_value_query->row['weight_prefix'] == '-') {
								  $option_weight -= $option_value_query->row['weight'];
							   }
							  
							   if ($option_value_query->row['subtract'] && (!$option_value_query->row['quantity'] || ($option_value_query->row['quantity'] < $quantity))) {
								  $stock = false;
							   }
							  
							   $option_data[] = array(
								  'product_option_id'	   => $product_option_id,
								  'product_option_value_id' => $product_option_value_id,
								  'option_id'			   => $option_query->row['option_id'],
								  'option_value_id'		 => $option_value_query->row['option_value_id'],
								  'name'					=> $option_query->row['name'],
								  'option_value'			=> $option_value_query->row['name'],
								  'type'					=> $option_query->row['type'],
								  'quantity'				=> $option_value_query->row['quantity'],
								  'subtract'				=> $option_value_query->row['subtract'],
								  'price'				   => $option_value_query->row['price'],
								  'price_prefix'			=> $option_value_query->row['price_prefix'],
								  'points'				  => $option_value_query->row['points'],
								  'points_prefix'		   => $option_value_query->row['points_prefix'],
								  'weight'				  => $option_value_query->row['weight'],
								  'weight_prefix'		   => $option_value_query->row['weight_prefix']
							   );					  
							}
						 }				
					  } elseif ($option_query->row['type'] == 'text' || $option_query->row['type'] == 'textarea' || $option_query->row['type'] == 'file' || $option_query->row['type'] == 'date' || $option_query->row['type'] == 'datetime' || $option_query->row['type'] == 'time') {
						 $option_data[] = array(
							'product_option_id'	   => $product_option_id,
							'product_option_value_id' => '',
							'option_id'			   => $option_query->row['option_id'],
							'option_value_id'		 => '',
							'name'					=> $option_query->row['name'],
							'option_value'			=> $option_value,
							'type'					=> $option_query->row['type'],
							'quantity'				=> '',
							'subtract'				=> '',
							'price'				   => '',
							'price_prefix'			=> '',
							'points'				  => '',
							'points_prefix'		   => '',					  
							'weight'				  => '',
							'weight_prefix'		   => ''
						 );				
					  }
				   }
				   }
			
				if ($this->customer->isLogged()) {
				   $customer_group_id = $this->customer->getCustomerGroupId();
				} else {
				   $customer_group_id = $this->config->get('config_customer_group_id');
				}
			  
				$price = $product_query->row['price'];
			  
				// Product Discounts
				$discount_quantity = 0;
			  
				foreach ($this->session->data['cart'] as $key_2 => $quantity_2) {
				   $product_2 = explode(':', $key_2);
				  
				   if ($product_2[0] == $product_id) {
					  $discount_quantity += $quantity_2;
				   }
				}
			  
				$product_discount_query = $this->db->query("SELECT price FROM " . DB_PREFIX . "product_discount WHERE product_id = '" . (int)$product_id . "' AND customer_group_id = '" . (int)$customer_group_id . "' AND quantity <= '" . (int)$discount_quantity . "' AND ((date_start = '0000-00-00' OR date_start < NOW()) AND (date_end = '0000-00-00' OR date_end > NOW())) ORDER BY quantity DESC, priority ASC, price ASC LIMIT 1");
			  
				if ($product_discount_query->num_rows) {
				   $price = $product_discount_query->row['price'];
				}
			  
				// Product Specials
				$product_special_query = $this->db->query("SELECT price FROM " . DB_PREFIX . "product_special WHERE product_id = '" . (int)$product_id . "' AND customer_group_id = '" . (int)$customer_group_id . "' AND ((date_start = '0000-00-00' OR date_start < NOW()) AND (date_end = '0000-00-00' OR date_end > NOW())) ORDER BY priority ASC, price ASC LIMIT 1");
			
				if ($product_special_query->num_rows) {
				   $price = $product_special_query->row['price'];
				}				
		
				// Reward Points
				$query = $this->db->query("SELECT points FROM " . DB_PREFIX . "product_reward WHERE product_id = '" . (int)$product_id . "' AND customer_group_id = '" . (int)$customer_group_id . "'");
			  
				if ($query->num_rows) {  
				   $reward = $query->row['points'];
				} else {
				   $reward = 0;
				}
			  
				// Downloads	
				$download_data = array();		  
			  
				$download_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_download p2d LEFT JOIN " . DB_PREFIX . "download d ON (p2d.download_id = d.download_id) LEFT JOIN " . DB_PREFIX . "download_description dd ON (d.download_id = dd.download_id) WHERE p2d.product_id = '" . (int)$product_id . "' AND dd.language_id = '" . (int)$this->config->get('config_language_id') . "'");
			
				foreach ($download_query->rows as $download) {
					 $download_data[] = array(
						  'download_id' => $download['download_id'],
					  'name'		=> $download['name'],
					  'filename'	=> $download['filename'],
					  'mask'		=> $download['mask'],
					  'remaining'   => $download['remaining']
					 );
				}
			  
				// Stock
				if (!$product_query->row['quantity'] || ($product_query->row['quantity'] < $quantity)) {
				   $stock = false;
				}
				if (!$option_price){$option_price=$price;}
				   $product_data[$key] = array(
					 'key'			 => $key,
					 'product_id'	  => $product_query->row['product_id'],
					 'name'			=> $product_query->row['name'],
					 'model'		   => $product_query->row['model'],
				   'shipping'		=> $product_query->row['shipping'],
					 'image'		   => $product_query->row['image'],
					 'option'		  => $option_data,
				   'download'		=> $download_data,
					 'quantity'		=> $quantity,
					 'minimum'		 => $product_query->row['minimum'],
				   'subtract'		=> $product_query->row['subtract'],
				   'stock'		   => $stock,
					 'price'		   => ($option_price),
					 'total'		   => ($option_price) * $quantity,
				   'reward'		  => $reward * $quantity,
				   'points'		  => ($product_query->row['points'] + $option_points) * $quantity,
				   'tax_class_id'	=> $product_query->row['tax_class_id'],
					 'weight'		  => ($product_query->row['weight'] + $option_weight) * $quantity,
					 'weight_class_id' => $product_query->row['weight_class_id'],
					 'length'		  => $product_query->row['length'],
				   'width'		   => $product_query->row['width'],
				   'height'		  => $product_query->row['height'],
					 'length_class_id' => $product_query->row['length_class_id']			  
				   );
			 } else {
				$this->remove($key);
			 }
		   }
					
		  return $product_data;
		 }
		  
		 public function add($product_id, $qty = 1, $options = array()) {
		   if (!$options) {
				$key = (int)$product_id;
		   } else {
				$key = (int)$product_id . ':' . base64_encode(serialize($options));
		   }
		  
		  if ((int)$qty && ((int)$qty > 0)) {
			  if (!isset($this->session->data['cart'][$key])) {
				   $this->session->data['cart'][$key] = (int)$qty;
			  } else {
				   $this->session->data['cart'][$key] += (int)$qty;
			  }
		  }
		 }

		 public function update($key, $qty) {
		   if ((int)$qty && ((int)$qty > 0)) {
				$this->session->data['cart'][$key] = (int)$qty;
		   } else {
			   $this->remove($key);
		  }
		 }

		 public function remove($key) {
		  if (isset($this->session->data['cart'][$key])) {
			   unset($this->session->data['cart'][$key]);
			}
	   }
	  
		 public function clear() {
		  $this->session->data['cart'] = array();
		 }
	  
		 public function getWeight() {
		  $weight = 0;
	  
		   foreach ($this->getProducts() as $product) {
			 if ($product['shipping']) {
				   $weight += $this->weight->convert($product['weight'], $product['weight_class_id'], $this->config->get('config_weight_class_id'));
			 }
		  }
	  
		  return $weight;
	   }
	  
		 public function getSubTotal() {
		  $total = 0;
		
		  foreach ($this->getProducts() as $product) {
			 $total += $product['total'];
		  }

		  return $total;
		 }
	  
	   public function getTaxes() {
		  $taxes = array();
		
		  foreach ($this->getProducts() as $product) {
			 if ($product['tax_class_id']) {
				if (!isset($taxes[$product['tax_class_id']])) {
				   $taxes[$product['tax_class_id']] = $product['total'] / 100 * $this->tax->getRate($product['tax_class_id']);
				} else {
				   $taxes[$product['tax_class_id']] += $product['total'] / 100 * $this->tax->getRate($product['tax_class_id']);
				}
			 }
		  }
		
		  return $taxes;
		 }

		 public function getTotal() {
		  $total = 0;
		
		  foreach ($this->getProducts() as $product) {
			 $total += $this->tax->calculate($product['total'], $product['tax_class_id'], $this->config->get('config_tax'));
		  }

		  return $total;
		 }
		
	   public function getTotalRewardPoints() {
		  $total = 0;
		
		  foreach ($this->getProducts() as $product) {
			 $total += $product['reward'];
		  }

		  return $total;
		 }
		  
		 public function countProducts() {
		  $product_total = 0;
			
		  $products = $this->getProducts();
			
		  foreach ($products as $product) {
			 $product_total += $product['quantity'];
		  }	
				  
		  return $product_total;
	   }
	  
		 public function hasProducts() {
		   return count($this->session->data['cart']);
		 }
	
		 public function hasStock() {
		  $stock = true;
		
		  foreach ($this->getProducts() as $product) {
			 if (!$product['stock']) {
				 $stock = false;
			 }
		  }
		
		   return $stock;
		 }
	
		 public function hasShipping() {
		  $shipping = false;
		
		  foreach ($this->getProducts() as $product) {
			   if ($product['shipping']) {
				 $shipping = true;
			  
				break;
			   }	
		  }
		
		  return $shipping;
	   }
	  
		 public function hasDownload() {
		  $download = false;
		
		  foreach ($this->getProducts() as $product) {
			   if ($product['download']) {
				 $download = true;
			  
				break;
			   }	
		  }
		
		  return $download;
	   }  
	}
	?>

/catalog/view/theme/default/template/product/product.tpl

<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
<div id="thisIsOriginal" style="visibility: hidden; height:0px;"><?php echo $price; ?></div>

  <div class="breadcrumb">
	<?php foreach ($breadcrumbs as $breadcrumb) { ?>
	<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
	<?php } ?>
  </div>
  <h1><?php echo $heading_title; ?></h1>
  <div class="product-info">
	<?php if ($thumb || $images) { ?>
	<div class="left">
	  <?php if ($thumb) { ?>
	  <div class="image"><a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox"><img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image" /></a></div>
	  <?php } ?>
	  <?php if ($images) { ?>
	  <div class="image-additional">
		<?php foreach ($images as $image) { ?>
		<a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox"><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a>
		<?php } ?>
	  </div>
	  <?php } ?>
	</div>
	<?php } ?>
	<div class="right">
	  <div class="description">
		<?php if ($manufacturer) { ?>
		<span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
		<?php } ?>
		<span><?php echo $text_model; ?></span> <?php echo $model; ?><br />
		<span><?php echo $text_reward; ?></span> <?php echo $reward; ?><br />
		<span><?php echo $text_stock; ?></span> <?php echo $stock; ?></div>
	  <?php if ($price) { ?>
	  <div class="price"><?php echo $text_price; ?>
		<?php if (!$special) { ?>

<span id="priceUpdate"><?php echo $price; ?></span>
	
		<?php } else { ?>



  <?php echo $price; ?>

<span class="price-old"><?php echo $price; ?></span> <span class="price-new"><span id="priceUpdate"><?php echo $special; ?></span></span>
	  
	  
<?php } ?>
		<br />
		<?php if ($tax) { ?>
		<span class="price-tax"><?php echo $text_tax; ?> <?php echo $tax; ?></span><br />
		<?php } ?>
		<?php if ($points) { ?>
		<span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span> <br />
		<?php } ?>
		<?php if ($discounts) { ?>
		<br />
		<div class="discount">
		  <?php foreach ($discounts as $discount) { ?>
		  <?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><br />
		  <?php } ?>
		</div>
		<?php } ?>
	  </div>
	  <?php } ?>
	  <?php if ($options) { ?>
	  <div class="options">
		<h2><?php echo $text_option; ?></h2>
		<br />
		<?php foreach ($options as $option) { ?>
		<?php if ($option['type'] == 'select') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <select name="option[<?php echo $option['product_option_id']; ?>]">
			<option value=""><?php echo $text_select; ?></option>
			<?php foreach ($option['option_value'] as $option_value) { ?>
			<option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
			<?php if ($option_value['price']) { ?>
		  
(<span id="newPrice"><?php echo $option_value['price']; ?></span>)

			<?php } ?>
			</option>
			<?php } ?>
		  </select>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'radio') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <?php foreach ($option['option_value'] as $option_value) { ?>
		  <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
		  <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
			<?php if ($option_value['price_full']) { ?>
			(<?php echo $option_value['price']; ?>)
			<?php } ?>
		  </label>
		  <br />
		  <?php } ?>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'checkbox') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <?php foreach ($option['option_value'] as $option_value) { ?>
		  <input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
		  <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
			<?php if ($option_value['price']) { ?>

			(<?php echo $option_value['price']; ?>)
			<?php } ?>
		  </label>
		  <br />
		  <?php } ?>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'image') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
			<table class="option-image">
			  <?php foreach ($option['option_value'] as $option_value) { ?>
			  <tr>
				<td style="width: 1px;"><input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" /></td>
				<td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" /></label></td>
				<td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
					<?php if ($option_value['price']) { ?>
					(<?php echo $option_value['price']; ?>)
					<?php } ?>
				  </label></td>
			  </tr>
			  <?php } ?>
			</table>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'text') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'textarea') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <textarea name="option[<?php echo $option['product_option_id']; ?>]" cols="40" rows="5"><?php echo $option['option_value']; ?></textarea>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'file') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <a id="button-option-<?php echo $option['product_option_id']; ?>" class="button"><span><?php echo $button_upload; ?></span></a>
		  <input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" />
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'date') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="date" />
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'datetime') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="datetime" />
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'time') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="time" />
		</div>
		<br />
		<?php } ?>
		<?php } ?>
	  </div>
	  <?php } ?>
	  <div class="cart">
		<div><?php echo $text_qty; ?>
		  <input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" />
		  <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
		   <a id="button-cart" class="button"><span><?php echo $button_cart; ?></span></a></div>
		<div><span>   <?php echo $text_or; ?>   </span></div>
		<div><a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a><br />
		  <a onclick="addToCompare('<?php echo $product_id; ?>');"><?php echo $button_compare; ?></a></div>
		<?php if ($minimum > 1) { ?>
		<div class="minimum"><?php echo $text_minimum; ?></div>
		<?php } ?>
	  </div>
	  <?php if ($review_status) { ?>
	  <div class="review">
		<div><img src="catalog/view/theme/default/image/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" />  <a onclick="$('a[href='#tab-review']').trigger('click');"><?php echo $reviews; ?></a>  |  <a onclick="$('a[href='#tab-review']').trigger('click');"><?php echo $text_write; ?></a></div>
		<div class="share"><!-- AddThis Button BEGIN -->
		  <div class="addthis_default_style"><a class="addthis_button_compact"><?php echo $text_share; ?></a> <a class="addthis_button_email"></a><a class="addthis_button_print"></a> <a class="addthis_button_facebook"></a> <a class="addthis_button_twitter"></a></div>
		  <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
		  <!-- AddThis Button END -->
		</div>
	  </div>
	  <?php } ?>
	</div>
  </div>
  <div id="tabs" class="htabs"><a href="#tab-description"><?php echo $tab_description; ?></a>
	<?php if ($attribute_groups) { ?>
	<a href="#tab-attribute"><?php echo $tab_attribute; ?></a>
	<?php } ?>
	<?php if ($review_status) { ?>
	<a href="#tab-review"><?php echo $tab_review; ?></a>
	<?php } ?>
	<?php if ($products) { ?>
	<a href="#tab-related"><?php echo $tab_related; ?> (<?php echo count($products); ?>)</a>
	<?php } ?>
  </div>
  <div id="tab-description" class="tab-content"><?php echo $description; ?></div>
  <?php if ($attribute_groups) { ?>
  <div id="tab-attribute" class="tab-content">
	<table class="attribute">
	  <?php foreach ($attribute_groups as $attribute_group) { ?>
	  <thead>
		<tr>
		  <td colspan="2"><?php echo $attribute_group['name']; ?></td>
		</tr>
	  </thead>
	  <tbody>
		<?php foreach ($attribute_group['attribute'] as $attribute) { ?>
		<tr>
		  <td><?php echo $attribute['name']; ?></td>
		  <td><?php echo $attribute['text']; ?></td>
		</tr>
		<?php } ?>
	  </tbody>
	  <?php } ?>
	</table>
  </div>
  <?php } ?>
  <?php if ($review_status) { ?>
  <div id="tab-review" class="tab-content">
	<div id="review"></div>
	<h2 id="review-title"><?php echo $text_write; ?></h2>
	<b><?php echo $entry_name; ?></b><br />
	<input type="text" name="name" value="" />
	<br />
	<br />
	<b><?php echo $entry_review; ?></b>
	<textarea name="text" cols="40" rows="8" style="width: 98%;"></textarea>
	<span style="font-size: 11px;"><?php echo $text_note; ?></span><br />
	<br />
	<b><?php echo $entry_rating; ?></b> <span><?php echo $entry_bad; ?></span> 
	<input type="radio" name="rating" value="1" />
	 
	<input type="radio" name="rating" value="2" />
	 
	<input type="radio" name="rating" value="3" />
	 
	<input type="radio" name="rating" value="4" />
	 
	<input type="radio" name="rating" value="5" />
	  <span><?php echo $entry_good; ?></span><br />
	<br />
	<b><?php echo $entry_captcha; ?></b><br />
	<input type="text" name="captcha" value="" />
	<br />
	<img src="index.php?route=product/product/captcha" alt="" id="captcha" /><br />
	<br />
	<div class="buttons">
	  <div class="right"><a id="button-review" class="button"><span><?php echo $button_continue; ?></span></a></div>
	</div>
  </div>
  <?php } ?>
  <?php if ($products) { ?>
  <div id="tab-related" class="tab-content">
	<div class="box-product">
	  <?php foreach ($products as $product) { ?>
	  <div>
		<?php if ($product['thumb']) { ?>
		<div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
		<?php } ?>
		<div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
		<?php if ($product['price']) { ?>
		<div class="price">
		  <?php if (!$product['special']) { ?>
		  <?php echo $product['price']; ?>
		  <?php } else { ?>
		  <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
		  <?php } ?>
		</div>
		<?php } ?>
		<?php if ($product['rating']) { ?>
		<div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
		<?php } ?>
		<a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a></div>
	  <?php } ?>
	</div>
  </div>
  <?php } ?>
  <?php if ($tags) { ?>
  <div class="tags"><b><?php echo $text_tags; ?></b>
	<?php foreach ($tags as $tag) { ?>
	<a href="<?php echo $tag['href']; ?>"><?php echo $tag['tag']; ?></a>,
	<?php } ?>
  </div>
  <?php } ?>
  <?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
$('.fancybox').fancybox({cyclic: true});
//--></script>
<script type="text/javascript"><!--
$('#button-cart').bind('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/cart/update',
		type: 'post',
		data: $('.product-info input[type='text'], .product-info input[type='hidden'], .product-info input[type='radio']:checked, .product-info input[type='checkbox']:checked, .product-info select, .product-info textarea'),
		dataType: 'json',
		success: function(json) {
			$('.success, .warning, .attention, information, .error').remove();
		  
			if (json['error']) {
				if (json['error']['warning']) {
					$('#notification').html('<div class="warning" style="display: none;">' + json['error']['warning'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
			  
					$('.warning').fadeIn('slow');
				}
			  
				for (i in json['error']) {
					$('#option-' + i).after('<span class="error">' + json['error'][i] + '</span>');
				}
			}	
					  
			if (json['success']) {
				$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
				  
				$('.success').fadeIn('slow');
				  
				$('#cart_total').html(json['total']);
			  
				$('html, body').animate({ scrollTop: 0 }, 'slow');
			}  
		}
	});
});
//--></script>
<?php if ($options) { ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/ajaxupload.js"></script>
<?php foreach ($options as $option) { ?>
<?php if ($option['type'] == 'file') { ?>
<script type="text/javascript"><!--
new AjaxUpload('#button-option-<?php echo $option['product_option_id']; ?>', {
	action: 'index.php?route=product/product/upload',
	name: 'file',
	autoSubmit: true,
	responseType: 'json',
	onSubmit: function(file, extension) {
		$('#button-option-<?php echo $option['product_option_id']; ?>').after('<img src="catalog/view/theme/default/image/loading.gif" class="loading" style="padding-left: 5px;" />');
	},
	onComplete: function(file, json) {
		$('.error').remove();
	  
		if (json.success) {
			alert(json.success);
		  
			$('input[name='option[<?php echo $option['product_option_id']; ?>]']').attr('value', json.file);
		}
	  
		if (json.error) {
			$('#option-<?php echo $option['product_option_id']; ?>').after('<span class="error">' + json.error + '</span>');
		}
	  
		$('.loading').remove();  
	}
});
//--></script>
<?php } ?>
<?php } ?>
<?php } ?>
<script type="text/javascript"><!--
$('#review .pagination a').live('click', function() {
	$('#review').slideUp('slow');
	  
	$('#review').load(this.href);
  
	$('#review').slideDown('slow');
  
	return false;
});		  

$('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');

$('#button-review').bind('click', function() {
	$.ajax({
		type: 'POST',
		url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',
		dataType: 'json',
		data: 'name=' + encodeURIComponent($('input[name='name']').val()) + '&text=' + encodeURIComponent($('textarea[name='text']').val()) + '&rating=' + encodeURIComponent($('input[name='rating']:checked').val() ? $('input[name='rating']:checked').val() : '') + '&captcha=' + encodeURIComponent($('input[name='captcha']').val()),
		beforeSend: function() {
			$('.success, .warning').remove();
			$('#button-review').attr('disabled', true);
			$('#review-title').after('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" /> <?php echo $text_wait; ?></div>');
		},
		complete: function() {
			$('#button-review').attr('disabled', false);
			$('.attention').remove();
		},
		success: function(data) {
			if (data.error) {
				$('#review-title').after('<div class="warning">' + data.error + '</div>');
			}
		  
			if (data.success) {
				$('#review-title').after('<div class="success">' + data.success + '</div>');
							  
				$('input[name='name']').val('');
				$('textarea[name='text']').val('');
				$('input[name='rating']:checked').attr('checked', '');
				$('input[name='captcha']').val('');
			}
		}
	});
});
//--></script>
<script type="text/javascript"><!--
$('#tabs a').tabs();
//--></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript"><!--
if ($.browser.msie && $.browser.version == 6) {
	$('.date, .datetime, .time').bgIframe();
}

$('.date').datepicker({dateFormat: 'yy-mm-dd'});
$('.datetime').datetimepicker({
	dateFormat: 'yy-mm-dd',
	timeFormat: 'h:m'
});
$('.time').timepicker({timeFormat: 'h:m'});
//--></script>
<?php echo $footer; ?>

/catalog/view/theme/default/template/product/category.tpl

<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
  <div class="breadcrumb">
	<?php foreach ($breadcrumbs as $breadcrumb) { ?>
	<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
	<?php } ?>
  </div>
  <h1><?php echo $heading_title; ?></h1>
  <?php if ($thumb || $description) { ?>
  <div class="category-info">
	<?php if ($thumb) { ?>
	<div class="image"><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ?>" /></div>
	<?php } ?>
	<?php if ($description) { ?>
	<?php echo $description; ?>
	<?php } ?>
  </div>
  <?php } ?>
  <?php if ($categories) { ?>
  <h2><?php echo $text_refine; ?></h2>
  <div class="category-list">
	<?php if (count($categories) <= 5) { ?>




	<ul>
	  <?php foreach ($categories as $category) { ?>
	  <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>


	  <?php } ?>
	</ul>
	<?php } else { ?>
	<?php for ($i = 0; $i < count($categories);) { ?>
	<ul>
	  <?php $j = $i + ceil(count($categories) / 4); ?>
	  <?php for (; $i < $j; $i++) { ?>
	  <?php if (isset($categories[$i])) { ?>
	  <li><a href="<?php echo $categories[$i]['href']; ?>"><?php echo $categories[$i]['name']; ?></a></li>
	  <?php } ?>
	  <?php } ?>
	</ul>
	<?php } ?>
	<?php } ?>
  </div>
  <?php } ?>
  <?php if ($products) { ?>
  <div class="product-filter">
	<div class="display"><b><?php echo $text_display; ?></b> <?php echo $text_list; ?> <b>/</b> <a onclick="display('grid');"><?php echo $text_grid; ?></a></div>
  
<div class="limit"><b><?php echo $text_limit; ?></b>
	  <select onchange="location = this.value;">
		<?php foreach ($limits as $limits) { ?>
		<?php if ($limits['value'] == $limit) { ?>
		<option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
		<?php } else { ?>
		<option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
		<?php } ?>
		<?php } ?>
	  </select>
	</div>
	<div class="sort"><b><?php echo $text_sort; ?></b>
	  <select onchange="location = this.value;">
		<?php foreach ($sorts as $sorts) { ?>
		<?php if ($sorts['value'] == $sort . '-' . $order) { ?>
		<option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
		<?php } else { ?>
		<option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
		<?php } ?>
		<?php } ?>
	  </select>
	</div>
  </div>
  <div class="product-compare"><a href="<?php echo $compare; ?>" id="compare_total"><?php echo $text_compare; ?></a></div>
  <div class="product-list">
	<?php foreach ($products as $product) { ?>
	<div>
	  <?php if ($product['thumb']) { ?>
	  <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
	  <?php } ?>
	  <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
	  <div class="description"><?php echo $product['description']; ?></div>
	  <?php if ($product['price']) { ?>
	  <div class="price">
		<?php if (!$product['special']) { ?>
		Цена от <?php echo $product['price']; ?>
		<?php } else { ?>
		<span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
		<?php } ?>
		<?php if ($product['tax']) { ?>
		<br />
		<span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
		<?php } ?>
	  </div>
	  <?php } ?>
	  <?php if ($product['rating']) { ?>
	  <div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
	  <?php } ?>
	  <div class="cart"><a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a></div>
	  <div class="wishlist"><a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><?php echo $button_wishlist; ?></a></div>
	  <div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>
	</div>
	<?php } ?>
  </div>
  <div class="pagination"><?php echo $pagination; ?></div>
  <?php } ?>
  <?php if (!$categories && !$products) { ?>
  <div class="content"><?php echo $text_empty; ?></div>
  <div class="buttons">
	<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
  </div>
  <?php } ?>
  <?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
function display(view) {
	if (view == 'list') {
		$('.product-grid').attr('class', 'product-list');
	  
		$('.product-list > div').each(function(index, element) {
			html  = '<div class="right">';
			html += '  <div class="cart">' + $(element).find('.cart').html() + '</div>';
			html += '  <div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';
			html += '  <div class="compare">' + $(element).find('.compare').html() + '</div>';
			html += '</div>';		  
		  
			html += '<div class="left">';
		  
			var image = $(element).find('.image').html();
		  
			if (image != null) {
				html += '<div class="image">' + image + '</div>';
			}
		  
			var price = $(element).find('.price').html();
		  
			if (price != null) {
				html += '<div class="price">' + price  + '</div>';
			}
				  
			html += '  <div class="name">' + $(element).find('.name').html() + '</div>';
			html += '  <div class="description">' + $(element).find('.description').html() + '</div>';
		  
			var rating = $(element).find('.rating').html();
		  
			if (rating != null) {
				html += '<div class="rating">' + rating + '</div>';
			}
			  
			html += '</div>';

					  
			$(element).html(html);
		});	  
	  
		$('.display').html('<b><?php echo $text_display; ?></b> <?php echo $text_list; ?> <b>/</b> <a onclick="display('grid');"><?php echo $text_grid; ?></a>');
	  
		$.cookie('display', 'list');
	} else {
		$('.product-list').attr('class', 'product-grid');
	  
		$('.product-grid > div').each(function(index, element) {
			html = '';
		  
			var image = $(element).find('.image').html();
		  
			if (image != null) {
				html += '<div class="image">' + image + '</div>';
			}
		  
			html += '<div class="name">' + $(element).find('.name').html() + '</div>';
			html += '<div class="description">' + $(element).find('.description').html() + '</div>';
		  
			var price = $(element).find('.price').html();
		  
			if (price != null) {
				html += '<div class="price">' + price  + '</div>';
			}
		  
			var rating = $(element).find('.rating').html();
		  
			if (rating != null) {
				html += '<div class="rating">' + rating + '</div>';
			}
					  
			html += '<div class="cart">' + $(element).find('.cart').html() + '</div>';
			html += '<div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';
			html += '<div class="compare">' + $(element).find('.compare').html() + '</div>';
		  
			$(element).html(html);
		});  
				  
		$('.display').html('<b><?php echo $text_display; ?></b> <a onclick="display('list');"><?php echo $text_list; ?></a> <b>/</b> <?php echo $text_grid; ?>');
	  
		$.cookie('display', 'grid');
	}
}

view = $.cookie('display');

if (view) {
	display(view);
} else {
	display('list');
}
//--></script>
<?php echo $footer; ?>

/catalog/view/theme/default/template/common/header.tpl

<?php if (isset($_SERVER['HTTP_USER_AGENT']) && !strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6')) echo '<?xml version="1.0" encoding="UTF-8"?>'. "n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>" xml:lang="<?php echo $lang; ?>">
<head>
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<?php if ($icon) { ?>
<link href="<?php echo $icon; ?>" rel="icon" />
<?php } ?>
<?php foreach ($links as $link) { ?>
<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
<?php } ?>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/stylesheet.css" />
<?php foreach ($styles as $style) { ?>
<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" />
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/external/jquery.cookie.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<!--[if IE]>
<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4-iefix.js"></script>
<![endif]-->
<script type="text/javascript" src="catalog/view/javascript/jquery/tabs.js"></script>
<script type="text/javascript" src="catalog/view/javascript/common.js"></script>

<link rel="stylesheet" type="text/css" href="catalog/view/javascript/tree_category/dtree.css" />
<?php foreach ($scripts as $script) { ?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php } ?>
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie7.css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie6.css" />
<script type="text/javascript" src="catalog/view/javascript/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('#logo img');
</script>
<![endif]-->
<?php echo $google_analytics; ?>




<script type="text/javascript">
$(document).ready(function() {
$('.option').change(function() {
var OriginalPrice = $('#thisIsOriginal').text();
if (isNaN(parseInt(OriginalPrice.substring(0, 1))))
{
var OriginalCurrency = OriginalPrice.substring(0,1);
//alert(OriginalCurrency);
OriginalPrice = OriginalPrice.substring(1);
var newPriceValue = $('.option :selected').text();
var position1 = newPriceValue.indexOf("(");
var position2 = newPriceValue.indexOf(")");
var signFinalPriceValue=newPriceValue.substring(position1+1, position1+2);
position1 = position1+3;
var finalPriceValue = newPriceValue.substring(position1, position2);
if(finalPriceValue.indexOf(',') == -1)
{
finalPriceValue = "0";
}
finalPriceValue = parseFloat(finalPriceValue);
finalPriceValue = finalPriceValue.toFixed(2);
$('#priceUpdate').text(OriginalCurrency + finalPriceValue.replace(".",","));
}
else
{
var OriginalCurrency = OriginalPrice.substring(OriginalPrice.length-3, OriginalPrice.length);
OriginalPrice = OriginalPrice.substring();
var newPriceValue = $('.option :selected').text();
var position1 = newPriceValue.indexOf("(");
var position2 = newPriceValue.indexOf(")");
position1 = position1+1;
var finalPriceValue = newPriceValue.substring(position1, position2-4);
if(finalPriceValue.indexOf(',') == -1)
{
finalPriceValue = "0";
}
finalPriceValue = parseFloat(finalPriceValue.replace(",",".")) ;
finalPriceValue = finalPriceValue.toFixed(2);
$('#priceUpdate').text(finalPriceValue.replace(".",",") + OriginalCurrency);
}
});
});
</script>

</head>
<body>
<div id="container">
<div id="header">
  <?php if ($logo) { ?>
  <div id="logo"><a href="<?php echo $home; ?>"><img src="/image/data/dog.gif" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a></div>
  <?php } ?>
  <?php if (count($languages) > 1) { ?>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
		<div id="language"><?php echo $text_language; ?><br />
		  <?php foreach ($languages as $language) { ?>
		   <img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" title="<?php echo $language['name']; ?>" onclick="$('input[name='language_code']').attr('value', '<?php echo $language['code']; ?>').submit(); $(this).parent().parent().submit();" />
		  <?php } ?>
		  <input type="hidden" name="language_code" value="" />
		  <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
		</div>
  </form>
  <?php } ?>
  <?php if (count($currencies) > 1) { ?>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
		<div id="currency"><?php echo $text_currency; ?><br />
		  <?php foreach ($currencies as $currency) { ?>
		  <?php if ($currency['code'] == $currency_code) { ?>
		  <?php if ($currency['symbol_left']) { ?>
		  <a title="<?php echo $currency['title']; ?>"><b><?php echo $currency['symbol_left']; ?></b></a>
		  <?php } else { ?>
		  <a title="<?php echo $currency['title']; ?>"><b><?php echo $currency['symbol_right']; ?></b></a>
		  <?php } ?>
		  <?php } else { ?>
		  <?php if ($currency['symbol_left']) { ?>
		  <a title="<?php echo $currency['title']; ?>" onclick="$('input[name='currency_code']').attr('value', '<?php echo $currency['code']; ?>').submit(); $(this).parent().parent().submit();"><?php echo $currency['symbol_left']; ?></a>
		  <?php } else { ?>
		  <a title="<?php echo $currency['title']; ?>" onclick="$('input[name='currency_code']').attr('value', '<?php echo $currency['code']; ?>').submit(); $(this).parent().parent().submit();"><?php echo $currency['symbol_right']; ?></a>
		  <?php } ?>
		  <?php } ?>
		  <?php } ?>
		  <input type="hidden" name="currency_code" value="" />
		  <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
		</div>
  </form>
  <?php } ?>
  <div id="cart">
		<div class="heading">
		  <h4><?php echo $text_cart; ?></h4>
		  <a><span id="cart_total"><?php echo $text_items; ?></span></a></div>
		<div class="content"></div>
  </div>
  <div id="search">
		<div class="button-search"></div>
		<?php if ($filter_name) { ?>
		<input type="text" name="filter_name" value="<?php echo $filter_name; ?>" />
		<?php } else { ?>
		<input type="text" name="filter_name" value="<?php echo $text_search; ?>" onclick="this.value = '';" onkeydown="this.style.color = '#000000';" />
		<?php } ?>
  </div>
  <!-- <div id="welcome">
		<?php if (!$logged) { ?>
		<?php echo $text_welcome; ?>
		<?php } else { ?>
		<?php echo $text_logged; ?>
		<?php } ?>
  </div> -->
  <div class="links"><!-- <a href="<?php echo $home; ?>"><?php echo $text_home; ?> --></a><a href="<?php echo $wishlist; ?>" id="wishlist_total"><?php echo $text_wishlist; ?></a><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a><a href="<?php echo $cart; ?>"><?php echo $text_cart; ?></a><a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>
</div>
<?php if ($categories) { ?>
<div id="menu">
  <ul>
		<?php foreach ($categories as $category) { ?>
		<li><?php if ($category['active']) { ?>
<a href="<?php echo $category['href']; ?>" class="active"><?php echo $category['name']; ?></a>
<?php } else { ?>
<a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php } ?>
		  <?php if ($category['children']) { ?>
		  <div>
				<?php for ($i = 0; $i < count($category['children']);) { ?>
				<ul>
				  <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
				  <?php for (; $i < $j; $i++) { ?>
				  <?php if (isset($category['children'][$i])) { ?>
				  <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
				  <?php } ?>
				  <?php } ?>
				</ul>
				<?php } ?>
		  </div>
		  <?php } ?>
		</li>
		<?php } ?>
  </ul>
</div>
<?php } ?>
<div id="notification"></div>
Надіслати
Поділитися на інших сайтах


Вариант с изменением цены в бесплатном воплощении, к сожалению, имеет ряд недостатков:

1) он поддерживает только Дропбокс. А в большинстве магазинов требуется использовать еще и Radio и Checkbox, где цена уже не будет меняться. Это создаст еще больше неудобств для клиентов, когда цена то будет меняться в одних товарах, то нет.

Во-вторых, цена товара в этом случае должна быть равна 0. Т.е. до выбора необходимой опции в карточке товара цена будет указываться 0. И тоже самое в списке товаров будет цена 0. А по идее должно быть "Цена от..." и указываться минимальная цена на товар.

Поэтому лично я воспользовался бесплатным плагином "Цена от" http://forum.opencart.com/viewtopic.php?f=20&t=8929&start=20#p243037. Это английская версия. Нужно просто заменить в файлике "Price from" на "от" и будет счастье.

В этом случае в списках товарах будет указываться минимальная цена, вместо 0, а в карточке товара будет писаться "Цена: от..."

А в будущем конечно разберусь с ПейПал и куплю плагин http://www.opencart.com/index.php?route=extension/extension/info&extension_id=1458

Надіслати
Поділитися на інших сайтах


А по идее должно быть "Цена от..." и указываться минимальная цена на товар.

Cмотрите скриншот, цена от=цене в данных (основная), цена каждой опции проставляется отдельно - реальная, а не + к основной.

он поддерживает только Дропбокс.

Да поддержвает только дропбокс, но большинство магазинов не нуждаются в опциях больше 1 вида. Если оций много - этот вариант не подходит.
Надіслати
Поділитися на інших сайтах


Cмотрите скриншот, цена от=цене в данных (основная), цена каждой опции проставляется отдельно - реальная, а не + к основной.

Ваше решение отличается. Я говорил про решение http://loco.ru/materials/205-opencart-auto-update-price-option-selection . Может что-то не то делал, но почему-то если указывать основную цену и цену атрибута, то цена плюсовалась, а не заменялась.

Да поддержвает только дропбокс, но большинство магазинов не нуждаются в опциях больше 1 вида. Если оций много - этот вариант не подходит.

Дропбокс все равно не заменит ту же Radio-кнопку с картинкой около нее. Сложно выбирать тот же цвет его не видя. Чекбокс тем более. Если у товара есть дополнительная комплектация, то без чекбокс не обойтись. На самом деле эти функции используются достаточно часто, чтобы раскошелиться на 10 долларов.
Надіслати
Поділитися на інших сайтах


Ваше решение отличается. Я говорил про решение http://loco.ru/mater...ption-selection . Может что-то не то делал, но почему-то если указывать основную цену и цену атрибута, то цена плюсовалась, а не заменялась.

Дропбокс все равно не заменит ту же Radio-кнопку с картинкой около нее. Сложно выбирать тот же цвет его не видя. Чекбокс тем более. Если у товара есть дополнительная комплектация, то без чекбокс не обойтись. На самом деле эти функции используются достаточно часто, чтобы раскошелиться на 10 долларов.

10 доллров сумма не большая, но зачем платить, если запросы поменьше чем у Вас... и данных функций хватает.
Надіслати
Поділитися на інших сайтах


Второй вариант (мне нравится намного больше, но есть проблема. При цене, например 45,45 - в измененной цене будет показывать 45,40 (а в корзине показывает правильную цену). Округляет сотые копейки, может кто-то найдет причину - будет замечательно, а я пока без сотых копеек забиваю цену)

Во-первых, в опциях теперь можно писать реальную цену товара, а не +какая-то сумма к цене в данных.

Во-вторых, в витрине будет показывать "цена от" и та цена, которую Вы поставите в данных. Выглядит это так:

ИзображениеИзображение

Все файлы (целиком), которые менялись:

/catalog/language/russian/product/product.php

<?php
// Text
$_['text_search']	   = 'Поиск';
$_['text_brand']		= 'Производитель';
$_['text_manufacturer'] = 'Производитель:';
$_['text_model']		= 'Модель:';
$_['text_reward']	   = 'Бонусные баллы:';
$_['text_points']	   = 'Цена в бонусных баллах:';
$_['text_stock']		= 'Наличие:';
$_['text_instock']	  = 'В наличии';
$_['text_price']		= 'Цена от:';
$_['text_tax']		  = 'С налогом:';
$_['text_discount']	 = '%s или более %s';
$_['text_option']	   = 'Опции:';
$_['text_qty']		  = 'Количество:';
$_['text_minimum']	  = 'Минимальное количество заказа этого товара: %s';
$_['text_or']		   = '- или -';
$_['text_reviews']	  = 'Отзывов: %s';
$_['text_write']		= 'Оставить отзыв';
$_['text_no_reviews']   = 'Ещё никто не оставил отзыв о товаре.';
$_['text_note']		 = '<span style="color: #FF0000;">Внимание:</span> HTML не поддерживается! Используйте обычный текст.';
$_['text_share']		= 'Поделиться';
$_['text_success']	  = 'Спасибо за Ваш отзыв. Он отправлен администратору на утверждение.';
$_['text_upload']	   = 'Файл успешно загружен на сервер!';
$_['text_wait']		 = 'Подождите пожалуйста!';
$_['text_tags']		 = 'Метки:';
$_['text_error']		= 'Товар не найден!';

// Entry
$_['entry_name']		= 'Ваше Имя:';
$_['entry_review']	  = 'Ваш отзыв:';
$_['entry_rating']	  = 'Оценка:';
$_['entry_good']		= 'Хорошо';
$_['entry_bad']		 = 'Плохо';
$_['entry_captcha']	 = 'Введите код, указанный на картинке:';

// Tabs
$_['tab_description']   = 'Описание';
$_['tab_attribute']	 = 'Характеристики';
$_['tab_review']		= 'Отзывы (%s)';
$_['tab_related']	   = 'Похожие товары';

// Error
$_['error_name']		= 'Название отзыва должно быть от 3 до 25 символов!';
$_['error_text']		= 'Текст отзыва должен быть от 25 до 1000 символов!';
$_['error_rating']	  = 'Пожалуйста, выберите оценку!';
$_['error_captcha']	 = 'Код, указанный на картинке, введен неверно!';
$_['error_upload']	  = 'Требуется загрузка файла!';
$_['error_filename']	= 'Имя файла должно быть от 3 до 128 символов!';
$_['error_filetype']	= 'Неправильное расширение файла!';
?>
</p>

/system/library/cart.php

<?php
	final class Cart {
		 public function __construct($registry) {
		  $this->config = $registry->get('config');
		  $this->customer = $registry->get('customer');
		  $this->session = $registry->get('session');
		  $this->db = $registry->get('db');
		  $this->tax = $registry->get('tax');
		  $this->weight = $registry->get('weight');

		  if (!isset($this->session->data['cart']) || !is_array($this->session->data['cart'])) {
				$this->session->data['cart'] = array();
		   }
	   }
		  
		 public function getProducts() {
		  $product_data = array();
		
		   foreach ($this->session->data['cart'] as $key => $quantity) {
				$product = explode(':', $key);
				$product_id = $product[0];
			 $stock = true;

			 // Options
				if (isset($product[1])) {
				  $options = unserialize(base64_decode($product[1]));
				} else {
				  $options = array();
				}
			
				$product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.date_available <= NOW() AND p.status = '1'");
				
			 if ($product_query->num_rows) {
				   $option_price = 0;
				$option_points = 0;
				$option_weight = 0;

				   $option_data = array();
		
				   foreach ($options as $product_option_id => $option_value) {
				   $option_query = $this->db->query("SELECT po.product_option_id, po.option_id, od.name, o.type FROM " . DB_PREFIX . "product_option po LEFT JOIN `" . DB_PREFIX . "option` o ON (po.option_id = o.option_id) LEFT JOIN " . DB_PREFIX . "option_description od ON (o.option_id = od.option_id) WHERE po.product_option_id = '" . (int)$product_option_id . "' AND po.product_id = '" . (int)$product_id . "' AND od.language_id = '" . (int)$this->config->get('config_language_id') . "'");
				  
				   if ($option_query->num_rows) {
					  if ($option_query->row['type'] == 'select' || $option_query->row['type'] == 'radio') {
						 $option_value_query = $this->db->query("SELECT pov.option_value_id, ovd.name, pov.quantity, pov.subtract, pov.price, pov.price_prefix, pov.points, pov.points_prefix, pov.weight, pov.weight_prefix FROM " . DB_PREFIX . "product_option_value pov LEFT JOIN " . DB_PREFIX . "option_value ov ON (pov.option_value_id = ov.option_value_id) LEFT JOIN " . DB_PREFIX . "option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) WHERE pov.product_option_value_id = '" . (int)$option_value . "' AND pov.product_option_id = '" . (int)$product_option_id . "' AND ovd.language_id = '" . (int)$this->config->get('config_language_id') . "'");
						
						 if ($option_value_query->num_rows) {
							if ($option_value_query->row['price_prefix'] == '+') {
							   $option_price += $option_value_query->row['price'];
							} elseif ($option_value_query->row['price_prefix'] == '-') {
							   $option_price -= $option_value_query->row['price'];
							} elseif ($option_value_query->row['price_prefix'] == '=') {
							   $option_price = $option_value_query->row['price'];}
						  

							if ($option_value_query->row['points_prefix'] == '+') {
							   $option_points += $option_value_query->row['points'];
							} elseif ($option_value_query->row['points_prefix'] == '-') {
							   $option_points -= $option_value_query->row['points'];
							}
												
							if ($option_value_query->row['weight_prefix'] == '+') {
							   $option_weight += $option_value_query->row['weight'];
							} elseif ($option_value_query->row['weight_prefix'] == '-') {
							   $option_weight -= $option_value_query->row['weight'];
							}
						  
							if ($option_value_query->row['subtract'] && (!$option_value_query->row['quantity'] || ($option_value_query->row['quantity'] < $quantity))) {
							   $stock = false;
							}
						  
							$option_data[] = array(
							   'product_option_id'	   => $product_option_id,
							   'product_option_value_id' => $option_value,
							   'option_id'			   => $option_query->row['option_id'],
							   'option_value_id'		 => $option_value_query->row['option_value_id'],
							   'name'					=> $option_query->row['name'],
							   'option_value'			=> $option_value_query->row['name'],
							   'type'					=> $option_query->row['type'],
							   'quantity'				=> $option_value_query->row['quantity'],
							   'subtract'				=> $option_value_query->row['subtract'],
							   'price'				   => $option_value_query->row['price'],
							   'price_prefix'			=> $option_value_query->row['price_prefix'],
							   'points'				  => $option_value_query->row['points'],
							   'points_prefix'		   => $option_value_query->row['points_prefix'],						  
							   'weight'				  => $option_value_query->row['weight'],
							   'weight_prefix'		   => $option_value_query->row['weight_prefix']
							);					  
						 }
					  } elseif ($option_query->row['type'] == 'checkbox' && is_array($option_value)) {
						 foreach ($option_value as $product_option_value_id) {
							$option_value_query = $this->db->query("SELECT pov.option_value_id, ovd.name, pov.quantity, pov.subtract, pov.price, pov.price_prefix, pov.points, pov.points_prefix, pov.weight, pov.weight_prefix FROM " . DB_PREFIX . "product_option_value pov LEFT JOIN " . DB_PREFIX . "option_value ov ON (pov.option_value_id = ov.option_value_id) LEFT JOIN " . DB_PREFIX . "option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) WHERE pov.product_option_value_id = '" . (int)$product_option_value_id . "' AND pov.product_option_id = '" . (int)$product_option_id . "' AND ovd.language_id = '" . (int)$this->config->get('config_language_id') . "'");
						  
							if ($option_value_query->num_rows) {
							   if ($option_value_query->row['price_prefix'] == '+') {
								  $option_price += $option_value_query->row['price'];
							   } elseif ($option_value_query->row['price_prefix'] == '-') {
								  $option_price -= $option_value_query->row['price'];
							   } elseif ($option_value_query->row['price_prefix'] == '=') {
							   $option_price = $option_value_query->row['price'];}
							  

							   if ($option_value_query->row['points_prefix'] == '+') {
								  $option_points += $option_value_query->row['points'];
							   } elseif ($option_value_query->row['points_prefix'] == '-') {
								  $option_points -= $option_value_query->row['points'];
							   }
												  
							   if ($option_value_query->row['weight_prefix'] == '+') {
								  $option_weight += $option_value_query->row['weight'];
							   } elseif ($option_value_query->row['weight_prefix'] == '-') {
								  $option_weight -= $option_value_query->row['weight'];
							   }
							  
							   if ($option_value_query->row['subtract'] && (!$option_value_query->row['quantity'] || ($option_value_query->row['quantity'] < $quantity))) {
								  $stock = false;
							   }
							  
							   $option_data[] = array(
								  'product_option_id'	   => $product_option_id,
								  'product_option_value_id' => $product_option_value_id,
								  'option_id'			   => $option_query->row['option_id'],
								  'option_value_id'		 => $option_value_query->row['option_value_id'],
								  'name'					=> $option_query->row['name'],
								  'option_value'			=> $option_value_query->row['name'],
								  'type'					=> $option_query->row['type'],
								  'quantity'				=> $option_value_query->row['quantity'],
								  'subtract'				=> $option_value_query->row['subtract'],
								  'price'				   => $option_value_query->row['price'],
								  'price_prefix'			=> $option_value_query->row['price_prefix'],
								  'points'				  => $option_value_query->row['points'],
								  'points_prefix'		   => $option_value_query->row['points_prefix'],
								  'weight'				  => $option_value_query->row['weight'],
								  'weight_prefix'		   => $option_value_query->row['weight_prefix']
							   );					  
							}
						 }				
					  } elseif ($option_query->row['type'] == 'text' || $option_query->row['type'] == 'textarea' || $option_query->row['type'] == 'file' || $option_query->row['type'] == 'date' || $option_query->row['type'] == 'datetime' || $option_query->row['type'] == 'time') {
						 $option_data[] = array(
							'product_option_id'	   => $product_option_id,
							'product_option_value_id' => '',
							'option_id'			   => $option_query->row['option_id'],
							'option_value_id'		 => '',
							'name'					=> $option_query->row['name'],
							'option_value'			=> $option_value,
							'type'					=> $option_query->row['type'],
							'quantity'				=> '',
							'subtract'				=> '',
							'price'				   => '',
							'price_prefix'			=> '',
							'points'				  => '',
							'points_prefix'		   => '',					  
							'weight'				  => '',
							'weight_prefix'		   => ''
						 );				
					  }
				   }
				   }
			
				if ($this->customer->isLogged()) {
				   $customer_group_id = $this->customer->getCustomerGroupId();
				} else {
				   $customer_group_id = $this->config->get('config_customer_group_id');
				}
			  
				$price = $product_query->row['price'];
			  
				// Product Discounts
				$discount_quantity = 0;
			  
				foreach ($this->session->data['cart'] as $key_2 => $quantity_2) {
				   $product_2 = explode(':', $key_2);
				  
				   if ($product_2[0] == $product_id) {
					  $discount_quantity += $quantity_2;
				   }
				}
			  
				$product_discount_query = $this->db->query("SELECT price FROM " . DB_PREFIX . "product_discount WHERE product_id = '" . (int)$product_id . "' AND customer_group_id = '" . (int)$customer_group_id . "' AND quantity <= '" . (int)$discount_quantity . "' AND ((date_start = '0000-00-00' OR date_start < NOW()) AND (date_end = '0000-00-00' OR date_end > NOW())) ORDER BY quantity DESC, priority ASC, price ASC LIMIT 1");
			  
				if ($product_discount_query->num_rows) {
				   $price = $product_discount_query->row['price'];
				}
			  
				// Product Specials
				$product_special_query = $this->db->query("SELECT price FROM " . DB_PREFIX . "product_special WHERE product_id = '" . (int)$product_id . "' AND customer_group_id = '" . (int)$customer_group_id . "' AND ((date_start = '0000-00-00' OR date_start < NOW()) AND (date_end = '0000-00-00' OR date_end > NOW())) ORDER BY priority ASC, price ASC LIMIT 1");
			
				if ($product_special_query->num_rows) {
				   $price = $product_special_query->row['price'];
				}				
		
				// Reward Points
				$query = $this->db->query("SELECT points FROM " . DB_PREFIX . "product_reward WHERE product_id = '" . (int)$product_id . "' AND customer_group_id = '" . (int)$customer_group_id . "'");
			  
				if ($query->num_rows) {  
				   $reward = $query->row['points'];
				} else {
				   $reward = 0;
				}
			  
				// Downloads	
				$download_data = array();		  
			  
				$download_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_download p2d LEFT JOIN " . DB_PREFIX . "download d ON (p2d.download_id = d.download_id) LEFT JOIN " . DB_PREFIX . "download_description dd ON (d.download_id = dd.download_id) WHERE p2d.product_id = '" . (int)$product_id . "' AND dd.language_id = '" . (int)$this->config->get('config_language_id') . "'");
			
				foreach ($download_query->rows as $download) {
					 $download_data[] = array(
						  'download_id' => $download['download_id'],
					  'name'		=> $download['name'],
					  'filename'	=> $download['filename'],
					  'mask'		=> $download['mask'],
					  'remaining'   => $download['remaining']
					 );
				}
			  
				// Stock
				if (!$product_query->row['quantity'] || ($product_query->row['quantity'] < $quantity)) {
				   $stock = false;
				}
				if (!$option_price){$option_price=$price;}
				   $product_data[$key] = array(
					 'key'			 => $key,
					 'product_id'	  => $product_query->row['product_id'],
					 'name'			=> $product_query->row['name'],
					 'model'		   => $product_query->row['model'],
				   'shipping'		=> $product_query->row['shipping'],
					 'image'		   => $product_query->row['image'],
					 'option'		  => $option_data,
				   'download'		=> $download_data,
					 'quantity'		=> $quantity,
					 'minimum'		 => $product_query->row['minimum'],
				   'subtract'		=> $product_query->row['subtract'],
				   'stock'		   => $stock,
					 'price'		   => ($option_price),
					 'total'		   => ($option_price) * $quantity,
				   'reward'		  => $reward * $quantity,
				   'points'		  => ($product_query->row['points'] + $option_points) * $quantity,
				   'tax_class_id'	=> $product_query->row['tax_class_id'],
					 'weight'		  => ($product_query->row['weight'] + $option_weight) * $quantity,
					 'weight_class_id' => $product_query->row['weight_class_id'],
					 'length'		  => $product_query->row['length'],
				   'width'		   => $product_query->row['width'],
				   'height'		  => $product_query->row['height'],
					 'length_class_id' => $product_query->row['length_class_id']			  
				   );
			 } else {
				$this->remove($key);
			 }
		   }
					
		  return $product_data;
		 }
		  
		 public function add($product_id, $qty = 1, $options = array()) {
		   if (!$options) {
				$key = (int)$product_id;
		   } else {
				$key = (int)$product_id . ':' . base64_encode(serialize($options));
		   }
		  
		  if ((int)$qty && ((int)$qty > 0)) {
			  if (!isset($this->session->data['cart'][$key])) {
				   $this->session->data['cart'][$key] = (int)$qty;
			  } else {
				   $this->session->data['cart'][$key] += (int)$qty;
			  }
		  }
		 }

		 public function update($key, $qty) {
		   if ((int)$qty && ((int)$qty > 0)) {
				$this->session->data['cart'][$key] = (int)$qty;
		   } else {
			   $this->remove($key);
		  }
		 }

		 public function remove($key) {
		  if (isset($this->session->data['cart'][$key])) {
			   unset($this->session->data['cart'][$key]);
			}
	   }
	  
		 public function clear() {
		  $this->session->data['cart'] = array();
		 }
	  
		 public function getWeight() {
		  $weight = 0;
	  
		   foreach ($this->getProducts() as $product) {
			 if ($product['shipping']) {
				   $weight += $this->weight->convert($product['weight'], $product['weight_class_id'], $this->config->get('config_weight_class_id'));
			 }
		  }
	  
		  return $weight;
	   }
	  
		 public function getSubTotal() {
		  $total = 0;
		
		  foreach ($this->getProducts() as $product) {
			 $total += $product['total'];
		  }

		  return $total;
		 }
	  
	   public function getTaxes() {
		  $taxes = array();
		
		  foreach ($this->getProducts() as $product) {
			 if ($product['tax_class_id']) {
				if (!isset($taxes[$product['tax_class_id']])) {
				   $taxes[$product['tax_class_id']] = $product['total'] / 100 * $this->tax->getRate($product['tax_class_id']);
				} else {
				   $taxes[$product['tax_class_id']] += $product['total'] / 100 * $this->tax->getRate($product['tax_class_id']);
				}
			 }
		  }
		
		  return $taxes;
		 }

		 public function getTotal() {
		  $total = 0;
		
		  foreach ($this->getProducts() as $product) {
			 $total += $this->tax->calculate($product['total'], $product['tax_class_id'], $this->config->get('config_tax'));
		  }

		  return $total;
		 }
		
	   public function getTotalRewardPoints() {
		  $total = 0;
		
		  foreach ($this->getProducts() as $product) {
			 $total += $product['reward'];
		  }

		  return $total;
		 }
		  
		 public function countProducts() {
		  $product_total = 0;
			
		  $products = $this->getProducts();
			
		  foreach ($products as $product) {
			 $product_total += $product['quantity'];
		  }	
				  
		  return $product_total;
	   }
	  
		 public function hasProducts() {
		   return count($this->session->data['cart']);
		 }
	
		 public function hasStock() {
		  $stock = true;
		
		  foreach ($this->getProducts() as $product) {
			 if (!$product['stock']) {
				 $stock = false;
			 }
		  }
		
		   return $stock;
		 }
	
		 public function hasShipping() {
		  $shipping = false;
		
		  foreach ($this->getProducts() as $product) {
			   if ($product['shipping']) {
				 $shipping = true;
			  
				break;
			   }	
		  }
		
		  return $shipping;
	   }
	  
		 public function hasDownload() {
		  $download = false;
		
		  foreach ($this->getProducts() as $product) {
			   if ($product['download']) {
				 $download = true;
			  
				break;
			   }	
		  }
		
		  return $download;
	   }  
	}
	?>

/catalog/view/theme/default/template/product/product.tpl

<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
<div id="thisIsOriginal" style="visibility: hidden; height:0px;"><?php echo $price; ?></div>

  <div class="breadcrumb">
	<?php foreach ($breadcrumbs as $breadcrumb) { ?>
	<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
	<?php } ?>
  </div>
  <h1><?php echo $heading_title; ?></h1>
  <div class="product-info">
	<?php if ($thumb || $images) { ?>
	<div class="left">
	  <?php if ($thumb) { ?>
	  <div class="image"><a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox"><img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image" /></a></div>
	  <?php } ?>
	  <?php if ($images) { ?>
	  <div class="image-additional">
		<?php foreach ($images as $image) { ?>
		<a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox"><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a>
		<?php } ?>
	  </div>
	  <?php } ?>
	</div>
	<?php } ?>
	<div class="right">
	  <div class="description">
		<?php if ($manufacturer) { ?>
		<span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
		<?php } ?>
		<span><?php echo $text_model; ?></span> <?php echo $model; ?><br />
		<span><?php echo $text_reward; ?></span> <?php echo $reward; ?><br />
		<span><?php echo $text_stock; ?></span> <?php echo $stock; ?></div>
	  <?php if ($price) { ?>
	  <div class="price"><?php echo $text_price; ?>
		<?php if (!$special) { ?>

<span id="priceUpdate"><?php echo $price; ?></span>
	
		<?php } else { ?>



  <?php echo $price; ?>

<span class="price-old"><?php echo $price; ?></span> <span class="price-new"><span id="priceUpdate"><?php echo $special; ?></span></span>
	  
	  
<?php } ?>
		<br />
		<?php if ($tax) { ?>
		<span class="price-tax"><?php echo $text_tax; ?> <?php echo $tax; ?></span><br />
		<?php } ?>
		<?php if ($points) { ?>
		<span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span> <br />
		<?php } ?>
		<?php if ($discounts) { ?>
		<br />
		<div class="discount">
		  <?php foreach ($discounts as $discount) { ?>
		  <?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><br />
		  <?php } ?>
		</div>
		<?php } ?>
	  </div>
	  <?php } ?>
	  <?php if ($options) { ?>
	  <div class="options">
		<h2><?php echo $text_option; ?></h2>
		<br />
		<?php foreach ($options as $option) { ?>
		<?php if ($option['type'] == 'select') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <select name="option[<?php echo $option['product_option_id']; ?>]">
			<option value=""><?php echo $text_select; ?></option>
			<?php foreach ($option['option_value'] as $option_value) { ?>
			<option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
			<?php if ($option_value['price']) { ?>
		  
(<span id="newPrice"><?php echo $option_value['price']; ?></span>)

			<?php } ?>
			</option>
			<?php } ?>
		  </select>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'radio') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <?php foreach ($option['option_value'] as $option_value) { ?>
		  <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
		  <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
			<?php if ($option_value['price_full']) { ?>
			(<?php echo $option_value['price']; ?>)
			<?php } ?>
		  </label>
		  <br />
		  <?php } ?>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'checkbox') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <?php foreach ($option['option_value'] as $option_value) { ?>
		  <input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
		  <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
			<?php if ($option_value['price']) { ?>

			(<?php echo $option_value['price']; ?>)
			<?php } ?>
		  </label>
		  <br />
		  <?php } ?>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'image') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
			<table class="option-image">
			  <?php foreach ($option['option_value'] as $option_value) { ?>
			  <tr>
				<td style="width: 1px;"><input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" /></td>
				<td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" /></label></td>
				<td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
					<?php if ($option_value['price']) { ?>
					(<?php echo $option_value['price']; ?>)
					<?php } ?>
				  </label></td>
			  </tr>
			  <?php } ?>
			</table>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'text') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'textarea') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <textarea name="option[<?php echo $option['product_option_id']; ?>]" cols="40" rows="5"><?php echo $option['option_value']; ?></textarea>
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'file') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <a id="button-option-<?php echo $option['product_option_id']; ?>" class="button"><span><?php echo $button_upload; ?></span></a>
		  <input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" />
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'date') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="date" />
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'datetime') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="datetime" />
		</div>
		<br />
		<?php } ?>
		<?php if ($option['type'] == 'time') { ?>
		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
		  <?php if ($option['required']) { ?>
		  <span class="required">*</span>
		  <?php } ?>
		  <b><?php echo $option['name']; ?>:</b><br />
		  <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="time" />
		</div>
		<br />
		<?php } ?>
		<?php } ?>
	  </div>
	  <?php } ?>
	  <div class="cart">
		<div><?php echo $text_qty; ?>
		  <input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" />
		  <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
		   <a id="button-cart" class="button"><span><?php echo $button_cart; ?></span></a></div>
		<div><span>   <?php echo $text_or; ?>   </span></div>
		<div><a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a><br />
		  <a onclick="addToCompare('<?php echo $product_id; ?>');"><?php echo $button_compare; ?></a></div>
		<?php if ($minimum > 1) { ?>
		<div class="minimum"><?php echo $text_minimum; ?></div>
		<?php } ?>
	  </div>
	  <?php if ($review_status) { ?>
	  <div class="review">
		<div><img src="catalog/view/theme/default/image/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" />  <a onclick="$('a[href='#tab-review']').trigger('click');"><?php echo $reviews; ?></a>  |  <a onclick="$('a[href='#tab-review']').trigger('click');"><?php echo $text_write; ?></a></div>
		<div class="share"><!-- AddThis Button BEGIN -->
		  <div class="addthis_default_style"><a class="addthis_button_compact"><?php echo $text_share; ?></a> <a class="addthis_button_email"></a><a class="addthis_button_print"></a> <a class="addthis_button_facebook"></a> <a class="addthis_button_twitter"></a></div>
		  <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
		  <!-- AddThis Button END -->
		</div>
	  </div>
	  <?php } ?>
	</div>
  </div>
  <div id="tabs" class="htabs"><a href="#tab-description"><?php echo $tab_description; ?></a>
	<?php if ($attribute_groups) { ?>
	<a href="#tab-attribute"><?php echo $tab_attribute; ?></a>
	<?php } ?>
	<?php if ($review_status) { ?>
	<a href="#tab-review"><?php echo $tab_review; ?></a>
	<?php } ?>
	<?php if ($products) { ?>
	<a href="#tab-related"><?php echo $tab_related; ?> (<?php echo count($products); ?>)</a>
	<?php } ?>
  </div>
  <div id="tab-description" class="tab-content"><?php echo $description; ?></div>
  <?php if ($attribute_groups) { ?>
  <div id="tab-attribute" class="tab-content">
	<table class="attribute">
	  <?php foreach ($attribute_groups as $attribute_group) { ?>
	  <thead>
		<tr>
		  <td colspan="2"><?php echo $attribute_group['name']; ?></td>
		</tr>
	  </thead>
	  <tbody>
		<?php foreach ($attribute_group['attribute'] as $attribute) { ?>
		<tr>
		  <td><?php echo $attribute['name']; ?></td>
		  <td><?php echo $attribute['text']; ?></td>
		</tr>
		<?php } ?>
	  </tbody>
	  <?php } ?>
	</table>
  </div>
  <?php } ?>
  <?php if ($review_status) { ?>
  <div id="tab-review" class="tab-content">
	<div id="review"></div>
	<h2 id="review-title"><?php echo $text_write; ?></h2>
	<b><?php echo $entry_name; ?></b><br />
	<input type="text" name="name" value="" />
	<br />
	<br />
	<b><?php echo $entry_review; ?></b>
	<textarea name="text" cols="40" rows="8" style="width: 98%;"></textarea>
	<span style="font-size: 11px;"><?php echo $text_note; ?></span><br />
	<br />
	<b><?php echo $entry_rating; ?></b> <span><?php echo $entry_bad; ?></span> 
	<input type="radio" name="rating" value="1" />
	 
	<input type="radio" name="rating" value="2" />
	 
	<input type="radio" name="rating" value="3" />
	 
	<input type="radio" name="rating" value="4" />
	 
	<input type="radio" name="rating" value="5" />
	  <span><?php echo $entry_good; ?></span><br />
	<br />
	<b><?php echo $entry_captcha; ?></b><br />
	<input type="text" name="captcha" value="" />
	<br />
	<img src="index.php?route=product/product/captcha" alt="" id="captcha" /><br />
	<br />
	<div class="buttons">
	  <div class="right"><a id="button-review" class="button"><span><?php echo $button_continue; ?></span></a></div>
	</div>
  </div>
  <?php } ?>
  <?php if ($products) { ?>
  <div id="tab-related" class="tab-content">
	<div class="box-product">
	  <?php foreach ($products as $product) { ?>
	  <div>
		<?php if ($product['thumb']) { ?>
		<div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
		<?php } ?>
		<div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
		<?php if ($product['price']) { ?>
		<div class="price">
		  <?php if (!$product['special']) { ?>
		  <?php echo $product['price']; ?>
		  <?php } else { ?>
		  <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
		  <?php } ?>
		</div>
		<?php } ?>
		<?php if ($product['rating']) { ?>
		<div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
		<?php } ?>
		<a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a></div>
	  <?php } ?>
	</div>
  </div>
  <?php } ?>
  <?php if ($tags) { ?>
  <div class="tags"><b><?php echo $text_tags; ?></b>
	<?php foreach ($tags as $tag) { ?>
	<a href="<?php echo $tag['href']; ?>"><?php echo $tag['tag']; ?></a>,
	<?php } ?>
  </div>
  <?php } ?>
  <?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
$('.fancybox').fancybox({cyclic: true});
//--></script>
<script type="text/javascript"><!--
$('#button-cart').bind('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/cart/update',
		type: 'post',
		data: $('.product-info input[type='text'], .product-info input[type='hidden'], .product-info input[type='radio']:checked, .product-info input[type='checkbox']:checked, .product-info select, .product-info textarea'),
		dataType: 'json',
		success: function(json) {
			$('.success, .warning, .attention, information, .error').remove();
		  
			if (json['error']) {
				if (json['error']['warning']) {
					$('#notification').html('<div class="warning" style="display: none;">' + json['error']['warning'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
			  
					$('.warning').fadeIn('slow');
				}
			  
				for (i in json['error']) {
					$('#option-' + i).after('<span class="error">' + json['error'][i] + '</span>');
				}
			}	
					  
			if (json['success']) {
				$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
				  
				$('.success').fadeIn('slow');
				  
				$('#cart_total').html(json['total']);
			  
				$('html, body').animate({ scrollTop: 0 }, 'slow');
			}  
		}
	});
});
//--></script>
<?php if ($options) { ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/ajaxupload.js"></script>
<?php foreach ($options as $option) { ?>
<?php if ($option['type'] == 'file') { ?>
<script type="text/javascript"><!--
new AjaxUpload('#button-option-<?php echo $option['product_option_id']; ?>', {
	action: 'index.php?route=product/product/upload',
	name: 'file',
	autoSubmit: true,
	responseType: 'json',
	onSubmit: function(file, extension) {
		$('#button-option-<?php echo $option['product_option_id']; ?>').after('<img src="catalog/view/theme/default/image/loading.gif" class="loading" style="padding-left: 5px;" />');
	},
	onComplete: function(file, json) {
		$('.error').remove();
	  
		if (json.success) {
			alert(json.success);
		  
			$('input[name='option[<?php echo $option['product_option_id']; ?>]']').attr('value', json.file);
		}
	  
		if (json.error) {
			$('#option-<?php echo $option['product_option_id']; ?>').after('<span class="error">' + json.error + '</span>');
		}
	  
		$('.loading').remove();  
	}
});
//--></script>
<?php } ?>
<?php } ?>
<?php } ?>
<script type="text/javascript"><!--
$('#review .pagination a').live('click', function() {
	$('#review').slideUp('slow');
	  
	$('#review').load(this.href);
  
	$('#review').slideDown('slow');
  
	return false;
});		  

$('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');

$('#button-review').bind('click', function() {
	$.ajax({
		type: 'POST',
		url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',
		dataType: 'json',
		data: 'name=' + encodeURIComponent($('input[name='name']').val()) + '&text=' + encodeURIComponent($('textarea[name='text']').val()) + '&rating=' + encodeURIComponent($('input[name='rating']:checked').val() ? $('input[name='rating']:checked').val() : '') + '&captcha=' + encodeURIComponent($('input[name='captcha']').val()),
		beforeSend: function() {
			$('.success, .warning').remove();
			$('#button-review').attr('disabled', true);
			$('#review-title').after('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" /> <?php echo $text_wait; ?></div>');
		},
		complete: function() {
			$('#button-review').attr('disabled', false);
			$('.attention').remove();
		},
		success: function(data) {
			if (data.error) {
				$('#review-title').after('<div class="warning">' + data.error + '</div>');
			}
		  
			if (data.success) {
				$('#review-title').after('<div class="success">' + data.success + '</div>');
							  
				$('input[name='name']').val('');
				$('textarea[name='text']').val('');
				$('input[name='rating']:checked').attr('checked', '');
				$('input[name='captcha']').val('');
			}
		}
	});
});
//--></script>
<script type="text/javascript"><!--
$('#tabs a').tabs();
//--></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript"><!--
if ($.browser.msie && $.browser.version == 6) {
	$('.date, .datetime, .time').bgIframe();
}

$('.date').datepicker({dateFormat: 'yy-mm-dd'});
$('.datetime').datetimepicker({
	dateFormat: 'yy-mm-dd',
	timeFormat: 'h:m'
});
$('.time').timepicker({timeFormat: 'h:m'});
//--></script>
<?php echo $footer; ?>

/catalog/view/theme/default/template/product/category.tpl

<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
  <div class="breadcrumb">
	<?php foreach ($breadcrumbs as $breadcrumb) { ?>
	<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
	<?php } ?>
  </div>
  <h1><?php echo $heading_title; ?></h1>
  <?php if ($thumb || $description) { ?>
  <div class="category-info">
	<?php if ($thumb) { ?>
	<div class="image"><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ?>" /></div>
	<?php } ?>
	<?php if ($description) { ?>
	<?php echo $description; ?>
	<?php } ?>
  </div>
  <?php } ?>
  <?php if ($categories) { ?>
  <h2><?php echo $text_refine; ?></h2>
  <div class="category-list">
	<?php if (count($categories) <= 5) { ?>




	<ul>
	  <?php foreach ($categories as $category) { ?>
	  <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>


	  <?php } ?>
	</ul>
	<?php } else { ?>
	<?php for ($i = 0; $i < count($categories);) { ?>
	<ul>
	  <?php $j = $i + ceil(count($categories) / 4); ?>
	  <?php for (; $i < $j; $i++) { ?>
	  <?php if (isset($categories[$i])) { ?>
	  <li><a href="<?php echo $categories[$i]['href']; ?>"><?php echo $categories[$i]['name']; ?></a></li>
	  <?php } ?>
	  <?php } ?>
	</ul>
	<?php } ?>
	<?php } ?>
  </div>
  <?php } ?>
  <?php if ($products) { ?>
  <div class="product-filter">
	<div class="display"><b><?php echo $text_display; ?></b> <?php echo $text_list; ?> <b>/</b> <a onclick="display('grid');"><?php echo $text_grid; ?></a></div>
  
<div class="limit"><b><?php echo $text_limit; ?></b>
	  <select onchange="location = this.value;">
		<?php foreach ($limits as $limits) { ?>
		<?php if ($limits['value'] == $limit) { ?>
		<option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
		<?php } else { ?>
		<option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
		<?php } ?>
		<?php } ?>
	  </select>
	</div>
	<div class="sort"><b><?php echo $text_sort; ?></b>
	  <select onchange="location = this.value;">
		<?php foreach ($sorts as $sorts) { ?>
		<?php if ($sorts['value'] == $sort . '-' . $order) { ?>
		<option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
		<?php } else { ?>
		<option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
		<?php } ?>
		<?php } ?>
	  </select>
	</div>
  </div>
  <div class="product-compare"><a href="<?php echo $compare; ?>" id="compare_total"><?php echo $text_compare; ?></a></div>
  <div class="product-list">
	<?php foreach ($products as $product) { ?>
	<div>
	  <?php if ($product['thumb']) { ?>
	  <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
	  <?php } ?>
	  <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
	  <div class="description"><?php echo $product['description']; ?></div>
	  <?php if ($product['price']) { ?>
	  <div class="price">
		<?php if (!$product['special']) { ?>
		Цена от <?php echo $product['price']; ?>
		<?php } else { ?>
		<span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
		<?php } ?>
		<?php if ($product['tax']) { ?>
		<br />
		<span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
		<?php } ?>
	  </div>
	  <?php } ?>
	  <?php if ($product['rating']) { ?>
	  <div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
	  <?php } ?>
	  <div class="cart"><a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a></div>
	  <div class="wishlist"><a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><?php echo $button_wishlist; ?></a></div>
	  <div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>
	</div>
	<?php } ?>
  </div>
  <div class="pagination"><?php echo $pagination; ?></div>
  <?php } ?>
  <?php if (!$categories && !$products) { ?>
  <div class="content"><?php echo $text_empty; ?></div>
  <div class="buttons">
	<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
  </div>
  <?php } ?>
  <?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
function display(view) {
	if (view == 'list') {
		$('.product-grid').attr('class', 'product-list');
	  
		$('.product-list > div').each(function(index, element) {
			html  = '<div class="right">';
			html += '  <div class="cart">' + $(element).find('.cart').html() + '</div>';
			html += '  <div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';
			html += '  <div class="compare">' + $(element).find('.compare').html() + '</div>';
			html += '</div>';		  
		  
			html += '<div class="left">';
		  
			var image = $(element).find('.image').html();
		  
			if (image != null) {
				html += '<div class="image">' + image + '</div>';
			}
		  
			var price = $(element).find('.price').html();
		  
			if (price != null) {
				html += '<div class="price">' + price  + '</div>';
			}
				  
			html += '  <div class="name">' + $(element).find('.name').html() + '</div>';
			html += '  <div class="description">' + $(element).find('.description').html() + '</div>';
		  
			var rating = $(element).find('.rating').html();
		  
			if (rating != null) {
				html += '<div class="rating">' + rating + '</div>';
			}
			  
			html += '</div>';

					  
			$(element).html(html);
		});	  
	  
		$('.display').html('<b><?php echo $text_display; ?></b> <?php echo $text_list; ?> <b>/</b> <a onclick="display('grid');"><?php echo $text_grid; ?></a>');
	  
		$.cookie('display', 'list');
	} else {
		$('.product-list').attr('class', 'product-grid');
	  
		$('.product-grid > div').each(function(index, element) {
			html = '';
		  
			var image = $(element).find('.image').html();
		  
			if (image != null) {
				html += '<div class="image">' + image + '</div>';
			}
		  
			html += '<div class="name">' + $(element).find('.name').html() + '</div>';
			html += '<div class="description">' + $(element).find('.description').html() + '</div>';
		  
			var price = $(element).find('.price').html();
		  
			if (price != null) {
				html += '<div class="price">' + price  + '</div>';
			}
		  
			var rating = $(element).find('.rating').html();
		  
			if (rating != null) {
				html += '<div class="rating">' + rating + '</div>';
			}
					  
			html += '<div class="cart">' + $(element).find('.cart').html() + '</div>';
			html += '<div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';
			html += '<div class="compare">' + $(element).find('.compare').html() + '</div>';
		  
			$(element).html(html);
		});  
				  
		$('.display').html('<b><?php echo $text_display; ?></b> <a onclick="display('list');"><?php echo $text_list; ?></a> <b>/</b> <?php echo $text_grid; ?>');
	  
		$.cookie('display', 'grid');
	}
}

view = $.cookie('display');

if (view) {
	display(view);
} else {
	display('list');
}
//--></script>
<?php echo $footer; ?>

/catalog/view/theme/default/template/common/header.tpl

<?php if (isset($_SERVER['HTTP_USER_AGENT']) && !strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6')) echo '<?xml version="1.0" encoding="UTF-8"?>'. "n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>" xml:lang="<?php echo $lang; ?>">
<head>
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<?php if ($icon) { ?>
<link href="<?php echo $icon; ?>" rel="icon" />
<?php } ?>
<?php foreach ($links as $link) { ?>
<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
<?php } ?>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/stylesheet.css" />
<?php foreach ($styles as $style) { ?>
<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" />
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/external/jquery.cookie.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<!--[if IE]>
<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4-iefix.js"></script>
<![endif]-->
<script type="text/javascript" src="catalog/view/javascript/jquery/tabs.js"></script>
<script type="text/javascript" src="catalog/view/javascript/common.js"></script>

<link rel="stylesheet" type="text/css" href="catalog/view/javascript/tree_category/dtree.css" />
<?php foreach ($scripts as $script) { ?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php } ?>
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie7.css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie6.css" />
<script type="text/javascript" src="catalog/view/javascript/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('#logo img');
</script>
<![endif]-->
<?php echo $google_analytics; ?>




<script type="text/javascript">
$(document).ready(function() {
$('.option').change(function() {
var OriginalPrice = $('#thisIsOriginal').text();
if (isNaN(parseInt(OriginalPrice.substring(0, 1))))
{
var OriginalCurrency = OriginalPrice.substring(0,1);
//alert(OriginalCurrency);
OriginalPrice = OriginalPrice.substring(1);
var newPriceValue = $('.option :selected').text();
var position1 = newPriceValue.indexOf("(");
var position2 = newPriceValue.indexOf(")");
var signFinalPriceValue=newPriceValue.substring(position1+1, position1+2);
position1 = position1+3;
var finalPriceValue = newPriceValue.substring(position1, position2);
if(finalPriceValue.indexOf(',') == -1)
{
finalPriceValue = "0";
}
finalPriceValue = parseFloat(finalPriceValue);
finalPriceValue = finalPriceValue.toFixed(2);
$('#priceUpdate').text(OriginalCurrency + finalPriceValue.replace(".",","));
}
else
{
var OriginalCurrency = OriginalPrice.substring(OriginalPrice.length-3, OriginalPrice.length);
OriginalPrice = OriginalPrice.substring();
var newPriceValue = $('.option :selected').text();
var position1 = newPriceValue.indexOf("(");
var position2 = newPriceValue.indexOf(")");
position1 = position1+1;
var finalPriceValue = newPriceValue.substring(position1, position2-4);
if(finalPriceValue.indexOf(',') == -1)
{
finalPriceValue = "0";
}
finalPriceValue = parseFloat(finalPriceValue.replace(",",".")) ;
finalPriceValue = finalPriceValue.toFixed(2);
$('#priceUpdate').text(finalPriceValue.replace(".",",") + OriginalCurrency);
}
});
});
</script>

</head>
<body>
<div id="container">
<div id="header">
  <?php if ($logo) { ?>
  <div id="logo"><a href="<?php echo $home; ?>"><img src="/image/data/dog.gif" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a></div>
  <?php } ?>
  <?php if (count($languages) > 1) { ?>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
		<div id="language"><?php echo $text_language; ?><br />
		  <?php foreach ($languages as $language) { ?>
		   <img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" title="<?php echo $language['name']; ?>" onclick="$('input[name='language_code']').attr('value', '<?php echo $language['code']; ?>').submit(); $(this).parent().parent().submit();" />
		  <?php } ?>
		  <input type="hidden" name="language_code" value="" />
		  <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
		</div>
  </form>
  <?php } ?>
  <?php if (count($currencies) > 1) { ?>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
		<div id="currency"><?php echo $text_currency; ?><br />
		  <?php foreach ($currencies as $currency) { ?>
		  <?php if ($currency['code'] == $currency_code) { ?>
		  <?php if ($currency['symbol_left']) { ?>
		  <a title="<?php echo $currency['title']; ?>"><b><?php echo $currency['symbol_left']; ?></b></a>
		  <?php } else { ?>
		  <a title="<?php echo $currency['title']; ?>"><b><?php echo $currency['symbol_right']; ?></b></a>
		  <?php } ?>
		  <?php } else { ?>
		  <?php if ($currency['symbol_left']) { ?>
		  <a title="<?php echo $currency['title']; ?>" onclick="$('input[name='currency_code']').attr('value', '<?php echo $currency['code']; ?>').submit(); $(this).parent().parent().submit();"><?php echo $currency['symbol_left']; ?></a>
		  <?php } else { ?>
		  <a title="<?php echo $currency['title']; ?>" onclick="$('input[name='currency_code']').attr('value', '<?php echo $currency['code']; ?>').submit(); $(this).parent().parent().submit();"><?php echo $currency['symbol_right']; ?></a>
		  <?php } ?>
		  <?php } ?>
		  <?php } ?>
		  <input type="hidden" name="currency_code" value="" />
		  <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
		</div>
  </form>
  <?php } ?>
  <div id="cart">
		<div class="heading">
		  <h4><?php echo $text_cart; ?></h4>
		  <a><span id="cart_total"><?php echo $text_items; ?></span></a></div>
		<div class="content"></div>
  </div>
  <div id="search">
		<div class="button-search"></div>
		<?php if ($filter_name) { ?>
		<input type="text" name="filter_name" value="<?php echo $filter_name; ?>" />
		<?php } else { ?>
		<input type="text" name="filter_name" value="<?php echo $text_search; ?>" onclick="this.value = '';" onkeydown="this.style.color = '#000000';" />
		<?php } ?>
  </div>
  <!-- <div id="welcome">
		<?php if (!$logged) { ?>
		<?php echo $text_welcome; ?>
		<?php } else { ?>
		<?php echo $text_logged; ?>
		<?php } ?>
  </div> -->
  <div class="links"><!-- <a href="<?php echo $home; ?>"><?php echo $text_home; ?> --></a><a href="<?php echo $wishlist; ?>" id="wishlist_total"><?php echo $text_wishlist; ?></a><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a><a href="<?php echo $cart; ?>"><?php echo $text_cart; ?></a><a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>
</div>
<?php if ($categories) { ?>
<div id="menu">
  <ul>
		<?php foreach ($categories as $category) { ?>
		<li><?php if ($category['active']) { ?>
<a href="<?php echo $category['href']; ?>" class="active"><?php echo $category['name']; ?></a>
<?php } else { ?>
<a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php } ?>
		  <?php if ($category['children']) { ?>
		  <div>
				<?php for ($i = 0; $i < count($category['children']);) { ?>
				<ul>
				  <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
				  <?php for (; $i < $j; $i++) { ?>
				  <?php if (isset($category['children'][$i])) { ?>
				  <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
				  <?php } ?>
				  <?php } ?>
				</ul>
				<?php } ?>
		  </div>
		  <?php } ?>
		</li>
		<?php } ?>
  </ul>
</div>
<?php } ?>
<div id="notification"></div>

Я сделала все как Вы написали, но весь магазин превратился в какие-то иероглифы,почему? Может не работает? Или надо дополнительно что-то установить?

Надіслати
Поділитися на інших сайтах


Я сделала все как Вы написали, но весь магазин превратился в какие-то иероглифы,почему? Может не работает? Или надо дополнительно что-то установить?

1. Проверялось только на версии 1.5.1.3

2. Все файлы должны сохраняться в кодировке UTF-8 (скорее всего это и есть ваша проблема)

Надіслати
Поділитися на інших сайтах


Подскажите насколько будет удобен этот вариант в моем случае?

Допустим в категории "Набор мебели Салют" 6 товаров по несколько опций в каждом(при изменении которых должна меняться цена), и главный набор (товар) состоящий из 6 этих товаров в котором можно также менять опции каждого(при этом должна изменяться общая цена)

Можно ли сделать так и как сделать опцией товара другой товар?

Надіслати
Поділитися на інших сайтах


У меня версия 1.5.1.3

Подскажите пожалуйста а где именно надо это сделать?

Скопируйте код в блокнот или Notepad++ и нажмите сохранить как... в появившемся окне выберите кодировку и нажмите сохранить, после чего можете заливать на сайт
  • +1 1
Надіслати
Поділитися на інших сайтах


Подскажите насколько будет удобен этот вариант в моем случае?

Допустим в категории "Набор мебели Салют" 6 товаров по несколько опций в каждом(при изменении которых должна меняться цена), и главный набор (товар) состоящий из 6 этих товаров в котором можно также менять опции каждого(при этом должна изменяться общая цена)

Можно ли сделать так и как сделать опцией товара другой товар?

Не совсем понятно, что Вы хотите сделать... вернее совсем не понятно...

Покажите пример того что Вы хотите сделать с другого сайта.

Надіслати
Поділитися на інших сайтах


Скопируйте код в блокнот или Notepad++ и нажмите сохранить как... в появившемся окне выберите кодировку и нажмите сохранить, после чего можете заливать на сайт

Я не сильна в php

Если я сохраню файл в блокноте то получу txt

А как потом сделать в php(это мне надо для другого файла), а в данном случае в tpl ?

Надіслати
Поділитися на інших сайтах


Я не сильна в php

Если я сохраню файл в блокноте то получу txt

А как потом сделать в php(это мне надо для другого файла), а в данном случае в tpl ?

Выберите тип файла (при сохранении) - Все файлы, и в названии файла пишите product.php или product.tpl
Надіслати
Поділитися на інших сайтах


Выберите тип файла (при сохранении) - Все файлы, и в названии файла пишите product.php или product.tpl

Я скопировала код в блокнот поставила кодировку UTF-8 выбрала все файлы и написала product.tpl и сохранить. Таким же методом я сделала все остальное меняя только на php и т.д. Поменяла местами файлы,удалила предыдущий и вставила новый. Итог: выдало ошибку и абракадаабра в буквах.

Вот ошибка:

п»ї Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at Z:homemarketwwwsystemlibrarycart.php:1) in Z:homemarketwwwsystemlibrarysession.php on line 11п»їп»ї

Эта ошибка была написано строчкой в самом верху А все буквы русские превратились в аброкадабру.

Что делать? Первый раз с таким сталкиваюсь. Раньше пользовалась другими CMS , но сейчас сайт решили сделать именно на этой.Подскажите как поставить этот код.

Надіслати
Поділитися на інших сайтах


Я скопировала код в блокнот поставила кодировку UTF-8 выбрала все файлы и написала product.tpl и сохранить. Таким же методом я сделала все остальное меняя только на php и т.д. Поменяла местами файлы,удалила предыдущий и вставила новый. Итог: выдало ошибку и абракадаабра в буквах.

Вот ошибка:

п»ї Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at Z:homemarketwwwsystemlibrarycart.php:1) in Z:homemarketwwwsystemlibrarysession.php on line 11п»їп»ї

Эта ошибка была написано строчкой в самом верху А все буквы русские превратились в аброкадабру.

Что делать? Первый раз с таким сталкиваюсь. Раньше пользовалась другими CMS , но сейчас сайт решили сделать именно на этой.Подскажите как поставить этот код.

У Вас же написано, что ошибка тут Z:homemarketwwwsystemlibrarysession.php on line 11.

Там и ищите.

Надіслати
Поділитися на інших сайтах


У Вас же написано, что ошибка тут Z:homemarketwwwsystemlibrarysession.php on line 11.

Там и ищите.

<?php

final class Session {

public $data = array();

public function __construct() {

if (!session_id()) {

ini_set('session.use_cookies', 'On');

ini_set('session.use_trans_sid', 'Off');

session_set_cookie_params(0, '/');

session_start();

}

$this->data =& $_SESSION;

}

}

?>

Вот мот файл session.php ,что здесь менять я просто не представляю.Подскажите...

Надіслати
Поділитися на інших сайтах


Створіть аккаунт або увійдіть для коментування

Ви повинні бути користувачем, щоб залишити коментар

Створити обліковий запис

Зареєструйтеся для отримання облікового запису. Це просто!

Зареєструвати аккаунт

Вхід

Уже зареєстровані? Увійдіть тут.

Вхід зараз
  • Зараз на сторінці   0 користувачів

    • Ні користувачів, які переглядиють цю сторінку
×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.