debreli
OpenCart-TR
catalog/controller/common/header.php aç
bul
sonrasına ekle
catalog/view/theme/default/template/common/header.tpl aç
bul
sonrasına ekle
catalog/view/theme/default/template/common/header.tpl aç dosyanın sonuna ekle
bu linkteki ticker klasörünü javascript klasörünün içine atın
ticker zip
bul
Kod:
$this->children = array(
'module/language',
'module/currency',
'module/cart'
);
sonrasına ekle
Kod:
//yeni ürünler
$this->load->model('catalog/product');
$this->data['products'] = array();
$data = array(
'sort' => 'p.date_added',
'order' => 'DESC',
'start' => 0,
'limit' => '20'
);
$results = $this->model_catalog_product->getProducts($data);
foreach ($results as $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')));
} 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;
}
$this->data['products'][] = array(
'product_id' => $result['product_id'],
'name' => $result['name'],
'price' => $price,
'special' => $special,
'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']),
);
}
//yeni ürünler bitti
catalog/view/theme/default/template/common/header.tpl aç
bul
Kod:
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/colorbox/colorbox.css" media="screen" />
sonrasına ekle
Kod:
<link href="catalog/view/javascript/ticker/styles/ticker-style.css" rel="stylesheet" type="text/css" />
<script src="catalog/view/javascript/ticker/includes/jquery.ticker.js" type="text/javascript"></script><script type="text/javascript">
$(function () {
$('#js-news').ticker();
});
</script>
catalog/view/theme/default/template/common/header.tpl aç dosyanın sonuna ekle
Kod:
<div class="box-product">
<?php foreach ($products as $product) { ?>
<ul id="js-news" class="js-hidden">
<li class="news-item"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
<?php if ($product['price']) { ?>
<?php if (!$product['special']) { ?>
<?php echo $product['price']; ?>
<?php } else { ?>
<span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
<?php } ?>
<?php } ?></li>
</ul>
</div>
<?php } ?>
bu linkteki ticker klasörünü javascript klasörünün içine atın
ticker zip