Sepeti Header Üst Tarafa Taşımak

mirac

OpenCart-TR
Katılım
7 Şub 2010
Mesajlar
1,383
Tepkime puanı
0
Puanları
36
Yaş
43
Konum
Beykoz____
Web sitesi
www.notebook-cantasi.com
catalog\view\theme\default\template\common\header.tpl Aç..

Alttaki kodu gözükmesini istediğin yere ekle..
Kod:
    <?php if ($products) { ?>    
        <a href="index.php?route=checkout/cart" alt="Item(s)">(<?php echo $this->cart->countProducts(); ?>) <?php echo $text_shoppingbag; ?></a>
        <?php
        $count=count($totals);
        $cartinfo = $totals[$count-1]['text'];
        echo $cartinfo;
        ?>   
        <?php } else { ?>  
         <a href="index.php?route=checkout/cart" alt="Item(s)">(<?php echo $this->cart->countProducts(); ?>) <?php echo $text_shoppingbag; ?></a>   
        <?php
        foreach ($totals as $total) { 
        if ($total['title'] != 'Sub-Total:') {
                echo $total['text']; 
            }
           }     
        } ?>


catalog\controller\common\header.php Aç..


Bul..
Kod:
class ControllerCommonHeader extends Controller {
   protected function index() {

Altına Ekle..
Kod:
    $this->data['products'] = array();
            
            foreach ($this->cart->getProducts() as $result) {
                $option_data = array();

                foreach ($result['option'] as $option) {
                      $option_data[] = array(
                        'name'  => $option['name'],
                        'value' => $option['value']
                      );
                }
                
                  $this->data['products'][] = array(
                    'key'          => $result['key'],
                    'name'       => $result['name'],
                    'option'     => $option_data,
                    'quantity'   => $result['quantity'],
                    'stock'      => $result['stock'],
                    'price'      => $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))),
                    'href'       => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']),
                  );
            }
            
       $total_data = array();
            $total = 0;
            $taxes = $this->cart->getTaxes();
            
            $this->load->model('checkout/extension');
            
            $sort_order = array(); 
            
            $results = $this->model_checkout_extension->getExtensions('total');
            
            foreach ($results as $key => $value) {
                $sort_order[$key] = $this->config->get($value['key'] . '_sort_order');
            }
            
            array_multisort($sort_order, SORT_ASC, $results);
        
        foreach ($results as $result) {
                $this->load->model('total/' . $result['key']);

                $this->{'model_total_' . $result['key']}->getTotal($total_data, $total, $taxes);
            }
            
            $sort_order = array(); 
          
            foreach ($total_data as $key => $value) {
                  $sort_order[$key] = $value['sort_order'];
            }

            array_multisort($sort_order, SORT_ASC, $total_data);
            
            $this->data['totals'] = $total_data;
            
            if (isset($this->session->data['coupon'])) {
                $this->load->model('checkout/coupon');
            
                $coupon = $this->model_checkout_coupon->getCoupon($this->session->data['coupon']);
                
                if ($coupon) {
                    $data['coupon_id'] = $coupon['coupon_id'];
                } else {
                    $data['coupon_id'] = 0;
                }
            } else {
                $data['coupon_id'] = 0;
            }
            
        $this->data['ajax'] = $this->config->get('cart_ajax');
            
            $this->id = 'cart';

Bul..
Kod:
$this->data['text_advanced'] = $this->language->get('text_advanced');

Altına Ekle..
Kod:
$this->data['text_shoppingbag'] = $this->language->get('text_shoppingbag');


catalog\language\english\common\header.php

Ekle..
Kod:
$_['text_shoppingbag']   = 'Item(s):';

catalog\language\turkish\common\header.php

Ekle..
Kod:
$_['text_shoppingbag']   = 'Adet Ürün:';

Örnek
(1) Adet Ürün: 165.20TL
 

Tufan

OpenCart-TR
Katılım
29 Eki 2010
Mesajlar
59
Tepkime puanı
0
Puanları
0
RE: Sepeti Header a - Üst Tarafa Taşımak

Dediklerinizin hepsini yaptim ve oldu fakat sepetim resminin üzerine koyamadım o yazıyı bir türlü düzgünde çalışıyor fakat sepetim resminin üzerinde durmuyor ya sonunda ya başında duruyor tpl dosyam aşağıdaki gibi ilk adımdaki kodu nereye eklemeliyim yardımcı olursanız sevinirim

---------------------------------------------------------------------------------------------------------------------------------------------------------------

Kod:
<?php if (!strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6')) echo '<?xml version="1.0" encoding="UTF-8"?>'. "\n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>" xml:lang="<?php echo $lang; ?>">
<head>
<title><?php echo $title; ?></title>
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<base href="<?php echo $base; ?>" />
<?php if ($icon) { ?>
<link href="<?php echo $icon; ?>" rel="icon" />
<?php } ?>
<?php foreach ($links as $link) { ?>
<link href="<?php echo str_replace('&', '&', $link['href']); ?>" rel="<?php echo $link['rel']; ?>" />
<?php } ?>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $template; ?>/stylesheet/stylesheet.css" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $template; ?>/stylesheet/ie6.css" />
<script type="text/javascript" src="catalog/view/javascript/DD_belatedPNG_0.0.8a-min.js"></script>
<script>
DD_belatedPNG.fix('img, #header .div3 a, #content .left, #content .right, .box .top');
</script>
<![endif]-->
<?php foreach ($styles as $style) { ?>
<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/thickbox/thickbox-compressed.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/thickbox/thickbox.css" />
<script type="text/javascript" src="catalog/view/javascript/jquery/tab.js"></script>
<?php foreach ($scripts as $script) { ?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php } ?>
<script type="text/javascript"><!--
function bookmark(url, title) {
	if (window.sidebar) { // firefox
    window.sidebar.addPanel(title, url, "");
	} else if(window.opera && window.print) { // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} else if(document.all) {// ie
   		window.external.AddFavorite(url, title);
	}
}
//--></script>
</head>
<body>
<div id="container">
<div id="header">
  <div class="div1">
    <div class="div2">
      <?php if ($logo) { ?>
      <a href="<?php echo str_replace('&', '&', $home); ?>"><img src="<?php echo $logo; ?>" title="<?php echo $store; ?>" alt="<?php echo $store; ?>" /></a>
      <?php } ?>
    </div>
    <div class="div3"><a href="<?php echo str_replace('&', '&', $special); ?>" style="background-image: url('catalog/view/theme/<?php echo $template; ?>/image/h_special.png');"><?php echo $text_special; ?></a><a onclick="bookmark(document.location, '<?php echo addslashes($title); ?>');" style="background-image: url('catalog/view/theme/<?php echo $template; ?>/image/h_bookmark.png');"><?php echo $text_bookmark; ?></a><a href="<?php echo str_replace('&', '&', $contact); ?>" style="background-image: url('catalog/view/theme/<?php echo $template; ?>/image/h_contact.png');"><?php echo $text_contact; ?></a><a href="<?php echo str_replace('&', '&', $sitemap); ?>" style="background-image: url('catalog/view/theme/<?php echo $template; ?>/image/ust-back.png');"><?php echo $text_sitemap; ?></a></div>
        <div id="search">
          <div class="div8"><?php echo $entry_search; ?>&nbsp;</div>
          <div class="div9">
            <?php if ($keyword) { ?>
            <input type="text" value="<?php echo $keyword; ?>" id="filter_keyword" />
            <?php } else { ?>
            <input type="text" value="<?php echo $text_keyword; ?>" id="filter_keyword" onclick="this.value = '';" onkeydown="this.style.color = '#000000'" style="color: #999;" />
            <?php } ?>
            <select id="filter_category_id">
              <option value="0"><?php echo $text_category; ?></option>
              <?php foreach ($categories as $category) { ?>
              <?php if ($category['category_id'] == $category_id) { ?>
              <option value="<?php echo $category['category_id']; ?>" selected="selected"><?php echo $category['name']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $category['category_id']; ?>"><?php echo $category['name']; ?></option>
              <?php } ?>
              <?php } ?>
            </select>
          </div>
          <div class="div10">&nbsp;&nbsp;<a onclick="moduleSearch();" class="button"><span><?php echo $button_go; ?></span></a></div>
        </div>
    <div class="div5">
    <div class="anasayfa"><a href="<?php echo str_replace('&', '&', $home); ?>"><img src="catalog/view/theme/<?php echo $template; ?>/image/anasayfa.gif" alt="<?php echo $text_home; ?>" title="<?php echo $text_home; ?>" /></a></div>
    <div class="indirimli"><a href="<?php echo str_replace('&', '&', $special); ?>"> <img src="catalog/view/theme/<?php echo $template; ?>/image/indirimli.gif" alt="<?php echo $text_special; ?>" title="<?php echo $text_special; ?>" /></a></div>
      <div class="yeni_urun"><a href="<?php echo str_replace('&', '&', $home); ?>"><img src="catalog/view/theme/<?php echo $template; ?>/image/yeni.gif" alt="<?php echo $text_home; ?>" title="<?php echo $text_home; ?>" /></a></div>
      <div class="iletisim"><a href="<?php echo str_replace('&', '&', $contact); ?>"><img src="catalog/view/theme/<?php echo $template; ?>/image/iletisim.gif" alt="<?php echo $text_contact; ?>" title="<?php echo $text_contact; ?>" /></a></div>      
	  <div class="sepet"><a href="<?php echo str_replace('&', '&', $cart); ?>"><img src="catalog/view/theme/<?php echo $template; ?>/image/sepetim.gif" alt="<?php echo $text_cart; ?>" title="<?php echo $text_cart; ?>" /><?php if ($products) { ?>    
        <a href="index.php?route=checkout/cart" alt="Item(s)">(<?php echo $this->cart->countProducts(); ?>) <?php echo $text_shoppingbag; ?></a>
        <?php
        $count=count($totals);
        $cartinfo = $totals[$count-1]['text'];
        echo $cartinfo;
        ?>   
        <?php } else { ?>  
         <a href="index.php?route=checkout/cart" alt="Item(s)">(<?php echo $this->cart->countProducts(); ?>) <?php echo $text_shoppingbag; ?></a>   
        <?php
        foreach ($totals as $total) { 
        if ($total['title'] != 'Sub-Total:') {
                echo $total['text']; 
            }
           }     
        } ?> </a></div>  
      <div class="l_iletisim"><a href="<?php echo str_replace('&', '&', $contact); ?>"><img src="catalog/view/theme/<?php echo $template; ?>/image/l_iletisim.gif" alt="<?php echo $text_contact; ?>" title="<?php echo $text_contact; ?>" /></a></div>
    </div>
  </div>
  <div class="div6">
    <div class="left"></div>
    <div class="right"></div>
    <div class="center">
      <div id="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
        <?php echo $breadcrumb['separator']; ?><a href="<?php echo str_replace('&', '&', $breadcrumb['href']); ?>"><?php echo $breadcrumb['text']; ?></a>
        <?php } ?>
      </div>
      <div class="div7">
        <?php if ($currencies) { ?>
        <form action="<?php echo str_replace('&', '&', $action); ?>" method="post" enctype="multipart/form-data" id="currency_form">
          <div class="switcher">
            <?php foreach ($currencies as $currency) { ?>
            <?php if ($currency['code'] == $currency_code) { ?>
            <div class="selected"><a><?php echo $currency['title']; ?></a></div>
            <?php } ?>
            <?php } ?>
            <div class="option">
              <?php foreach ($currencies as $currency) { ?>
              <a onclick="$('input[name=\'currency_code\']').attr('value', '<?php echo $currency['code']; ?>'); $('#currency_form').submit();"><?php echo $currency['title']; ?></a>
              <?php } ?>
            </div>
          </div>
          <div style="display: inline;">
            <input type="hidden" name="currency_code" value="" />
            <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
          </div>
        </form>
        <?php } ?>
        <?php if ($languages) { ?>
        <form action="<?php echo str_replace('&', '&', $action); ?>" method="post" enctype="multipart/form-data" id="language_form">
          <div class="switcher">
            <?php foreach ($languages as $language) { ?>
            <?php if ($language['code'] == $language_code) { ?>
            <div class="selected"><a><img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" />&nbsp;&nbsp;<?php echo $language['name']; ?></a></div>
            <?php } ?>
            <?php } ?>
            <div class="option">
              <?php foreach ($languages as $language) { ?>
              <a onclick="$('input[name=\'language_code\']').attr('value', '<?php echo $language['code']; ?>'); $('#language_form').submit();"><img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" />&nbsp;&nbsp;<?php echo $language['name']; ?></a>
              <?php } ?>
            </div>
          </div>
          <div>
            <input type="hidden" name="language_code" value="" />
            <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
          </div>
        </form>
        <?php } ?>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript"><!-- 
function getURLVar(urlVarName) {
	var urlHalves = String(document.location).toLowerCase().split('?');
	var urlVarValue = '';
	
	if (urlHalves[1]) {
		var urlVars = urlHalves[1].split('&');

		for (var i = 0; i <= (urlVars.length); i++) {
			if (urlVars[i]) {
				var urlVarPair = urlVars[i].split('=');
				
				if (urlVarPair[0] && urlVarPair[0] == urlVarName.toLowerCase()) {
					urlVarValue = urlVarPair[1];
				}
			}
		}
	}
	
	return urlVarValue;
} 

$(document).ready(function() {
	route = getURLVar('route');
	
	if (!route) {
		$('#tab_home').addClass('selected');
	} else {
		part = route.split('/');
		
		if (route == 'common/home') {
			$('#tab_home').addClass('selected');
		} else if (route == 'account/login') {
			$('#tab_login').addClass('selected');	
		} else if (part[0] == 'account') {
			$('#tab_account').addClass('selected');
		} else if (route == 'checkout/cart') {
			$('#tab_cart').addClass('selected');
		} else if (part[0] == 'checkout') {
			$('#tab_checkout').addClass('selected');
		} else {
			$('#tab_home').addClass('selected');
		}
	}
});
//--></script>
<script type="text/javascript"><!--
$('#search input').keydown(function(e) {
	if (e.keyCode == 13) {
		moduleSearch();
	}
});

function moduleSearch() {
	url = 'index.php?route=product/search';
	
	var filter_keyword = $('#filter_keyword').attr('value')
	
	if (filter_keyword) {
		url += '&keyword=' + encodeURIComponent(filter_keyword);
	}
	
	var filter_category_id = $('#filter_category_id').attr('value');
	
	if (filter_category_id) {
		url += '&category_id=' + filter_category_id;
	}
	
	location = url;
}
//--></script>
<script type="text/javascript"><!--
$('.switcher').bind('click', function() {
	$(this).find('.option').slideToggle('fast');
});
$('.switcher').bind('mouseleave', function() {
	$(this).find('.option').slideUp('fast');
}); 
//--></script>

Bu konuda kimse yardımcı olmayacak mı ? bu forumda kimse cevap vermiyor sorulara kimse elbette cevap verme zorunluluğu yok fakat birçok konu cevapsız kalıyor
 

admin

Administrator
Yönetici
Katılım
13 Ağu 2009
Mesajlar
3,200
Tepkime puanı
1
Puanları
38
Yaş
39
Konum
Bursa
Web sitesi
www.opencart-tr.com
RE: Sepeti Header a - Üst Tarafa Taşımak

Nasıl ekleneceği yazılmıştır. Bunu kendi isteğiniz doğrultusunda özelleştirerek eklemek size kalmıştır.
 

winpeace

OpenCart-TR
Katılım
8 Eki 2010
Mesajlar
39
Tepkime puanı
0
Puanları
0
RE: Sepeti Header a - Üst Tarafa Taşımak

hiç ürün olmayınca
(0) Adet Ürün: 0.00TL0.00TL bu şekilde gösteriyor ikinci 0.00TL nasıl sileriz?


Çözüm


Kod:
    <?php if ($products) { ?>   
        <a href="index.php?route=checkout/cart" alt="Item(s)"><?php echo $text_cart;?>&nbsp;<?php echo $this->cart->countProducts();?>&nbsp;<?php echo $text_shoppingbag; ?></a>
        <?php
        $count=count($totals);
        $cartinfo = $totals[$count-1]['text'];
        echo $cartinfo
        ?>   
        <?php } else { ?> 
         <a href="index.php?route=checkout/cart" alt="Item(s)"><?php echo $text_cart;?>&nbsp;<?php echo $this->cart->countProducts();?>&nbsp;<?php echo $text_shoppingbag; ?></a>   
        <?php
        foreach ($totals as $total) {
        if ($total['title'] != 'Sub-Total:') {
               //remove from here//
            }
           }
            echo $total['text']; <--//place here//
        } ?>
 

samnet

OpenCart-TR
Katılım
22 Nis 2010
Mesajlar
63
Tepkime puanı
0
Puanları
0
Yaş
38
Konum
istanbul
sorunsuz çaılışıyor tşkler.
normal sepetteki gibi sayfa güncellenmeden gözükmesini nasıl sağlayabiliriz.

sepete ekleyi tıklayınca sepete atar gibi header a nasıl gönderir_?

module/cart.tpl deki kodu ekledim sonuna ama olmadı_?

PHP:
<?php if ($ajax) { ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/ajax_add.js"></script>
<?php } ?>

<script type="text/javascript"><!--

function getUrlParam(name) {
  var name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(window.location.href);
  if (results == null)
    return "";
  else
    return results[1];
}

$(document).ready(function () {
	$('.cart_remove').live('click', function () {
		if (!confirm('<?php echo $text_confirm; ?>')) {
			return false;
		}
		$(this).removeClass('cart_remove').addClass('cart_remove_loading');
		$.ajax({
			type: 'post',
			url: 'index.php?route=module/cart/callback',
			dataType: 'html',
			data: 'remove=' + this.id,
			success: function (html) {
				$('#module_cart .middle').html(html);
				if (getUrlParam('route').indexOf('checkout') != -1) {
					window.location.reload();
				}
			}
		});
	});
});
//--></script>
 

mirza

OpenCart-TR
Katılım
21 Tem 2010
Mesajlar
3
Tepkime puanı
0
Puanları
0
RE: Sepeti Header a - Üst Tarafa Taşımak

winpeace' Alıntı:
hiç ürün olmayınca
(0) Adet Ürün: 0.00TL0.00TL bu şekilde gösteriyor ikinci 0.00TL nasıl sileriz?


Çözüm


Kod:
    <?php if ($products) { ?>   
        <a href="index.php?route=checkout/cart" alt="Item(s)"><?php echo $text_cart;?>&nbsp;<?php echo $this->cart->countProducts();?>&nbsp;<?php echo $text_shoppingbag; ?></a>
        <?php
        $count=count($totals);
        $cartinfo = $totals[$count-1]['text'];
        echo $cartinfo
        ?>   
        <?php } else { ?> 
         <a href="index.php?route=checkout/cart" alt="Item(s)"><?php echo $text_cart;?>&nbsp;<?php echo $this->cart->countProducts();?>&nbsp;<?php echo $text_shoppingbag; ?></a>   
        <?php
        foreach ($totals as $total) {
        if ($total['title'] != 'Sub-Total:') {
               //remove from here//
            }
           }
            echo $total['text']; <--//place here//
        } ?>

aynı dertten ben de muzdaribim.var mı acep bir çözümü_?
sayfayı refresh yapmadan headerdaki sepet bilgisi güncellenmiyor.
 

djdersah

OpenCart-TR
Katılım
20 Kas 2009
Mesajlar
22
Tepkime puanı
0
Puanları
0
sepeti PintiFiyat.com <<< bu sitedeki gibi nasıl yapabiliriz arkadaşlar
 

slckflz

OpenCart-TR
Katılım
6 May 2011
Mesajlar
56
Tepkime puanı
0
Puanları
0
Yaş
41
Konum
İstanbul
Web sitesi
www.evtekstilciniz.com
Arkadaşlar merhaba sepeti breadcrumb kısmına taşıdım sağa dayadım ancak sepet boşken (0) Adet Ürün: 0.00TL0.00TL şeklinde sonuç veriyor bir adet 0.00 tl fazla onu nasıl sileriz forumda yine birkaç arkadaş sormuş ama cevap bulamadım tşkler
 
Üst