Всем привет! У кого есть минутка свободная, помогите с написанием Есть код Отображения просмотренного товара Код: <?php if (isset($products) && count($products)) { ?> <div class="box-left"> <div class="box-heading"><?php echo $heading_title; ?></div> <div class="box-content"> <div class="box-product"> <?php $j=0; for ($i=count($products); $i>=0; $i--) { if (isset($products[$i]['image'])) { ?> <div> <?php if ($products[$i]['image']) { ?> <div class="name"><a href="<?php echo $products[$i]['href']; ?>"><?php echo $products[$i]['name']; ?></a></div> <?php } ?> <div class="image"><a href="<?php echo $products[$i]['href']; ?>"><img src="<?php echo $products[$i]['image']; ?>" alt="<?php echo $products[$i]['name']; ?>" /></a></div> <?php if ($products[$i]['price']) { ?> <div class="price"> <?php if (!$products[$i]['special']) { ?> <?php echo $products[$i]['price']; ?> <?php } else { ?> <span class="price-old"><?php echo $products[$i]['price']; ?></span> <span class="price-new"><?php echo $products[$i]['special']; ?></span> <?php } ?> </div> <?php } ?> <div class="cart"><a onclick="addToCart('<?php echo $products[$i]['product_id']; ?>');" class="button"><span>В корзину</span></a></div> </div> <?php } ?> <?php if ($j == $limit) { break; } $j++; ?> <?php } ?> </div> </div> </div> <?php } ?> И есть Рекомендуемые товары Код: <script type="text/javascript"> (function($){$.fn.equalHeights=function(minHeight,maxHeight){tallest=(minHeight)?minHeight:0;this.each(function(){if($(this).height()>tallest){tallest=$(this).height()}});if((maxHeight)&&tallest>maxHeight)tallest=maxHeight;return this.each(function(){$(this).height(tallest)})}})(jQuery) $(window).load(function(){ if($(".maxheight-feat").length){ $(".maxheight-feat").equalHeights()} }) </script> <div class="box featured"> <div class="box-heading"><?php echo $heading_title; ?></div> <div class="box-content"> <div class="box-product"> <ul> <?php $i=0; foreach ($products as $product) { $i++ ?> <?php if ($i%3==1) { $a='first-in-line'; } elseif ($i%3==0) { $a='last-in-line'; } else { $a=''; } $count=count($products); if ($count-$i<3) { $b='last-in-line2'; } else { $b=''; } ?> <li class="<?php echo $a.' '.$b; ?>"> <script type="text/javascript"> $(document).ready(function(){ $("a.colorbox<?php echo $i?>").colorbox({ rel: 'colorbox', inline:true, html: true, width:'58%', maxWidth:'780px', height:'70%', opacity:0.6, open:false, returnFocus:false, fixed: false, title: false, current:'Product {current} of {total}' }); }); </script> <div class="name maxheight-feat"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div> <div class="inner-indent"> <?php if ($product['thumb']) { ?> <div class="image2"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div> <?php } ?> <?php if ($product['description']) {?> <?php } ?> <?php if ($product['price']) { ?> <div class="price"> <?php if (!$product['special']) { ?> <?php echo $product['price']; ?> <?php } else { ?> <span class="price-new"><?php echo $product['special']; ?></span><!--<span class="price-old"><?php// echo $product['price']; ?></span>--> <?php } ?> </div> <?php } ?> <div style="display:none;"> <div class="quick-view<?php echo $i;?> preview"> <div class="wrapper marg"> <div class="left"> <?php if ($product['thumb1']) { ?> <div class="image3"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb1']; ?>" alt="<?php echo $product['name']; ?>" /></a></div> <?php } ?> </div> <div class="right"> <h1><?php echo $product['name']; ?></h1> <div class="inf"> <?php if ($product['author']) {?> <span class="manufacture"><?php echo $text_manufacturer; ?> <a href="<?php echo $product['manufacturers'];?>"><?php echo $product['author']; ?></a></span> <?php }?> <?php if ($product['model']) {?> <span class="model"><?php echo $text_model; ?><?php echo $product['model']; ?></span> <?php }?> <span class="prod-stock-2"><?php echo $text_availability; ?></span> <?php if ($product['text_availability'] > 0) { ?> <span class="prod-stock"><?php echo $text_instock; ?></span> <?php } else { ?> <span class="prod-stock"><?php echo $text_outstock; ?></span> <?php } ?> <?php if ($product['price']) { ?> <div class="price"> <span class="text-price"><?php echo $text_price; ?></span> <?php if (!$product['special']) { ?> <?php echo $product['price']; ?> <?php } else { ?> <span class="price-new"><?php echo $product['special']; ?></span><span class="price-old"><?php echo $product['price']; ?></span> <?php } ?> </div> <?php } ?> </div> <div class="cart"> <a data-id="<?php echo $product['product_id']; ?>;" class="button addToCart2"><span><?php echo $button_cart; ?></span></a> </div> <a href="<?php echo $product['href']; ?>" class="button-2 details"><span><?php echo $button_details; ?></span></a> <div class="extra-button"> <div class="wishlist"> <a class="tip" onclick="addToWishList('<?php echo $product['product_id']; ?>');" ><span class="tooltip"><?php echo $button_wishlist; ?></span></a> </div> <div class="compare"> <a class="tip2" onclick="addToCompare('<?php echo $product['product_id']; ?>');" ><span class="tooltip2"><?php echo $button_compare; ?></span></a> </div> </div> <div class="clear"></div> <div class="rating"> <img height="18" src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /> </div> </div> </div> <div class="description"> <?php echo $product['description'];?> </div> </div> </div> <a href=".quick-view<?php echo $i;?>" rel="colorbox" class="quick-view-button colorbox<?php echo $i;?> button"><span>Быстрый просмотр</span></a> <div class="cart"><a data-id="<?php echo $product['product_id']; ?>;" class="button addToCart"><span><?php echo $button_cart; ?></span></a></div> <a class="button-2" href="<?php echo $product['href']; ?>"><span><?php echo $button_details; ?></span></a> <div class="clear"></div> <!--<div class="icon-tools"> <div class="wishlist"><a class="tip" onclick="addToWishList('<?php //echo $product['product_id']; ?>');"><?php //echo $button_wishlist; ?></a><span class="tooltip">Wishlist</span></div> <div class="compare"><a class="tip2" onclick="addToCompare('<?php// echo $product['product_id']; ?>');"><?php //echo $button_compare; ?></a><span class="tooltip2">Compare</span></div> <div class="clear"></div> </div>--> </div> </li> <?php } ?> </ul> </div> </div> </div> Проблема такова. Не могу прописать так чтобы в последних просмотренных отображался быстрый просмотр и кнопка подробнее это из Сatalog/view/theme/default/template/module --- Добавлено, 26 окт 2013 --- Просмотренные PHP: <?phpclass ControllerModuleLastview extends Controller { protected function index($setting) { $this->language->load('module/lastview'); $this->data['heading_title'] = $this->language->get('heading_title'); $this->load->model('catalog/product'); $this->load->model('tool/image'); $this->data['button_cart'] = $this->language->get('button_cart'); $this->data['button_details'] = $this->language->get('button_details'); if (isset($this->request->get['product_id'])) { $result = $this->model_catalog_product->getProduct($this->request->get['product_id']); if (isset($result)){ 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'))); } 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 ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']); } else { $image = ''; } $this->session->data['lastview'][$this->request->get['product_id']] = array ( 'product_id' => $result['product_id'], 'image' => $image, 'price' => $price, 'special' => $special, 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']), 'name' => $result['name'] ); } } $this->data['products'] = array(); if (isset($this->session->data['lastview'])){ $results = $this->session->data['lastview']; foreach ($results as $result) { $special = FALSE; $this->data['products'][] = array( 'product_id' => $result['product_id'], 'name' => $result['name'], 'image' => $result['image'], 'href' => $result['href'], 'price' => $result['price'], 'special' => $result['special'] ); } $this->data['limit'] = $setting['limit']; $this->id = 'lastview'; if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/lastview.tpl')) { $this->template = $this->config->get('config_template') . '/template/module/lastview.tpl'; } else { $this->template = 'default/template/module/lastview.tpl'; } $this->render(); } }}?> Рекомендуемые PHP: <?phpclass ControllerModuleFeatured extends Controller { protected function index($setting) { $this->language->load('module/featured'); $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['text_price'] = $this->language->get('text_price'); $this->data['button_wishlist'] = $this->language->get('button_wishlist'); $this->data['button_compare'] = $this->language->get('button_compare'); $this->data['button_cart'] = $this->language->get('button_cart'); $this->data['button_details'] = $this->language->get('button_details'); $this->data['text_manufacturer'] = $this->language->get('text_manufacturer'); $this->data['text_category'] = $this->language->get('text_category'); $this->data['text_model'] = $this->language->get('text_model'); $this->data['text_availability'] = $this->language->get('text_availability'); $this->data['text_instock'] = $this->language->get('text_instock'); $this->data['text_outstock'] = $this->language->get('text_outstock'); $this->data['reviews'] = $this->language->get('reviews'); $this->data['text_price'] = $this->language->get('text_price'); $this->load->model('catalog/product'); $this->load->model('tool/image'); $this->load->model('catalog/review'); $this->load->model('catalog/manufacturer'); $this->language->load('product/product'); $this->language->load('product/category'); $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); $review_total = $this->model_catalog_review->getTotalReviewsByProductId($product_info['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 ($product_info['image']) { $image1 = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height')); } else { $image1 = 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, 'thumb1' => $image1, 'name' => $product_info['name'], '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']), 'description' =>html_entity_decode($product_info['description']), 'description1' =>strip_tags (html_entity_decode($product_info['description'])), 'reviews' => $review_total, 'author' => $product_info['manufacturer'], 'manufacturers' =>$this->data['manufacturers'] = $this->url->link('product/manufacturer/product', 'manufacturer_id=' . $product_info['manufacturer_id']), 'model' => $product_info['model'], 'text_availability' => $product_info['quantity'], 'allow' => $product_info['minimum'] ); } } 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(); }}?> Это из /catalog/controller/module Если надо какие то еще данные, скину.
Какая версия Опенкарта? Какой быстрый просмотр вы имеете ввиду? Кнопки быстрый просмотр в файлах контроллера вообще не предусмотрено, это если бегло глянуть.Собственно, кода быстрого просмотра не приложено.
Позволю себе заметить, в контроллерах вообще кнопок не предусмотрено! Все кнопки формируют представления - .tpl файлы.
Я имел ввиду не функционал, а языковой вызов, для этой кнопки.Пример: $this->data['button_quick_view'] = $this->language->get('button_quick_view'); А догадываться,какая иная функция у ТС отвечает за это, уж очень проблематично) В рекомендованных все нормально показывает?