debreli
OpenCart-TR
yeni ürünler linki üzerine maus ile gelince start-stop kayar şekilde yeni ürünleri gösteriyor.
katagorilerdeki ilk sayfada çıkan ürün sayısı kadar ürün izleyebilirsiniz.
yeni ürünler sayfası modikasyonunu kurun.
http://forum.opencart-tr.com/thread-2900.html
catalog/controller/common/header.php aç
bul
öncesine ekle
catalog/view/theme/default/common/header.tpl aç
bul
değiştirin
default/stylesheet/stylesheet.css aç
dosyanın sonuna ekleyin
header.tpl dosyasında değiştirdiğiniz koda eklemeler yapılabilir (sepete at ,incele butonu,rating,model vs..)
gifleri default/image klasörüne atın.
katagorilerdeki ilk sayfada çıkan ürün sayısı kadar ürün izleyebilirsiniz.
yeni ürünler sayfası modikasyonunu kurun.
http://forum.opencart-tr.com/thread-2900.html
catalog/controller/common/header.php aç
bul
Kod:
$this->id = 'header';
öncesine ekle
Kod:
$this->load->model('catalog/latest');
$this->load->model('catalog/product');
$this->load->model('catalog/review');
$this->load->model('tool/seo_url');
$this->load->model('tool/image');
$this->data['button_add_to_cart'] = $this->language->get('button_add_to_cart');
$this->data['products'] = array();
$results = $this->model_catalog_latest->getLatestProducts ($this->config->get('config_catalog_limit'), $this->config->get('config_catalog_limit'));
foreach ($results as $result) {
if ($result['image']) {
$image = $result['image'];
} else {
$image = 'no_image.jpg';
}
if ($this->config->get('config_review')) {
$rating = $this->model_catalog_review->getAverageRating($result['product_id']);
} else {
$rating = false;
}
$special = FALSE;
$discount = $this->model_catalog_product->getProductDiscount($result['product_id']);
if ($discount) {
$price = $this->currency->format($this->tax->calculate($discount, $result['tax_class_id'], $this->config->get('config_tax')));
} else {
$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
$special = $this->model_catalog_product->getProductSpecial($result['product_id']);
if ($special) {
$special = $this->currency->format($this->tax->calculate($special, $result['tax_class_id'], $this->config->get('config_tax')));
}
}
$options = $this->model_catalog_product->getProductOptions($result['product_id']);
if ($options) {
$add = $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']);
} else {
$add = HTTPS_SERVER . 'index.php?route=checkout/cart&product_id=' . $result['product_id'];
}
$this->data['products'][] = array(
'product_id' => $result['product_id'],
'name' => $result['name'],
'model' => $result['model'],
'stock' => $result['stock'],
'rating' => $rating,
'stars' => sprintf($this->language->get('text_stars'), $rating),
'price' => $price,
'options' => $options,
'special' => $special,
'image' => $this->model_tool_image->resize($image, 75, 75),
'thumb' => $this->model_tool_image->resize($image, $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')),
'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']),
'add' => $add
);
}
if (!$this->config->get('config_customer_price')) {
$this->data['display_price'] = TRUE;
} elseif ($this->customer->isLogged()) {
$this->data['display_price'] = TRUE;
} else {
$this->data['display_price'] = FALSE;
}
catalog/view/theme/default/common/header.tpl aç
bul
Kod:
<a href="<?php echo str_replace('&', '&', $latest); ?>"><?php echo $text_latest; ?></a>
değiştirin
Kod:
<div class="thumbnail5"><a href="<?php echo str_replace('&', '&', $latest); ?>"><?php echo $text_latest; ?></a>
<span><marquee behavior="scroll" direction="left" id="mymarquee" width="440"><table width="440" class="list"><?php if ($products) { ?><?php foreach ($products as $product) { ?><td width="1%"> <a href="<?php echo str_replace('&', '&', $product['href']); ?>" title="<?php echo $product['name']; ?>"><img src="<?php echo $product['image']; ?>" style="border: 1px solid #DDDDDD;"/></a><?php if ($display_price) { ?>
<?php if (!$product['special']) { ?>
<a style="font-size: 11px; color: #900;float: center;"><?php echo $product['price']; ?></a>
<?php } else { ?>
<a style="font-size: 11px; float: center;color: #900; text-decoration: line-through;"><?php echo $product['price']; ?></a> <a style="font-size: 11px; float: center;color: #F00;"><?php echo $product['special']; ?></a>
<?php } ?><?php } ?></td><?php } ?> <?php } ?></table></marquee><input type="image" src="catalog/view/theme/default/image/player_stop.png" onClick="document.getElementById('mymarquee').stop();"></a><input type="image" src="catalog/view/theme/default/image/player_play.png" onClick="document.getElementById('mymarquee').start();"></a></span></div>
default/stylesheet/stylesheet.css aç
dosyanın sonuna ekleyin
Kod:
.thumbnail5{
position: relative;
z-index: 0;
}
.thumbnail5:hover{
background-color: transparent;
z-index: 50;
}
.thumbnail5 span{ /*CSS for enlarged image*/
position: absolute;
background: #E7F2F9;
padding: 5px;
left: -1000px;
border: 1px solid #A5CFE9;
visibility: hidden;
color: #1B4966;
text-decoration: none;
text-align: center;
border-width: 100%;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
opacity: 0.9;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=70);
}
.thumbnail5 span img{ /*CSS for enlarged image*/
border: 5px ;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding: 2px;
float: center;
}
.thumbnail5:hover span{ /*CSS for enlarged image on hover*/
visibility: visible;
top: 0;
left: 70px; /*position where enlarged image should offset horizontally */
}
header.tpl dosyasında değiştirdiğiniz koda eklemeler yapılabilir (sepete at ,incele butonu,rating,model vs..)
gifleri default/image klasörüne atın.