[Ищу] Убрать "купить" если кол-во =0

Тема в разделе "OpenCart", создана пользователем winner7, 24 май 2013.

  1. winner7

    winner7

    Регистрация:
    6 мар 2013
    Сообщения:
    322
    Симпатии:
    55
    Всем привет!
    Нужно убрать кнопку "купить" если кол-во товара = 0. сменить на "предзаказ" не подойдет, надо именно убрать кнопку по условию. Посоветуйте, пожалуйста, может есть модуль или решение этого вопроса, наверняка кто-нибудь уже сталкивался. Спасибо.
     
  2. winner7

    winner7

    Регистрация:
    6 мар 2013
    Сообщения:
    322
    Симпатии:
    55
    Нашелся модуль бесплатный http://www.opencart.com/index.php?route=extension/extension/info&extension_id=7095
    но на шаблоне sellya в карточке товара и в рекомендуемых не работает, работает только в категориях. Помогите, пожалуйста, очень надо.

    Вот сам vq mod

    Код:
    <modification>
    <id><![CDATA[Remove Add to Cart button for Out of Stock items]]></id>
    <version><![CDATA[1.1]]></version>
    <vqmver><![CDATA[2.1.7]]></vqmver>
    <author><![CDATA[1]]></author>
    <file name="catalog/view/theme/default/template/product/product.tpl">
    <operation>
    <search position="replace"><![CDATA[<input type="button" value="<?php echo $button_cart; ?>" id="button-cart" class="button" />]]></search>
    <add><![CDATA[<?php 
    if ($stock_qty <= 0) { 
    echo "<span style=\"color: red; font-size: 16px;\"><span class=\"outofstock\">" . $stock_status . "</span></span>";
    } else { 
    echo "<input type=\"button\" value=\"" . $button_cart . "\" id=\"button-cart\" class=\"button\" />";
    } 
    ?>]]></add>
    </operation>
    </file>
    <file name="catalog/controller/product/product.php">
    <operation>
    <search position="after" offset="6"><![CDATA[if ($product_info['quantity'] <= 0) {]]></search>
    <add><![CDATA[$this->data['stock_status'] = $product_info['stock_status'];
    $this->data['stock_qty'] = $product_info['quantity'];]]></add>
    </operation>
    </file>
    <file name="catalog/controller/product/category.php">
    <operation>
    <search position="before" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA[$stock_status = $result['stock_status'];
    $stock_qty = $result['quantity'];]]></add>
    </operation>
    <operation>
    <search position="after" offset="10" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA[,'stock_status'	   => $stock_status,
    'stock_qty'	   => $stock_qty]]></add>
    </operation>
    </file>
    <file name="catalog/view/theme/default/template/product/category.tpl">
    <operation>
    <search position="replace" error="skip"><![CDATA[<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />]]></search>
    <add><![CDATA[<?php 
    if ($product['stock_qty'] <= 0) { 
    echo "<span style=\"color: red; font-size: 16px;\"><span class=\"outofstock\">" . $product['stock_status'] . "</span></span>";
    } else { 
    echo "<input type=\"button\" value=\"" . $button_cart . "\" onclick=\"addToCart('" . $product['product_id'] . "');\" class=\"button\" />";
    } 
    ?>
    ]]></add>
    </operation>
    </file>
    <file name="catalog/controller/product/search.php">
    <operation>
    <search position="before" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA[$stock_status = $result['stock_status'];
    $stock_qty = $result['quantity'];]]></add>
    </operation>
    <operation>
    <search position="after" offset="9" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA['stock_status'	   => $stock_status,
    'stock_qty'	   => $stock_qty,]]></add>
    </operation>
    </file>
    <file name="catalog/view/theme/default/template/product/search.tpl">
    <operation>
    <search position="replace" error="skip"><![CDATA[<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />]]></search>
    <add><![CDATA[<?php 
    if ($product['stock_qty'] <= 0) { 
    echo "<span style=\"color: red; font-size: 16px;\"><span class=\"outofstock\">" . $product['stock_status'] . "</span></span>";
    } else { 
    echo "<input type=\"button\" value=\"" . $button_cart . "\" onclick=\"addToCart('" . $product['product_id'] . "');\" class=\"button\" />";
    } 
    ?>
    ]]></add>
    </operation>
    </file>
    <file name="catalog/controller/product/manufacturer.php">
    <operation>
    <search position="before" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA[$stock_status = $result['stock_status'];
    $stock_qty = $result['quantity'];]]></add>
    </operation>
    <operation>
    <search position="after" offset="4" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA['stock_status'	   => $stock_status,
    'stock_qty'	   => $stock_qty,]]></add>
    </operation>
    </file>
    <file name="catalog/view/theme/default/template/product/manufacturer_info.tpl">
    <operation>
    <search position="replace" error="skip"><![CDATA[<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />]]></search>
    <add><![CDATA[<?php 
    if ($product['stock_qty'] <= 0) { 
    echo "<span style=\"color: red; font-size: 16px;\"><span class=\"outofstock\">" . $product['stock_status'] . "</span></span>";
    } else { 
    echo "<input type=\"button\" value=\"" . $button_cart . "\" onclick=\"addToCart('" . $product['product_id'] . "');\" class=\"button\" />";
    } 
    ?>
    ]]></add>
    </operation>
    </file>
    <file name="catalog/controller/product/special.php">
    <operation>
    <search position="before" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA[$stock_status = $result['stock_status'];
    $stock_qty = $result['quantity'];]]></add>
    </operation>
    <operation>
    <search position="after" offset="5" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA['stock_status'	   => $stock_status,
    'stock_qty'	   => $stock_qty,]]></add>
    </operation>
    </file>
    <file name="catalog/view/theme/default/template/product/special.tpl">
    <operation>
    <search position="replace" error="skip"><![CDATA[<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />]]></search>
    <add><![CDATA[<?php 
    if ($product['stock_qty'] <= 0) { 
    echo "<span style=\"color: red; font-size: 16px;\"><span class=\"outofstock\">" . $product['stock_status'] . "</span></span>";
    } else { 
    echo "<input type=\"button\" value=\"" . $button_cart . "\" onclick=\"addToCart('" . $product['product_id'] . "');\" class=\"button\" />";
    } 
    ?>
    ]]></add>
    </operation>
    </file>
    <file name="catalog/controller/product/compare.php">
    <operation>
    <search position="after" offset="6" error="skip"><![CDATA[if ($product_info['quantity'] <= 0) {]]></search>
    <add><![CDATA[$stock_status = $product_info['stock_status'];
    $stock_qty = $product_info['quantity'];]]></add>
    </operation>
    <operation>
    <search position="after" offset="12" error="skip"><![CDATA[$this->data['products'][$product_id] = array(]]></search>
    <add><![CDATA['stock_status'	   => $stock_status,
    'stock_qty'	   => $stock_qty,]]></add>
    </operation>
    </file>
    <file name="catalog/view/theme/default/template/product/compare.tpl">
    <operation>
    <search position="replace" error="skip"><![CDATA[<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />]]></search>
    <add><![CDATA[<?php 
    if ($product['stock_qty'] <= 0) { 
    echo "<span style=\"color: red; font-size: 16px;\"><span class=\"outofstock\">" . $product['stock_status'] . "</span></span>";
    } else { 
    echo "<input type=\"button\" value=\"" . $button_cart . "\" onclick=\"addToCart('" . $product['product_id'] . "');\" class=\"button\" />";
    } 
    ?>
    ]]></add>
    </operation>
    </file>
    <file name="catalog/controller/module/featured.php">
    <operation>
    <search position="before" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA[$stock_status = $product_info['stock_status'];
    $stock_qty = $product_info['quantity'];]]></add>
    </operation>
    <operation>
    <search position="after" offset="6" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA['stock_status'	   => $stock_status,
    'stock_qty'	   => $stock_qty,]]></add>
    </operation>
    </file>
    <file name="catalog/view/theme/default/template/module/featured.tpl">
    <operation>
    <search position="replace" error="skip"><![CDATA[<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />]]></search>
    <add><![CDATA[<?php 
    if ($product['stock_qty'] <= 0) { 
    echo "<span style=\"color: red; font-size: 16px;\"><span class=\"outofstock\">" . $product['stock_status'] . "</span></span>";
    } else { 
    echo "<input type=\"button\" value=\"" . $button_cart . "\" onclick=\"addToCart('" . $product['product_id'] . "');\" class=\"button\" />";
    } 
    ?>
    ]]></add>
    </operation>
    </file>
    <file name="catalog/controller/module/bestseller.php">
    <operation>
    <search position="before" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA[$stock_status = $result['stock_status'];
    $stock_qty = $result['quantity'];]]></add>
    </operation>
    <operation>
    <search position="after" offset="4" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA['stock_status'	   => $stock_status,
    'stock_qty'	   => $stock_qty,]]></add>
    </operation>
    </file>
    <file name="catalog/view/theme/default/template/module/bestseller.tpl">
    <operation>
    <search position="replace" error="skip"><![CDATA[<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />]]></search>
    <add><![CDATA[<?php 
    if ($product['stock_qty'] <= 0) { 
    echo "<span style=\"color: red; font-size: 16px;\"><span class=\"outofstock\">" . $product['stock_status'] . "</span></span>";
    } else { 
    echo "<input type=\"button\" value=\"" . $button_cart . "\" onclick=\"addToCart('" . $product['product_id'] . "');\" class=\"button\" />";
    } 
    ?>
    ]]></add>
    </operation>
    </file>
    <file name="catalog/controller/module/latest.php">
    <operation>
    <search position="before" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA[$stock_status = $result['stock_status'];
    $stock_qty = $result['quantity'];]]></add>
    </operation>
    <operation>
    <search position="after" offset="4" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA['stock_status'	   => $stock_status,
    'stock_qty'	   => $stock_qty,]]></add>
    </operation>
    </file>
    <file name="catalog/view/theme/default/template/module/latest.tpl">
    <operation>
    <search position="replace" error="skip"><![CDATA[<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />]]></search>
    <add><![CDATA[<?php 
    if ($product['stock_qty'] <= 0) { 
    echo "<span style=\"color: red; font-size: 16px;\"><span class=\"outofstock\">" . $product['stock_status'] . "</span></span>";
    } else { 
    echo "<input type=\"button\" value=\"" . $button_cart . "\" onclick=\"addToCart('" . $product['product_id'] . "');\" class=\"button\" />";
    } 
    ?>
    ]]></add>
    </operation>
    </file>
    <file name="catalog/controller/module/special.php">
    <operation>
    <search position="before" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA[$stock_status = $result['stock_status'];
    $stock_qty = $result['quantity'];]]></add>
    </operation>
    <operation>
    <search position="after" offset="4" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA['stock_status'	   => $stock_status,
    'stock_qty'	   => $stock_qty,]]></add>
    </operation>
    </file>
    <file name="catalog/view/theme/default/template/module/special.tpl">
    <operation>
    <search position="replace" error="skip"><![CDATA[<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />]]></search>
    <add><![CDATA[<?php 
    if ($product['stock_qty'] <= 0) { 
    echo "<span style=\"color: red; font-size: 16px;\"><span class=\"outofstock\">" . $product['stock_status'] . "</span></span>";
    } else { 
    echo "<input type=\"button\" value=\"" . $button_cart . "\" onclick=\"addToCart('" . $product['product_id'] . "');\" class=\"button\" />";
    } 
    ?>
    ]]></add>
    </operation>
    </file>
    <file name="catalog/controller/account/wishlist.php">
    <operation>
    <search position="before" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA[$stock_status = $product_info['stock_status'];
    $stock_qty = $product_info['quantity'];]]></add>
    </operation>
    <operation>
    <search position="after" offset="4" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
    <add><![CDATA['stock_status'	   => $stock_status,
    'stock_qty'	   => $stock_qty,]]></add>
    </operation>
    </file>
    <file name="catalog/view/theme/default/template/account/wishlist.tpl">
    <operation>
    <search position="replace" error="skip"><![CDATA[<img src="catalog/view/theme/default/image/cart-add.png" alt="<?php echo $button_cart; ?>" title="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" />]]></search>
    <add><![CDATA[<?php 
    if ($product['stock_qty'] <= 0) { 
    echo "<span style=\"color: red; font-size: 10px;\"><span class=\"outofstock\">" . $product['stock_status'] . "</span></span>";
    } else { 
    echo "<img src=\"catalog/view/theme/default/image/cart-add.png\" alt=\"" . $button_cart . "\" title=\"" . $button_cart . "\" onclick=\"addToCart('" . $product['product_id'] . "');\" />";
    } 
    ?>
    ]]></add>
    </operation>
    </file>
    <file name="catalog/language/english/common/footer.php">
    <operation>
    <search position="replace" offset="1" error="log"><![CDATA[$_['text_newsletter']   = 'Newsletter';]]></search>
    <add><![CDATA[$_['text_newsletter']   = 'Newsletter';
    $_['text_powered']	  = 'Powered By <a href="http://www.opencart.com">OpenCart</a> and <a href="http://www.csillamvilag.com">OC2PS</a><br /> %s &copy; %s';]]></add>
    </operation>
    </file>
    </modification>
    Вот файл шаблона карточки товара catalog / view / theme / sellya / template / product /


    Код:
    <?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
    <div id="content" class="span12"><div class="row-fluid"><?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 } ?>
    <script type="text/javascript">
    	$(function(){
    		$(".tiptip").tipTip();
    	});
    </script>
    	<div id="prev-next">
     <?php if ($prev_prod_name) { ?>
     <a href="<?php echo $prev_prod_url; ?>" class="tiptip" title="<?php echo $prev_prod_name;?>"><span style="margin-right:10px">&laquo; <?php echo $text_previous_product;?></span></a>
    	  <?php } ?>
     <?php if ($next_prod_name) { ?>
    <a href="<?php echo $next_prod_url; ?>" class="tiptip" title="<?php echo $next_prod_name;?>"><span style="margin-left:10px"><?php echo $text_next_product;?> &raquo;</span></a>
    	  <?php } ?>
    </div>
      </div>  
      <div class="product-info">
    	<?php if ($thumb || $images) { ?>
    	<div class="left">
    	  <?php if($this->config->get('sellya_product_zoom_type')== 1) { ?>	 
    	  <?php if ($thumb) { ?>
    	  <div class="image">
    	  <?php if($special){ ?>
    	  <span class="sale-icon"><?php echo $text_sale; ?></span>
    	  <?php } ?> 
    	  <a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="colorbox" rel="colorbox">
    	  <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="colorbox" rel="colorbox"> 
    		<img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a>
    		<?php } ?>
    	  </div>
    	  <?php } ?>
    	  <?php } ?>
    	  <?php if($this->config->get('sellya_product_zoom_type')== 0) { ?>  
    	  <?php if ($thumb) { ?>
    	  <div class="image">
    	  <?php if($special){ ?>
    	  <span class="sale-icon"><?php echo $text_sale; ?></span>
    	  <?php } ?>		
    	  <a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom" id='zoom1' rel="adjustX: -1, adjustY:-1, tint:'#ffffff',tintOpacity:0.1, zoomWidth:364">
     <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">
    <a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom-gallery" rel="useZoom: 'zoom1', smallImage: '<?php echo $thumb; ?>' ">
    		<img src="<?php echo $thumb; ?>" width="98" height="98" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image" /></a>
    		<?php foreach ($images as $image) { ?>
    		<a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom-gallery" rel="useZoom: 'zoom1', smallImage: '<?php echo $image['thumb']; ?>' ">
    		<img src="<?php echo $image['thumb']; ?>" width="98" height="98" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a>
    		<?php } ?>
    	  </div>
    	  <?php } ?>
    	  <?php } ?>
    	</div>
    	<?php } ?> 
    	<?php if ($thumb =='') { ?>
    	<div class="left">
    	<div class="image"><?php if($special){ ?><span class="sale-icon"><?php echo $text_sale; ?></span><?php } ?> 
    	<img src="catalog/view/theme/sellya/image/no_image-308x308.png" />
    	</div>
    	</div>
    	<?php } ?> 
    	<div class="right">	 
    	  <div class="buy">
    	  <header class="product-name">
    	  <h1><?php echo $heading_title; ?></h1>
    	  </header>
    	  <?php if ($price) { ?>
    	  <div class="price">
    		<?php if (!$special) { ?>
    		<?php echo $price; ?>
    		<?php } else { ?>
    		<span class="price-old"><?php echo $price; ?></span> <span class="price-new"><?php echo $special; ?></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 ($review_status) { ?>
    	  <div class="review">
    		<div><img src="catalog/view/theme/sellya/image/stars/stars<?php echo $this->config->get('sellya_mid_prod_stars_color'); ?>-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" /><br />
    		<a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $reviews; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;
    		<a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $text_write; ?></a></div>
    	  </div>
    	  <?php } ?>	 
    		<div class="description">
    		<span><?php echo $text_stock; ?></span> <span class="stock"><?php echo $stock; ?></span><br />
    		<?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 />
    		<?php if ($reward) { ?>
    		<span><?php echo $text_reward; ?></span> <?php echo $reward; ?><br />
    		<?php } ?>
    		<?php if($this->config->get('sellya_product_viewed_status') ==1) { ?>
    		<span><?php echo $text_product_viewed; ?></span> <?php echo $product_info['viewed']; ?> 
    		<?php } ?>
    		</div>	  
    	  <?php if ($options) { ?>
    	  <div class="options">
    		<h4><?php echo $text_option; ?></h4>
    		
    		<?php foreach ($options as $option) { ?>
    		<?php if ($option['type'] == 'select') { ?>
    		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
    		  <div class="option-l"><?php if ($option['required']) { ?>
    		  <span class="required">*</span>
    		  <?php } ?>
    		  <b><?php echo $option['name']; ?>:</b></div>
    		  <div class="option-r"><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']; ?><?php echo $option_value['price']; ?>)
    			<?php } ?>
    			</option>
    			<?php } ?>
    		  </select></div>
    		</div>
    		
    		<?php } ?>
    		<?php if ($option['type'] == 'radio') { ?>
    		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
    		  <div class="option-l"><?php if ($option['required']) { ?>
    		  <span class="required">*</span>
    		  <?php } ?>
    		  <b><?php echo $option['name']; ?>:</b></div>
    		  <div class="option-r"><?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 } ?>
    		  </label>
    		  <br />
    		  <?php } ?></div>
    		</div>
    		
    		<?php } ?>
    		<?php if ($option['type'] == 'checkbox') { ?>
    		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
    		  <div class="option-l"><?php if ($option['required']) { ?>
    		  <span class="required">*</span>
    		  <?php } ?>
    		  <b><?php echo $option['name']; ?>:</b></div>
    		  <div class="option-r"><?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 } ?>
    		  </label>
    		  <br />
    		  <?php } ?></div>
    		</div>
    	   
    		<?php } ?>
    		<?php if ($option['type'] == 'image') { ?>
    		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
    		  <div class="option-l"><?php if ($option['required']) { ?>
    		  <span class="required">*</span>
    		  <?php } ?>
    		  <b><?php echo $option['name']; ?>:</b></div>
    			<div class="option-r"> <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>
    		</div>
    		
    		<?php } ?>
    		<?php if ($option['type'] == 'text') { ?>
    		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
    		  <div class="option-l"><?php if ($option['required']) { ?>
    		  <span class="required">*</span>
    		  <?php } ?>
    		  <b><?php echo $option['name']; ?>:</b></div>
    		  <div class="option-r"><input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" /></div>
    		</div>
    	   
    		<?php } ?>
    		<?php if ($option['type'] == 'textarea') { ?>
    		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
    		  <div class="option-l"><?php if ($option['required']) { ?>
    		  <span class="required">*</span>
    		  <?php } ?>
    		  <b><?php echo $option['name']; ?>:</b></div>
    		  <div class="option-r"><textarea name="option[<?php echo $option['product_option_id']; ?>]" cols="40" rows="5"><?php echo $option['option_value']; ?></textarea></div>
    		</div>
    		
    		<?php } ?>
    		<?php if ($option['type'] == 'file') { ?>
    		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
    		  <div class="option-l"><?php if ($option['required']) { ?>
    		  <span class="required">*</span>
    		  <?php } ?>
    		  <b><?php echo $option['name']; ?>:</b></div>
    		  <div class="option-r"><input type="button" value="<?php echo $button_upload; ?>" id="button-option-<?php echo $option['product_option_id']; ?>" class="button">
    		  <input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" /></div>
    		</div>
    		
    		<?php } ?>
    		<?php if ($option['type'] == 'date') { ?>
    		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
    		  <div class="option-l"><?php if ($option['required']) { ?>
    		  <span class="required">*</span>
    		  <?php } ?>
    		  <b><?php echo $option['name']; ?>:</b></div>
    		  <div class="option-r"><input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="date" /></div>
    		</div>
    		
    		<?php } ?>
    		<?php if ($option['type'] == 'datetime') { ?>
    		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
    		  <div class="option-l"><?php if ($option['required']) { ?>
    		  <span class="required">*</span>
    		  <?php } ?>
    		  <b><?php echo $option['name']; ?>:</b></div>
    		  <div class="option-r"><input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="datetime" /></div>
    		</div>
    	   
    		<?php } ?>
    		<?php if ($option['type'] == 'time') { ?>
    		<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
    		  <div class="option-l"><?php if ($option['required']) { ?>
    		  <span class="required">*</span>
    		  <?php } ?>
    		  <b><?php echo $option['name']; ?>:</b></div>
    		  <div class="option-r"><input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="time" /></div>
    		</div>
    		
    		<?php } ?>
    		<?php } ?>
    	  </div>
    	  <?php } ?>
    	  <div class="cart">
    		<div class="add-to-cart"><?php echo $text_qty; ?>
    		  <input type="text" name="quantity" size="2" class="input-mini" value="<?php echo $minimum; ?>" />
    		  <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
    		  &nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="<?php echo $button_cart; ?>" id="button-cart" class="button-exclusive" />
    		  </div><br />
    		<div class="wishlist-compare"><a onclick="addToWishList('<?php echo $product_id; ?>');"><span class="wishlist"></span><?php echo $button_wishlist; ?></a>
    		  &nbsp;&nbsp;&nbsp;&nbsp;<a onclick="addToCompare('<?php echo $product_id; ?>');"><span class="compare"></span><?php echo $button_compare; ?></a></div>
    		<?php if ($minimum > 1) { ?>
    		<div class="minimum"><?php echo $text_minimum; ?></div>
    		<?php } ?>
    	  </div>
    	  </div>
    	  <div class="share hidden-desktop">
    <!-- AddThis Button BEGIN -->
    <div class="addthis_toolbox addthis_default_style ">
    <a class="addthis_button_preferred_1"></a>
    <a class="addthis_button_preferred_2"></a>
    <a class="addthis_button_preferred_3"></a>
    <a class="addthis_button_preferred_4"></a>
    <a class="addthis_button_preferred_5"></a>
    <a class="addthis_button_preferred_6"></a><br />
    <div style="margin-top: 7px;">
    <a class="addthis_counter addthis_pill_style"></a>
    </div>
    </div>
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
    <!-- AddThis Button END -->
    	  </div>	   
    	</div> 
    	
    <div id="right-sm">
    <?php if ($manufacturer) { ?>  
    <?php if ($manufacturers_img) { ?>	 
    <?php if($this->config->get('sellya_product_manufacturer_logo_status') ==1) { ?>   
    <div class="right-sm-manufacturer-logo visible-desktop">
    <div class="product-manufacturer-logo-block">
    	 <a href="<?php echo $manufacturers; ?>"><?php echo ($manufacturers_img) ? '<img src="'.$manufacturers_img.'" title="'.$manufacturers.'" />' : $manufacturers ;?></a>
    </div>	
    </div>
    <?php } ?> 
    <?php } ?> 
    <?php } ?>  
    	
    <?php if($this->config->get('sellya_product_custom_status')== 1) { ?> 
    <?php if($this->config->get('sellya_product_custom_content') != '') { ?>
    <div class="right-sm-custom visible-desktop">
    <div class="product-custom-block">
    <?php if($this->config->get('sellya_product_custom_content') != '') { ?>
    	<?php echo htmlspecialchars_decode($this->config->get('sellya_product_custom_content')); ?>
    	<?php } ?>			 
    </div> 
    </div>
    <?php } ?>
    <?php } ?> 
     
    <?php if ($products) { ?>
    <?php if($this->config->get('sellya_product_related_status')== 1) { ?>  
    <?php if($this->config->get('sellya_product_related_position')== 0) { ?>  
    <div class="right-sm-related visible-desktop">
    <div class="product-related">
    <h5><?php echo $tab_related; ?></h5>   
    <script type="text/javascript">
    (function($){
    $(function(){
    $('#slider1').bxSlider();
    });
    }(jQuery))
    </script>
      <ul id="slider1" >
    	<?php foreach ($products as $product) { ?> 
    	<li>
    		<?php if ($product['thumb']) { ?>
    		<div class="image"><?php if ($product['special']) { ?><span class="sale-icon"><?php echo $text_sale; ?></span><?php } ?>
    		<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 } else { ?>
    		<div class="image"><?php if ($product['special']) { ?><span class="sale-icon"><?php echo $text_sale; ?></span><?php } ?>
    		<a href="<?php echo $product['href']; ?>"><img src="catalog/view/theme/sellya/image/no_image-190x190.png" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a>
    		</div>
    		<?php } ?>
    		<div class="description-r hidden-phone hidden-tablet"><?php echo $product['description']; ?></div>
    		<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 } ?>
    	</li>
    	<?php } ?>
      </ul> 
    </div>  
    </div>	
    <?php } ?>
    <?php } ?>
    <?php } ?>   
     
    <div class="right-sm-share visible-desktop">
    <div class="product-share">
    <div class="share">
    <!-- AddThis Button BEGIN -->
    <div class="addthis_toolbox addthis_default_style ">
    <a class="addthis_button_preferred_1"></a>
    <a class="addthis_button_preferred_2"></a>
    <a class="addthis_button_preferred_3"></a>
    <a class="addthis_button_preferred_4"></a>
    <a class="addthis_button_preferred_5"></a>
    <a class="addthis_button_preferred_6"></a><br />
    <div style="margin-top: 7px;">
    <a class="addthis_counter addthis_pill_style"></a>
    </div>
    </div>
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
    <!-- AddThis Button END -->
    </div>		 
    </div> 
    </div>
     
      <?php if ($tags) { ?>
      <div class="right-sm-tags visible-desktop">  
      <div class="product-tags"><div style="margin-right:3px"><h5><?php echo $text_tags; ?></h5></div><br /><br />
    	<?php for ($i = 0; $i < count($tags); $i++) { ?>
    	<?php if ($i < (count($tags) - 1)) { ?>
    	<div><a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a></div>
    	<?php } else { ?>
    	<div><a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a></div>
    	<?php } ?>
    	<?php } ?>
      </div>
      </div>
      <?php } ?>
    </div>
    </div>
     
     <section id="product-information">
      <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($this->config->get('sellya_product_custom_tab_status')== 1) { ?>
    	<?php if($this->config->get('sellya_product_custom_tab_content') != '') { ?>	
    	<a href="#tab-custom"><?php echo $this->config->get('sellya_product_custom_tab_title'); ?></a>
    	<?php } ?>
    	<?php } ?>	
      </div>
      <div id="tab-description" class="tab-content" style="display:block"><article id="<?php echo $heading_title; ?>"><?php echo $description; ?></article></div>
      <?php if ($attribute_groups) { ?>
      <div id="tab-attribute" class="tab-content" style="display:block">
    	<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" style="display:block">
    	<article id="review"></article>
    	<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> &nbsp;&nbsp;&nbsp;<span><?php echo $entry_bad; ?></span>&nbsp;
    	<input type="radio" name="rating" value="1" />
    	&nbsp;
    	<input type="radio" name="rating" value="2" />
    	&nbsp;
    	<input type="radio" name="rating" value="3" />
    	&nbsp;
    	<input type="radio" name="rating" value="4" />
    	&nbsp;
    	<input type="radio" name="rating" value="5" />
    	&nbsp; <span><?php echo $entry_good; ?></span><br />
    	<br />
    	<b><?php echo $entry_captcha; ?></b><br />
    	<input type="text" name="captcha" value="" />
    	<br /><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"><?php echo $button_continue; ?></a></div>
    	</div>
      </div>
      <?php } ?>
      
      <?php if($this->config->get('sellya_product_custom_tab_status')== 1) { ?> 
      <?php if($this->config->get('sellya_product_custom_tab_content') != '') { ?>
      <div id="tab-custom" class="tab-content" style="display:block">
      <?php echo htmlspecialchars_decode($this->config->get('sellya_product_custom_tab_content')); ?>
      </div>
      <?php } ?>
      <?php } ?>  
    </section>  
     
      <?php if ($products) { ?>
      <?php if($this->config->get('sellya_product_related_status')== 1) { ?>  
      <?php if($this->config->get('sellya_product_related_position')== 1) { ?>	  
    	<h2><?php echo $tab_related; ?></h2>
    	<div class="product-grid">   
    <?php $counter = 0; foreach ($products as $product) { 
      if (($counter+4) %4 == 0) $xclass="span-first-child";
      else $xclass=""; ?>		
    	<div class="span-related <?php echo $xclass; ?>"><div class="pbox">
    		<?php if ($product['thumb']) { ?>
    		<div class="image"><?php if ($product['special']) { ?><span class="sale-icon"><?php echo $text_sale; ?></span><?php } ?>				 
    		<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 } else { ?>
    		<div class="image"><?php if ($product['special']) { ?><span class="sale-icon"><?php echo $text_sale; ?></span><?php } ?>
    		<a href="<?php echo $product['href']; ?>"><img src="catalog/view/theme/sellya/image/no_image-190x190.png" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a>
    		</div>
    		<?php } ?>
    		<div class="description hidden-phone hidden-tablet"><?php echo $product['description']; ?></div>
    		<div class="rating hidden-phone hidden-tablet">
    		<img src="catalog/view/theme/sellya/image/stars/stars<?php echo $this->config->get('sellya_mid_prod_stars_color'); ?>-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" />
    		</div>		
    		<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 } ?>
    		 <div class="cart"><input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" /></div>
    		 </div></div>
    	  <?php $counter++; } ?>
    	</div>
      <?php } ?>
      <?php } ?>
      <?php } ?>
      
      <?php if ($tags) { ?>
      <div class="tags hidden-desktop"><div style="float:left; margin-right:3px"><h5><?php echo $text_tags; ?></h5></div>
    	<?php for ($i = 0; $i < count($tags); $i++) { ?>
    	<?php if ($i < (count($tags) - 1)) { ?>
    	<div><a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a></div>
    	<?php } else { ?>
    	<div><a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a></div>
    	<?php } ?>
    	<?php } ?>
      </div>
      <?php } ?>
      
      <?php echo $content_bottom; ?></div></div>
    <script type="text/javascript"><!--
    $('.colorbox').colorbox({
    overlayClose: true,
    opacity: 0.5
    });
    //--></script> 
    <script type="text/javascript"><!--
    $('#button-cart').bind('click', function() {
    $.ajax({
    url: 'index.php?route=checkout/cart/add',
    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']['option']) {
    for (i in json['error']['option']) {
    $('#option-' + i).after('<span class="error">' + json['error']['option'][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').delay(2000).fadeOut('fast');
     
    $('#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;" />');
    $('#button-option-<?php echo $option['product_option_id']; ?>').attr('disabled', true);
    },
    onComplete: function(file, json) {
    $('#button-option-<?php echo $option['product_option_id']; ?>').attr('disabled', false);
     
    $('.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').fadeOut('slow');
     
    $('#review').load(this.href);
     
    $('#review').fadeIn('slow');
     
    return false;
    });
     
    $('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');
     
    $('#button-review').bind('click', function() {
    $.ajax({
    url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',
    type: 'post',
    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 / controller / product /

    Код:
    <?php  
    class ControllerProductProduct extends Controller {
    private $error = array(); 
     
    public function index() { 
    $this->language->load('product/product');
     
    $this->data['breadcrumbs'] = array();
     
    $this->data['breadcrumbs'][] = array(
    'text'	  => $this->language->get('text_home'),
    'href'	  => $this->url->link('common/home'),
    'separator' => false
    );
     
    $this->load->model('catalog/category');
     
    if (isset($this->request->get['path'])) {
    $path = '';
     
    foreach (explode('_', $this->request->get['path']) as $path_id) {
    if (!$path) {
    $path = $path_id;
    } else {
    $path .= '_' . $path_id;
    }
     
    $category_info = $this->model_catalog_category->getCategory($path_id);
     
    if ($category_info) {
    $this->data['breadcrumbs'][] = array(
    'text'	  => $category_info['name'],
    'href'	  => $this->url->link('product/category', 'path=' . $path),
    'separator' => $this->language->get('text_separator')
    );
    }
    }
    }
     
    $this->load->model('catalog/manufacturer');
     
    if (isset($this->request->get['manufacturer_id'])) {
    $this->data['breadcrumbs'][] = array( 
    'text'	  => $this->language->get('text_brand'),
    'href'	  => $this->url->link('product/manufacturer'),
    'separator' => $this->language->get('text_separator')
    );
     
    $manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($this->request->get['manufacturer_id']);
     
    if ($manufacturer_info) {
    $this->data['breadcrumbs'][] = array(
    'text'	=> $manufacturer_info['name'],
    'href'	=> $this->url->link('product/manufacturer/product', 'manufacturer_id=' . $this->request->get['manufacturer_id']),
    'separator' => $this->language->get('text_separator')
    );
    }
    }
     
    if (isset($this->request->get['filter_name']) || isset($this->request->get['filter_tag'])) {
    $url = '';
     
    if (isset($this->request->get['filter_name'])) {
    $url .= '&filter_name=' . $this->request->get['filter_name'];
    }
     
    if (isset($this->request->get['filter_tag'])) {
    $url .= '&filter_tag=' . $this->request->get['filter_tag'];
    }
     
    if (isset($this->request->get['filter_description'])) {
    $url .= '&filter_description=' . $this->request->get['filter_description'];
    }
     
    if (isset($this->request->get['filter_category_id'])) {
    $url .= '&filter_category_id=' . $this->request->get['filter_category_id'];
    }
     
    $this->data['breadcrumbs'][] = array(
    'text'	  => $this->language->get('text_search'),
    'href'	  => $this->url->link('product/search', $url),
    'separator' => $this->language->get('text_separator')
    );
    }
     
    if (isset($this->request->get['product_id'])) {
    $product_id = $this->request->get['product_id'];
    } else {
    $product_id = 0;
    }
     
    $this->load->model('catalog/product');
     
    $product_info = $this->model_catalog_product->getProduct($product_id);
     
    $this->data['product_info'] = $product_info;
     
    if ($product_info) {
    $url = '';
     
    if (isset($this->request->get['path'])) {
    $url .= '&path=' . $this->request->get['path'];
    }
     
    if (isset($this->request->get['manufacturer_id'])) {
    $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
    }
     
    if (isset($this->request->get['filter_name'])) {
    $url .= '&filter_name=' . $this->request->get['filter_name'];
    }
     
    if (isset($this->request->get['filter_tag'])) {
    $url .= '&filter_tag=' . $this->request->get['filter_tag'];
    }
     
    if (isset($this->request->get['filter_description'])) {
    $url .= '&filter_description=' . $this->request->get['filter_description'];
    }
     
    if (isset($this->request->get['filter_category_id'])) {
    $url .= '&filter_category_id=' . $this->request->get['filter_category_id'];
    }
     
    $this->data['breadcrumbs'][] = array(
    'text'	  => $product_info['name'],
    'href'	  => $this->url->link('product/product', $url . '&product_id=' . $this->request->get['product_id']),
    'separator' => $this->language->get('text_separator')
    );
     
    $this->document->setTitle($product_info['name']);
    $this->document->setDescription($product_info['meta_description']);
    $this->document->setKeywords($product_info['meta_keyword']);
    $this->document->addLink($this->url->link('product/product', 'product_id=' . $this->request->get['product_id']), 'canonical');
     
    $NextProd = $this->model_catalog_product->getProduct($product_id+1);
    $PrevProd = $this->model_catalog_product->getProduct($product_id-1);
     
    if($NextProd) {
    $this->data['next_prod_url'] = $this->url->link('product/product', 'product_id=' . $NextProd['product_id']);
    $this->data['next_prod_name'] = $NextProd['name'];
    } else {
    $this->data['next_prod_url'] = '';
    $this->data['next_prod_name'] = '';
    }
     
    if($PrevProd) {
    $this->data['prev_prod_url'] = $this->url->link('product/product', 'product_id=' . $PrevProd['product_id']);
    $this->data['prev_prod_name'] = $PrevProd['name'];
    } else {
    $this->data['prev_prod_url'] = '';
    $this->data['prev_prod_name'] = '';
    }
     
    $this->data['heading_title'] = $product_info['name'];
    $this->data['text_select'] = $this->language->get('text_select');
    $this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
    $this->data['text_model'] = $this->language->get('text_model');
    $this->data['text_reward'] = $this->language->get('text_reward');
    $this->data['text_points'] = $this->language->get('text_points');
    $this->data['text_discount'] = $this->language->get('text_discount');
    $this->data['text_stock'] = $this->language->get('text_stock');
    $this->data['text_product_viewed'] = $this->language->get('text_product_viewed');
    $this->data['text_price'] = $this->language->get('text_price');
    $this->data['text_tax'] = $this->language->get('text_tax');
    $this->data['text_discount'] = $this->language->get('text_discount');
    $this->data['text_option'] = $this->language->get('text_option');
    $this->data['text_qty'] = $this->language->get('text_qty');
    $this->data['text_minimum'] = sprintf($this->language->get('text_minimum'), $product_info['minimum']);
    $this->data['text_or'] = $this->language->get('text_or');
    $this->data['text_write'] = $this->language->get('text_write');
    $this->data['text_note'] = $this->language->get('text_note');
    $this->data['text_share'] = $this->language->get('text_share');
    $this->data['text_wait'] = $this->language->get('text_wait');
    $this->data['text_tags'] = $this->language->get('text_tags');
    $this->data['text_sale'] = $this->language->get('text_sale');
    $this->data['text_next_product'] = $this->language->get('text_next_product');
       $this->data['text_previous_product'] = $this->language->get('text_previous_product');
     
    $this->data['entry_name'] = $this->language->get('entry_name');
    $this->data['entry_review'] = $this->language->get('entry_review');
    $this->data['entry_rating'] = $this->language->get('entry_rating');
    $this->data['entry_good'] = $this->language->get('entry_good');
    $this->data['entry_bad'] = $this->language->get('entry_bad');
    $this->data['entry_captcha'] = $this->language->get('entry_captcha');
     
    $this->data['button_cart'] = $this->language->get('button_cart');
    $this->data['button_wishlist'] = $this->language->get('button_wishlist');
    $this->data['button_compare'] = $this->language->get('button_compare');
    $this->data['button_upload'] = $this->language->get('button_upload');
    $this->data['button_continue'] = $this->language->get('button_continue');
     
    $this->load->model('catalog/review');
     
    $this->data['tab_description'] = $this->language->get('tab_description');
    $this->data['tab_attribute'] = $this->language->get('tab_attribute');
    $this->data['tab_review'] = sprintf($this->language->get('tab_review'), $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']));
    $this->data['tab_related'] = $this->language->get('tab_related');
     
    $this->data['product_id'] = $this->request->get['product_id'];
    $this->data['manufacturer'] = $product_info['manufacturer'];
    $this->data['manufacturers'] = $this->url->link('product/manufacturer/product', 'manufacturer_id=' . $product_info['manufacturer_id']);
    $this->data['model'] = $product_info['model'];
    $this->data['reward'] = $product_info['reward'];
    $this->data['points'] = $product_info['points'];
     
    if ($product_info['quantity'] <= 0) {
    $this->data['stock'] = $product_info['stock_status'];
    } elseif ($this->config->get('config_stock_display')) {
    $this->data['stock'] = $product_info['quantity'];
    } else {
    $this->data['stock'] = $this->language->get('text_instock');
    }
     
    $this->load->model('tool/image');
     
    if ($product_info['image']) {
    $this->data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
    } else {
    $this->data['popup'] = '';
    }
     
    			$manufacturer_image = $this->model_catalog_manufacturer->getManufacturer($product_info['manufacturer_id']);
    		 
    			if($manufacturer_image){
    			   $this->data['manufacturers_img'] = $this->model_tool_image->resize($manufacturer_image['image'], 120, 80);
    			}else{
    			   $this->data['manufacturers_img'] = false;
    			}
     
    if ($product_info['image']) {
    $this->data['thumb'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));
    } else {
    $this->data['thumb'] = '';
    }
     
    $this->data['images'] = array();
     
    $results = $this->model_catalog_product->getProductImages($this->request->get['product_id']);
     
    foreach ($results as $result) {
    $this->data['images'][] = array(
    'popup' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')),
    'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height'))
    );
    }
     
    if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
    $this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
    } else {
    $this->data['price'] = false;
    }
     
    if ((float)$product_info['special']) {
    $this->data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
    } else {
    $this->data['special'] = false;
    }
     
    if ($this->config->get('config_tax')) {
    $this->data['tax'] = $this->currency->format((float)$product_info['special'] ? $product_info['special'] : $product_info['price']);
    } else {
    $this->data['tax'] = false;
    }
     
    $discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']);
     
    $this->data['discounts'] = array(); 
     
    foreach ($discounts as $discount) {
    $this->data['discounts'][] = array(
    'quantity' => $discount['quantity'],
    'price'	=> $this->currency->format($this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax')))
    );
    }
     
    $this->data['options'] = array();
     
    foreach ($this->model_catalog_product->getProductOptions($this->request->get['product_id']) as $option) { 
    if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') { 
    $option_value_data = array();
     
    foreach ($option['option_value'] as $option_value) {
    if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {
    if ((($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) && (float)$option_value['price']) {
    $price = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
    } else {
    $price = false;
    }
     
    $option_value_data[] = array(
    'product_option_value_id' => $option_value['product_option_value_id'],
    'option_value_id'		 => $option_value['option_value_id'],
    'name'					=> $option_value['name'],
    'image'				   => $this->model_tool_image->resize($option_value['image'], 50, 50),
    'price'				   => $price,
    'price_prefix'			=> $option_value['price_prefix']
    );
    }
    }
     
    $this->data['options'][] = array(
    'product_option_id' => $option['product_option_id'],
    'option_id'		 => $option['option_id'],
    'name'			  => $option['name'],
    'type'			  => $option['type'],
    'option_value'	  => $option_value_data,
    'required'		  => $option['required']
    );
    } elseif ($option['type'] == 'text' || $option['type'] == 'textarea' || $option['type'] == 'file' || $option['type'] == 'date' || $option['type'] == 'datetime' || $option['type'] == 'time') {
    $this->data['options'][] = array(
    'product_option_id' => $option['product_option_id'],
    'option_id'		 => $option['option_id'],
    'name'			  => $option['name'],
    'type'			  => $option['type'],
    'option_value'	  => $option['option_value'],
    'required'		  => $option['required']
    );
    }
    }
     
    if ($product_info['minimum']) {
    $this->data['minimum'] = $product_info['minimum'];
    } else {
    $this->data['minimum'] = 1;
    }
     
    $this->data['review_status'] = $this->config->get('config_review_status');
    $this->data['reviews'] = sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']);
    $this->data['rating'] = (int)$product_info['rating'];
    $this->data['description'] = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');
    $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']);
     
    $this->data['products'] = array();
     
    $results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);
     
    foreach ($results as $result) {
    if ($result['image']) {
    $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height'));
    } else {
    $image = false;
    }
     
    if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
    $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
    } else {
    $price = false;
    }
     
    if ((float)$result['special']) {
    $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
    } else {
    $special = false;
    }
     
    if ($this->config->get('config_review_status')) {
    $rating = (int)$result['rating'];
    } else {
    $rating = false;
    }
     
    $this->data['products'][] = array(
    'product_id' => $result['product_id'],
    'thumb'   => $image,
    'name'	 => $result['name'],
    'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
    'price'   => $price,
    'special' => $special,
    'rating'	 => $rating,
    'reviews'	=> sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
    'href'	 => $this->url->link('product/product', 'product_id=' . $result['product_id']),
    );
    }
     
    $this->data['tags'] = array();
     
    $results = $this->model_catalog_product->getProductTags($this->request->get['product_id']);
     
    foreach ($results as $result) {
    $this->data['tags'][] = array(
    'tag'  => $result['tag'],
    'href' => $this->url->link('product/search', 'filter_tag=' . $result['tag'])
    );
    }
     
    $this->model_catalog_product->updateViewed($this->request->get['product_id']);
     
    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) {
    $this->template = $this->config->get('config_template') . '/template/product/product.tpl';
    } else {
    $this->template = 'default/template/product/product.tpl';
    }
     
    $this->children = array(
    'common/column_left',
    'common/column_right',
    'common/content_top',
    'common/content_bottom',
    'common/footer',
    'common/header'
    );
     
    $this->response->setOutput($this->render());
    } else {
    $url = '';
     
    if (isset($this->request->get['path'])) {
    $url .= '&path=' . $this->request->get['path'];
    }
     
    if (isset($this->request->get['manufacturer_id'])) {
    $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
    }
     
    if (isset($this->request->get['filter_name'])) {
    $url .= '&filter_name=' . $this->request->get['filter_name'];
    }
     
    if (isset($this->request->get['filter_tag'])) {
    $url .= '&filter_tag=' . $this->request->get['filter_tag'];
    }
     
    if (isset($this->request->get['filter_description'])) {
    $url .= '&filter_description=' . $this->request->get['filter_description'];
    }
     
    if (isset($this->request->get['filter_category_id'])) {
    $url .= '&filter_category_id=' . $this->request->get['filter_category_id'];
    }
     
    	  $this->data['breadcrumbs'][] = array(
    		'text'	  => $this->language->get('text_error'),
    'href'	  => $this->url->link('product/product', $url . '&product_id=' . $product_id),
    		'separator' => $this->language->get('text_separator')
    	  );
     
    	  $this->document->setTitle($this->language->get('text_error'));
     
    	  $this->data['heading_title'] = $this->language->get('text_error');
     
    	  $this->data['text_error'] = $this->language->get('text_error');
     
    	  $this->data['button_continue'] = $this->language->get('button_continue');
     
    	  $this->data['continue'] = $this->url->link('common/home');
     
    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
    $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
    } else {
    $this->template = 'default/template/error/not_found.tpl';
    }
     
    $this->children = array(
    'common/column_left',
    'common/column_right',
    'common/content_top',
    'common/content_bottom',
    'common/footer',
    'common/header'
    );
     
    $this->response->setOutput($this->render());
    	}
      }
     
    public function review() {
    	$this->language->load('product/product');
     
    $this->load->model('catalog/review');
     
    $this->data['text_on'] = $this->language->get('text_on');
    $this->data['text_no_reviews'] = $this->language->get('text_no_reviews');
     
    if (isset($this->request->get['page'])) {
    $page = $this->request->get['page'];
    } else {
    $page = 1;
    }  
     
    $this->data['reviews'] = array();
     
    $review_total = $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']);
     
    $results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 5, 5);
    	 
    foreach ($results as $result) {
    		$this->data['reviews'][] = array(
    		'author'	 => $result['author'],
    'text'	   => $result['text'],
    'rating'	 => (int)$result['rating'],
    		'reviews'	=> sprintf($this->language->get('text_reviews'), (int)$review_total),
    		'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added']))
    		);
    	  }
     
    $pagination = new Pagination();
    $pagination->total = $review_total;
    $pagination->page = $page;
    $pagination->limit = 5; 
    $pagination->text = $this->language->get('text_pagination');
    $pagination->url = $this->url->link('product/product/review', 'product_id=' . $this->request->get['product_id'] . '&page={page}');
     
    $this->data['pagination'] = $pagination->render();
     
    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/review.tpl')) {
    $this->template = $this->config->get('config_template') . '/template/product/review.tpl';
    } else {
    $this->template = 'default/template/product/review.tpl';
    }
     
    $this->response->setOutput($this->render());
    }
     
    public function write() {
    $this->language->load('product/product');
     
    $this->load->model('catalog/review');
     
    $json = array();
     
    if ($this->request->server['REQUEST_METHOD'] == 'POST') {
    if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 25)) {
    $json['error'] = $this->language->get('error_name');
    }
     
    if ((utf8_strlen($this->request->post['text']) < 25) || (utf8_strlen($this->request->post['text']) > 1000)) {
    $json['error'] = $this->language->get('error_text');
    }
     
    if (empty($this->request->post['rating'])) {
    $json['error'] = $this->language->get('error_rating');
    }
     
    if (empty($this->session->data['captcha']) || ($this->session->data['captcha'] != $this->request->post['captcha'])) {
    $json['error'] = $this->language->get('error_captcha');
    }
     
    if (!isset($json['error'])) {
    $this->model_catalog_review->addReview($this->request->get['product_id'], $this->request->post);
     
    $json['success'] = $this->language->get('text_success');
    }
    }
     
    $this->response->setOutput(json_encode($json));
    }
     
    public function captcha() {
    $this->load->library('captcha');
     
    $captcha = new Captcha();
     
    $this->session->data['captcha'] = $captcha->getCode();
     
    $captcha->showImage();
    }
     
    public function upload() {
    $this->language->load('product/product');
     
    $json = array();
     
    if (!empty($this->request->files['file']['name'])) {
    $filename = basename(preg_replace('/[^a-zA-Z0-9\.\-\s+]/', '', html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8')));
     
    if ((strlen($filename) < 3) || (strlen($filename) > 64)) {
    		$json['error'] = $this->language->get('error_filename');
     }  
     
    $allowed = array();
     
    $filetypes = explode(',', $this->config->get('config_upload_allowed'));
     
    foreach ($filetypes as $filetype) {
    $allowed[] = trim($filetype);
    }
     
    if (!in_array(substr(strrchr($filename, '.'), 1), $allowed)) {
    $json['error'] = $this->language->get('error_filetype');
    	   }
     
    if ($this->request->files['file']['error'] != UPLOAD_ERR_OK) {
    $json['error'] = $this->language->get('error_upload_' . $this->request->files['file']['error']);
    }
    } else {
    $json['error'] = $this->language->get('error_upload');
    }
     
    if (!$json) {
    if (is_uploaded_file($this->request->files['file']['tmp_name']) && file_exists($this->request->files['file']['tmp_name'])) {
    $file = basename($filename) . '.' . md5(mt_rand());
     
    // Hide the uploaded file name so people can not link to it directly.
    $json['file'] = $this->encryption->encrypt($file);
     
    move_uploaded_file($this->request->files['file']['tmp_name'], DIR_DOWNLOAD . $file);
    }
     
    $json['success'] = $this->language->get('text_upload');
    }
     
    $this->response->setOutput(json_encode($json));
    }
    }
    ?>
    Вот файл шаблона рекомендуемых catalog / view / theme / sellya / template / module / featured_content.tpl

    Код:
    <section id="featured" class="featured span">
    <h2><?php echo $heading_title; ?></h2>
    <?php if($this->config->get('sellya_homepage_featured_status')== 0) { ?>
      <div class="box-content hidden-phone">
    	<div class="box-product row-fluid">
     <?php $counter = 0; foreach ($products as $product) { 
    if (($counter+4) %4 == 0) $xclass="span-first-child";
    else $xclass=""; ?>	
    	  <div class="span3  <?php echo $xclass; ?>"><div class="pbox">
    		<?php if ($product['thumb']) { ?>
    		<div class="image"><?php if ($product['special']) { ?><span class="sale-icon"><?php echo $text_sale; ?></span><?php } ?><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
    		<?php } else { ?>
    		<div class="image"><?php if ($product['special']) { ?><span class="sale-icon"><?php echo $text_sale; ?></span><?php } ?>
    		<a href="<?php echo $product['href']; ?>"><img src="catalog/view/theme/sellya/image/no_image-190x190.png" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a>
    		</div>		
    		<?php } ?>
    		<div class="description hidden-phone hidden-tablet"><?php echo $product['description']; ?></div>
    		<div class="rating hidden-phone hidden-tablet">
    		<img src="catalog/view/theme/sellya/image/stars/stars<?php echo $this->config->get('sellya_mid_prod_stars_color'); ?>-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" />
    		</div>   
    		<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/sellya/image/stars/stars<?php echo $this->config->get('sellya_mid_prod_stars_color'); ?>-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" />
    		</div>
    		<?php } ?> -->
    		<div class="cart"><input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" /></div>
    	  </div></div>
    	  <?php $counter++; } ?>
    	</div>
      </div>
     
      <div class="box-content visible-phone">
    	<div class="box-product row-fluid">
     <?php $counter = 0; foreach ($products as $product) { 
    if (($counter+2) %2 == 0) $xclass="span-first-child";
    else $xclass=""; ?>	
    	  <div class="span3  <?php echo $xclass; ?>"><div class="pbox">
    		<?php if ($product['thumb']) { ?>
    		<div class="image"><?php if ($product['special']) { ?><span class="sale-icon"><?php echo $text_sale; ?></span><?php } ?><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
    		<?php } else { ?>
    		<div class="image"><?php if ($product['special']) { ?><span class="sale-icon"><?php echo $text_sale; ?></span><?php } ?>
    		<a href="<?php echo $product['href']; ?>"><img src="catalog/view/theme/sellya/image/no_image-190x190.png" 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>
    		<?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/sellya/image/stars/stars<?php echo $this->config->get('sellya_mid_prod_stars_color'); ?>-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" />
    		</div>
    		<?php } ?> -->
    		<div class="cart"><input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" /></div>
    	  </div></div>
    	  <?php $counter++; } ?>
    	</div>
      </div>  
    <?php } ?> 
     
    <?php if($this->config->get('sellya_homepage_featured_status')== 1) { ?>
    <div id="carousel-featured-<?php echo $module; ?>" class="es-carousel-wrapper">
    <div class="es-carousel">		
    <ul>
    		<?php foreach ($products as $product) { ?>
    <li><div class="pbox">
    		<?php if ($product['thumb']) { ?>
    		<div class="image"><?php if ($product['special']) { ?><span class="sale-icon"><?php echo $text_sale; ?></span><?php } ?>
    		<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
    		<?php } else { ?>
    		<div class="image"><?php if ($product['special']) { ?><span class="sale-icon"><?php echo $text_sale; ?></span><?php } ?>
    		<a href="<?php echo $product['href']; ?>"><img src="catalog/view/theme/sellya/image/no_image-190x190.png" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a>
    		</div>	
    		<?php } ?>
    		<div class="description hidden-phone hidden-tablet"><?php echo $product['description']; ?></div>
    		<div class="rating hidden-phone hidden-tablet">
    		<img src="catalog/view/theme/sellya/image/stars/stars<?php echo $this->config->get('sellya_mid_prod_stars_color'); ?>-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" />
    		</div>		   
    		<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/sellya/image/stars/stars<?php echo $this->config->get('sellya_mid_prod_stars_color'); ?>-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" />
    		</div>
    		<?php } ?> -->
    		<div class="cart"><input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" /></div>
     
    		</div></li>
    		<?php } ?>
    </ul>
    </div>
    </div>
    <?php } ?>
    </section>
     
    <script type="text/javascript">
     
    $('#carousel-featured-<?php echo $module; ?>').elastislide({
     
    speed	   : 450,// animation speed
    easing	  : '',// animation easing effect
     
     
    // the minimum number of items to show. When we resize the window, this will make sure minItems are always shown (unless of course minItems is higher than the total number of elements)
    minItems: 1
    });
     
    //Fix to adjust on windows resize
    $(window).triggerHandler('resize.elastislide');
     
    </script>
    Вот файл контроллера рекомендуемых catalog / controller / module / featured.php

    Код:
    <?php
    class ControllerModuleFeatured extends Controller {
    protected function index($setting) {
    static $module = 0;
     
    $this->language->load('module/featured'); 
     
    	  $this->data['heading_title'] = $this->language->get('heading_title');
     
    $this->data['text_sale'] = $this->language->get('text_sale');
     
    $this->data['button_cart'] = $this->language->get('button_cart');
     
    		$this->data['position'] = $setting['position'];
    $this->data['layout_id'] = $setting['layout_id'];
     
    $this->load->model('catalog/product');
     
    $this->load->model('tool/image');
     
    $this->data['products'] = array();
     
    $products = explode(',', $this->config->get('featured_product'));
     
    if (empty($setting['limit'])) {
    $setting['limit'] = 5;
    }
     
    $products = array_slice($products, 0, (int)$setting['limit']);
     
    foreach ($products as $product_id) {
    $product_info = $this->model_catalog_product->getProduct($product_id);
     
    if ($product_info) {
    if ($product_info['image']) {
    $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']);
    } else {
    $image = false;
    }
     
    if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
    $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
    } else {
    $price = false;
    }
     
    if ((float)$product_info['special']) {
    $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
    } else {
    $special = false;
    }
     
    if ($this->config->get('config_review_status')) {
    $rating = $product_info['rating'];
    } else {
    $rating = false;
    }
     
    $this->data['products'][] = array(
    'product_id' => $product_info['product_id'],
    'thumb'   => $image,
    'name'	 => $product_info['name'],
    'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
    'price'   => $price,
    'special' => $special,
    'rating'	 => $rating,
    'reviews'	=> sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']),
    'href'	 => $this->url->link('product/product', 'product_id=' . $product_info['product_id']),
    );
    }
    }
     
    $this->data['module'] = $module++; 
     
    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/featured.tpl')) {
    $this->template = $this->config->get('config_template') . '/template/module/featured.tpl';
    } else {
    $this->template = 'default/template/module/featured.tpl';
    }
     
    $this->render();
    }
    }
    ?>
     
  3. winner7

    winner7

    Регистрация:
    6 мар 2013
    Сообщения:
    322
    Симпатии:
    55
    Народ, ну что, ни у кого мыслей нет? Так и не могу решить проблему...
     
  4. Bnopen

    Bnopen Команда форума

    Регистрация:
    3 мар 2013
    Сообщения:
    1.155
    Симпатии:
    514
    winner7, вы посмотрите журнал ошибок vqmod (там будет описана ошибка) - не работает скорее всего из-за того, что не находит строки для замены в модификации.
    catalog/view/theme/default/template/ - здесь изменили название темы? или она у вас в каталоге default так и есть?
    И вот здесь - catalog/view/theme/default/template/product/product.tpl
    Проверьте в текстовом редакторе находит ли такую строку - <input type="button" value="<?php echo $button_cart; ?>" id="button-cart" class="button" />
    Есть хорошая штука - vqmanager - она показывает лог ошибок для vqmod-ов.
     
    winner7 нравится это.
  5. yuzi

    yuzi

    Регистрация:
    5 янв 2013
    Сообщения:
    123
    Симпатии:
    63
    Решение для страницы категорий
    (для остальных страниц и модулей делать аналогично):

    ...\catalog\controller\product\category.php :
    находит строку:
    Код:
    'product_id'  => $result['product_id'],
    после добавляем переменную на проверку по кол-ву товара:
    Код:
    'quantity'   => $result['quantity'],
    ...catalog\view\theme\default\template\product\category.tpl :
    находим строку:
    Код:
    <input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />
    заменяем её на:
    Код:
    <?php if ($product['quantity'] > 1) { ?> 
    <input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />
    <?php } ?>
     
  6. denya

    denya

    Регистрация:
    2 мар 2013
    Сообщения:
    129
    Симпатии:
    35
    Установите модуль Waitlist - список ожидания товара - поможет отслеживать товары, которые нужны покупателям + дополнительная мотивация для регистрации.
    Дополнительно он заменяет кнопку "Купить" на "Добавить в лист ожидания" или "Уведомить о наличии" - как пожелаете. Качать тут:
    http://forum.opencart.ua/viewtopic.php?p=2092
     
  7. winner7

    winner7

    Регистрация:
    6 мар 2013
    Сообщения:
    322
    Симпатии:
    55
    А не подскажете где его взять? чет не могу найти такое. Спасибо!
     
  8. yuzi

    yuzi

    Регистрация:
    5 янв 2013
    Сообщения:
    123
    Симпатии:
    63
    лог ошибок VQmod находится по адресу ...\vqmod\logs (если версия vqmod выше 2.3.2)
    если версия ниже тогда файл logs.txt в папке ...\vqmod\
     
    winner7 нравится это.
  9. Дмитрич

    Дмитрич

    Регистрация:
    10 апр 2014
    Сообщения:
    182
    Симпатии:
    23
    Установил похожий модуль: "Remove Add to Cart button for Out of Stock items".
    К сожалению в нём забыли внести правку в файл, формирующий вкладку "Похожие товары" или "сопутствующие товары" - как у кого.
    Подскажите, пожалуйста, какой файл отвечает за похожие товары?
     
  10. yuzi

    yuzi

    Регистрация:
    5 янв 2013
    Сообщения:
    123
    Симпатии:
    63
    Если речь идёт о встроенной функции OpenCart на странице товара, тогда это файлы:
    ..\catalog\controller\product\product.php
    Код:
    $results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);
    ..\catalog\view\theme\default\template\product\product.tpl
    Код:
    <div id="tab-related" class="tab-content">