Thank you very much for your interest. People need someone like you in this forum
this is "showintabs_output.tpl
Code: Select all
<div class="box products <?php echo $columns; ?>">
<?php if (count($tabs) <= 1) { ?>
<div class="box-heading">
<?php foreach ($tabs as $keyTab => $tab) { ?>
<?php echo $tab['title']; ?>
</div>
<?php } ?>
<?php } else { ?>
<div class="menuacbaslik">
<p>Kategoriler</p>
<a href="#" id="menu-ac" class="menuac">Tüm Kategoriler</a>
</div>
<div class="box-heading product-tabs">
<ul id="tabs-<?php echo $module; ?>" class="nav nav-tabs" data-tabs="tabs">
<?php foreach ($tabs as $keyTab => $tab) { ?>
<?php if($keyTab == 0) { ?>
<li class="active"><a href="#tab<?php echo $module; ?><?php echo $keyTab; ?>" data-toggle="tab"><span class="icon<?php echo $module; ?><?php echo $keyTab; ?>"><?php echo $tab['title']; ?></span></a></li>
<?php } else { ?>
<li><a href="#tab<?php echo $module; ?><?php echo $keyTab; ?>" data-toggle="tab" role="tab" title="Seç"><span class="icon<?php echo $module; ?><?php echo $keyTab; ?>"><?php echo $tab['title']; ?></span></a></li>
<?php } ?>
<?php } ?>
</ul>
</div>
<?php } ?>
<div class="tab-content">
<?php foreach ($tabs as $key => $tab) { ?>
<div class="tab-pane <?php echo (empty($key) ? 'active' : ''); ?>" id="tab<?php echo $module; ?><?php echo $key; ?>">
<div class="grid_holder">
<div class="product-grid <?php echo $module; ?> <?php if ($carousel) { ?>carousel<?php } ?>">
<?php foreach ($tab['products'] as $product) { ?><!--
-->
<div class="item contrast_font">
<div class="mim-product">
<?php if ($product['thumb']) { ?>
<div class="image">
<?php if ($product['jan']) { ?>
<div class="uretim"><?php echo $product['jan']; ?></div>
<?php } ?>
<?php if ($product['upc']) { ?>
<div class="takim"><?php echo $product['upc']; ?></div>
<?php } ?>
<?php if ($product['special'] && $cosyone_percentage_sale_badge == 'enabled') { ?>
<div class="sale_badge">-<?php echo $product['sales_percantage']; ?>%</div>
<?php } ?>
<?php if ($product['thumb_hover'] && $cosyone_rollover_effect == 'enabled') { ?>
<div class="image_hover"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb_hover']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a>
<?php } elseif ($product['thumb']) { ?>
<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a>
<?php } ?>
<?php if ($cosyone_text_ql) {?>
<div class="main_quicklook">
<a href="<?php echo $product['quickview']; ?>" rel="nofollow" class="button quickview"><i class="fa fa-eye"></i> <?php echo $cosyone_text_ql; ?></a>
</div>
<?php } ?>
</div><!-- image ends -->
<?php } ?>
<div class="information_wrapper">
<div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
<br>
<div class="mim-catbox">
<?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"><button type="submit" class="button contrast" onclick="cart.add('<?php echo $product['product_id']; ?>');" ><i class="fa fa-shopping-cart"></i> <?php echo $button_cart; ?></button></div>
<div class="clearfix"></div>
</div>
</div><!-- informtion wrapper ends -->
</div>
</div><!--
--><?php } ?>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<script type="text/javascript">
$('#menu-ac').click( function() {
$(".vertical-wrapper").toggleClass("so-vertical-active");
} );
</script>
<script src="//itemslide.github.io/dist/itemslide.min.js"></script>
<script type="text/javascript"><!--
if ($(window).width() < 768) {
var carousel;
$(document).ready(function () {
carousel = $(".ico-slider ul");
carousel.itemslide({
left_sided: true
});
$(window).resize(function () {
carousel.reload();
});
});
}
--></script>
<script type="text/javascript">
$('[data-toggle="tab"]').tooltip({
trigger: 'hover',
placement: 'top',
animate: true,
delay: 0,
container: 'body'
});
</script>
<?php if ($carousel) { ?>
<script type="text/javascript"><!--
$(document).ready(function() {
var grid5 = 5;
var grid4 = 4;
var grid3 = 3;
var grid1 = 1;
$('.product-grid.<?php echo $module; ?>').owlCarousel({
itemsCustom: [ [0, 1], [350, 1], [550, 2], [1025, <?php echo $columns; ?>]],
pagination: false,
navigation:true,
slideSpeed:500,
scrollPerPage:false,
navigationText: [
"<div class='slide_arrow_prev'><i class='fa fa-angle-left'></i></div>",
"<div class='slide_arrow_next'><i class='fa fa-angle-right'></i></div>"
]
});
});
//--></script>
<?php } ?>
and this is showintabs_output.php
Code: Select all
<?php
class ControllerModuleShowintabsoutput extends Controller {
public function index($setting) {
$this->load->language('module/showintabs');
$this->load->model('catalog/product');
$data['text_tax'] = $this->language->get('text_tax');
$data['button_cart'] = $this->language->get('button_cart');
$data['button_wishlist'] = $this->language->get('button_wishlist');
$data['button_compare'] = $this->language->get('button_compare');
$data['cosyone_category_per_row'] = $this->config->get('cosyone_category_per_row');
$data['cosyone_rollover_effect'] = $this->config->get('cosyone_rollover_effect');
$data['cosyone_percentage_sale_badge'] = $this->config->get('cosyone_percentage_sale_badge');
$cosyone_quicklook = $this->config->get('cosyone_text_ql');
if(empty($cosyone_quicklook[$this->language->get('code')])) {
$data['cosyone_text_ql'] = false;
} else if (isset($cosyone_quicklook[$this->language->get('code')])) {
$data['cosyone_text_ql'] = html_entity_decode($cosyone_quicklook[$this->language->get('code')], ENT_QUOTES, 'UTF-8');
}
$data['cosyone_brand'] = $this->config->get('cosyone_brand');
$data['carousel'] = $setting['carousel'];
$data['columns'] = $setting['columns'];
static $module = 0;
$data['tabs'] = array();
$this->load->model('tool/image');
$tabs = $this->config->get('showintabs_tab');
$tabs = isset($tabs) ? $tabs : array();
foreach ($tabs as $key => $tab) {
if(in_array($key, $setting['selected_tabs']['tabs'])) {
if (!empty($tab['title'][$this->config->get('config_language_id')])) {
$title = $tab['title'][$this->config->get('config_language_id')];
}else{
$title = $this->language->get('heading_default');
}
$products = array();
switch ($tab['data_source']) {
case 'SP': //Select Products
$results = $this->getSelectProducts($tab,$setting['limit']);
break;
case 'PG': //Product Group
$results = $this->getProductGroups($tab,$setting['limit']);
break;
case 'CQ': //Custom Query
$results = $this->getCustomQuery($tab,$setting['limit']);
break;
default:
$this->log->write('SHOW_IN_TAB::ERROR: The tab don\'t have product configured.');
break;
}
//Preparo la info de cada producto
foreach ($results as $result) {
if ($result['image']) {
$image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']);
} else {
$image = $this->model_tool_image->resize('placeholder.png', $setting['image_width'], $setting['image_height']);
}
$images = $this->model_catalog_product->getProductImages($result['product_id']);
if(isset($images[0]['image']) && !empty($images[0]['image'])){
$images =$images[0]['image'];
} else {
$images = 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 ((float)$result['special']) {
$sales_percantage = ((($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')))-($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'))))/(($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')))/100));
} else {
$sales_percantage = false;
}
if ((float)$result['special']) {
$special_info = $this->model_catalog_product->getSpecialPriceEnd($result['product_id']);
$special_date_end = strtotime($special_info['date_end']) - time();
} else {
$special_date_end = false;
}
if ($this->config->get('config_tax')) {
$tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']);
} else {
$tax = false;
}
if ($this->config->get('config_review_status')) {
$rating = $result['rating'];
} else {
$rating = false;
}
$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, $this->config->get('config_product_description_length')) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'rating' => $rating,
'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']),
'quickview' => $this->url->link('product/quickview', 'product_id=' . $result['product_id'], '', 'SSL'),
'jan' => $result['jan'],
'upc' => $result['upc'],
'sales_percantage' => number_format($sales_percantage, 0, ',', '.'),
'special_date_end' => $special_date_end,
'brand_name' => $result['manufacturer'],
'thumb_hover' => $this->model_tool_image->resize($images, $setting['image_width'], $setting['image_height'])
);
}
$data['tabs'][] = array(
'title' => $title,
'products' => $products
);
}
}
$data['button_cart'] = $this->language->get('button_cart');
$data['module'] = $module++;
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/showintabs_output.tpl')) {
return $this->load->view($this->config->get('config_template') . '/template/module/showintabs_output.tpl', $data);
} else {
return $this->load->view('default/template/module/showintabs_output.tpl', $data);
}
}
// Obtiene los productos de los grupos predefinidos de opencart
private function getProductGroups( $tabInfo , $limit ){
$results = array();
//Obtengo listado de productos en funcion del criterio
switch ( $tabInfo['product_group'] ) {
case 'BS':
$results = $this->model_catalog_product->getBestSellerProducts($limit);
break;
case 'LA':
$results = $this->model_catalog_product->getLatestProducts($limit);
break;
case 'SP':
$results = $this->model_catalog_product->getProductSpecials(array('start' => 0,'limit' => $limit));
break;
case 'PP':
$results = $this->model_catalog_product->getPopularProducts($limit);
break;
}
return $results;
}
// Obtiene los productos seleccionados por el user con toda la info necesaria
private function getSelectProducts( $tabInfo , $limit ){
$results = array();
if(isset($tabInfo['products'])){
$limit_count = 0;
foreach ( $tabInfo['products'] as $product ) {
if ($limit_count++ == $limit) break;
$results[$product['product_id']] = $this->model_catalog_product->getProduct($product['product_id']);
}
}
return $results;
}
//Obtiene los productos segun los datos del custom query
private function getCustomQuery( $tabInfo , $limit){
$results = array();
if ( $tabInfo['sort'] == 'rating' || $tabInfo['sort'] == 'p.date_added') {
$order = 'DESC';
}else{
$order = 'ASC';
}
$data = array(
'filter_category_id' => $tabInfo['filter_category']=='ALL' ? '' : $tabInfo['filter_category'],
'filter_manufacturer_id' => $tabInfo['filter_manufacturer']=='ALL' ? '' : $tabInfo['filter_manufacturer'],
'sort' => $tabInfo['sort'],
'order' => $order,
'start' => 0,
'limit' => $limit
);
$results = $this->model_catalog_product->getProducts($data);
return $results;
}
}
scottyboyyy wrote: ↑Sun Jun 10, 2018 10:51 am
No problem! Your english is good - I just misunderstood, I know what you are wanting now!
If you can send me the .tpl and controller .php of this file then I can hopefully send you back a solution to link to all the products for the selected tab's category. It will be easier / quicker for me to do this if I can see these files :-).