Привет всем. Нужно вывести мини блок товара с изображением, названием и кнопку купить внутри каточки товара. Сам блок должен дублировать сам же этот товар в котором находиться покупатель. То есть мини блок повторяет саму же карточку товара. Вот контроллер который собрал помогти поправить чтобы адекватно сработал механизм Спойлер PHP: <?phpclass ControllerModuleProductCarousel extends Controller { protected function index($setting) { $this->load->model('tool/image'); $data['product_query_type']=$setting['product_query_type']; $this->data['button_cart'] = $this->language->get('button_cart'); if (file_exists('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/carousel.css')) { $this->document->addStyle('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/carousel.css'); } else { $this->document->addStyle('catalog/view/theme/default/stylesheet/carousel.css'); } $this->data['scroll']=$setting['scroll']; $this->data['limit']=isset($setting['limit'])?$setting['limit']:5; $data['img_width']=$setting['image_width']; $data['img_height']=$setting['image_height']; $this->data['products'] = array(); $this->load->model('catalog/product'); $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'], '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']), ); //Get the title from the language file $this->data['heading_title']=$this->language->get('heading_title_featured'); } if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/product_carousel.tpl')) { $this->template = $this->config->get('config_template') . '/template/module/product_carousel.tpl'; } else { $this->template = 'default/template/module/product_carousel.tpl'; } $this->render(); }}?>
Конечно, вот здесь при прокрутке ниже, появляется плавающая форма которая дублирует карту товара, хотелось бы создать форму на подобии, сначала задумал создать как дополнительные модуль чтобы без проблем можно было изменить местоположение формы, но не получается все это вывести.
Никакого доп модуля не нужно. Просто верстаете отдельный блок прямо в шаблоне и скрываете его. Потом при определенных условиях показываете его.
Изначально так и думал сделать для себя, потом подумал что может будет смыслом сделать отдельным модулем, может пригодиться кому.