Kategori içindeki ürün adedini gösterme?

nacar

OpenCart-TR
Katılım
3 Tem 2010
Mesajlar
6
Tepkime puanı
0
Puanları
0
Yaş
50
Konum
İstanbul-Çekmeköy
Web sitesi
www.nacarweb.com
Merhabalar,

Uzun süredir OpenCart'ı takip eden biriyim. Localhostta 3-5 sefer kurup denemeler de yaptım, oldukça beğendim. Geçenlerde ilk defa bir siteme kurup, host üzerinde denedim. Sonuç yine iyi de aklıma takılan biryer oldu. Oscommerce kategorilerindeki gibi kategori içindeki ürün adedini gösterme imkanı var mıdır? Bir ayarı mı vardır yoksa manuel kod düzenleme ile yapabilen varmı?

Saygılar...
 

mirac

OpenCart-TR
Katılım
7 Şub 2010
Mesajlar
1,383
Tepkime puanı
0
Puanları
36
Yaş
42
Konum
Beykoz____
Web sitesi
www.notebook-cantasi.com
1.4.1 ile 148 arası sürümler için..
/catalog/controller/module/category.php Aç..


Bul..
Kod:
			if ($this->category_id == $result['category_id']) {
				$output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '"><b>' . $result['name'] . '</b></a>';
			} else {
				$output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '">' . $result['name'] . '</a>';
			}


Değiştir..
Kod:
    $this->load->model('catalog/product');
                              $getTotal = '('. $this->model_catalog_product->getTotalProductsByCategoryId($result['category_id']) .')';
                     if ($this->category_id == $result['category_id']) {
                              $output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '"><b>' . $result['name'] . '</b></a>'. $getTotal;
                     } else {
                             $output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '">' . $result['name'] . '</a>' . $getTotal;
                     }


140 sürümü için..

catalog/controller/module/category.php Aç..

Bul..
Kod:
    if ($this->category_id == $result['category_id']) {
       $output .= '<a href="' . $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $new_path))  . '"><b>' . $result['name'] . '</b></a>';
    } else {
       $output .= '<a href="' . $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $new_path))  . '">' . $result['name'] . '</a>';
    }

Değiştir..
Kod:
    $this->load->model('catalog/product');
              $getTotal = '('. $this->model_catalog_product->getTotalProductsByCategoryId($result['category_id']) .')';
              if ($this->category_id == $result['category_id']) {
                 $output .= '<a href="' . $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $new_path))  . '"><b>' . $result['name'] . '</b></a>'. $getTotal;
              } else {
                 $output .= '<a href="' . $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $new_path))  . '">' . $result['name'] . '</a>' . $getTotal;
              }
 

nacar

OpenCart-TR
Katılım
3 Tem 2010
Mesajlar
6
Tepkime puanı
0
Puanları
0
Yaş
50
Konum
İstanbul-Çekmeköy
Web sitesi
www.nacarweb.com
Hızlı ve sorunu çözücü cevabın için çok teşekkür ederim ustam.

Saygılar...

Ben de bir ekran çıktısı eklemek istedim...
27701529.png


Yeni sorum bu konuyla alakalı olduğundan yine konunun devamına yazmak istedim.

Ana kategori içindeki alt kategorilerin toplamlarını ana kategoride nasıl gösterebilirim acaba? Mevcut hali (önceki mesajdaki) ana kategori içinde ürün varsa gösteriyor, yoksa alt kategoriler kendi adetlerini gösteriyor. Kategoriye tıklamadan ve alt kategorileri görmeden aan kategori isminin yanında içindeki toplam ürün adedi görünse çok daha güzel ve mantıklı olur düşüncesindeyim. Ama OpenCart ta yeni olduğumdan henüz sayfalardaki kodlarla ne neyi yapıyor çözemediğimden kendi başıma beceremedim. Daha önce yapan var mı?

Saygılar...

Örnek :
BİLGİSAYAR (11)
- Anakart (3)
- Ram (2)
- Ekran Kartı (4)
- İşlemci (2)
 

saytekin

OpenCart-TR
Katılım
25 Eyl 2010
Mesajlar
19
Tepkime puanı
0
Puanları
0
süper bir konu açılmış teşekkürler.
 

ghost0001

OpenCart-TR
Katılım
26 Ara 2010
Mesajlar
23
Tepkime puanı
0
Puanları
0
Web sitesi
www.sanalspotcu.com
Kategorilerin içindeki ürün miktarını yanında gösterme

Merhabalar,

Arkadaşlar Kategorilerin Yan Tarafında İçerisindeki Ürün Miktarını Gösteren Güzel Bir Uygulama. Aşağıdaki Resimde Gördüğünüz Gibi Ürün Miktarı Kategorinin Yanında Yer Alıyor..
kategori.png


Değişiklik Yapılacak Dosya:

catalog\controller\module\category.php

Kodu Bul:
Kod:
if ($this->category_id == $result['category_id']) {
				$output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '"><b>' . $result['name'] . '</b></a>';
			} else {
				$output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '">' . $result['name'] . '</a>';
			}

Bununla Değiştir:
Kod:
if ($this->category_id == $result['category_id']) {
				$product_total = $this->model_catalog_product->getTotalProductsByCategoryId($result['category_id']);
				$output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '"><b>' . $result['name'] . '</b>('.$product_total.')</a>';
			} else {
				$product_total = $this->model_catalog_product->getTotalProductsByCategoryId($result['category_id']);
				$output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '">' . $result['name'] . ' ('.$product_total.')</a>';
			}

1.4.9.3 Sürümünde Denenmiştir.
 

ilkerergin

OpenCart-TR
Katılım
7 Ocak 2011
Mesajlar
21
Tepkime puanı
0
Puanları
0
Beyler bunu bır turlu Popup Categorye uyarlayamadım.Yapabilen var mi?

Hallettim beyler. Açılır kategori 'de ( popup category ) modülünde kategorilerin yan tarafında ürün sayılarını miktarlarını görüntülemek için

aşağıdaki kodu bulun
**************************************************************
Kod:
                        }
                        if ($this->category_id == $result['category_id']) {
			        $output .= '<li class="onSelectedLi ' . $classname . '"><a title="' . $result['meta_description'] . '" href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '">' . $result['name'] . '</a>';
			} else {
				$output .= '<li class="' . $classname . '"><a title="' . $result['meta_description'] . '" href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '">' . $result['name'] . '</a>';
			}

-***************************************************************************

Ve bununla değiştirin;


-==================================
Kod:
			}
			if ($this->category_id == $result['category_id']) {
				$product_total = $this->model_catalog_product->getTotalProductsByCategoryId($result['category_id']);
				$output .= '<li class="onSelectedLi ' . $classname . '"><a title="' . $result['meta_description'] . '" href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '">' . $result['name'] . '</b>('.$product_total.')</a>';
			} else {
				$product_total = $this->model_catalog_product->getTotalProductsByCategoryId($result['category_id']);
				$output .= '<li class="' . $classname . '"><a title="' . $result['meta_description'] . '" href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '">' . $result['name'] . ' ('.$product_total.')</a>';
			}


Not lutfen destek aldıgınız her konu icin kodlari inceleyip anlamaya çalışınız.
Eka7a ve Mirac her halta cevap yazmislar.Ben olsam ugrasmazdim.Adamlar bizim icin kendi hayatlarindan fedakarlik yaiyorlar.Paylasim ise herkez ayni özveriri göstermeli.Yeni yeni ornek alip paylasimda bulunuyorum cozdugum konulari.
 

osman

OpenCart-TR
Katılım
26 Eyl 2011
Mesajlar
88
Tepkime puanı
0
Puanları
6
mirac' Alıntı:
1.4.1 ile 148 arası sürümler için..
/catalog/controller/module/category.php Aç..


Bul..
Kod:
			if ($this->category_id == $result['category_id']) {
				$output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '"><b>' . $result['name'] . '</b></a>';
			} else {
				$output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '">' . $result['name'] . '</a>';
			}


Değiştir..
Kod:
    $this->load->model('catalog/product');
                              $getTotal = '('. $this->model_catalog_product->getTotalProductsByCategoryId($result['category_id']) .')';
                     if ($this->category_id == $result['category_id']) {
                              $output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '"><b>' . $result['name'] . '</b></a>'. $getTotal;
                     } else {
                             $output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)  . '">' . $result['name'] . '</a>' . $getTotal;
                     }


140 sürümü için..

catalog/controller/module/category.php Aç..

Bul..
Kod:
    if ($this->category_id == $result['category_id']) {
       $output .= '<a href="' . $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $new_path))  . '"><b>' . $result['name'] . '</b></a>';
    } else {
       $output .= '<a href="' . $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $new_path))  . '">' . $result['name'] . '</a>';
    }

Değiştir..
Kod:
    $this->load->model('catalog/product');
              $getTotal = '('. $this->model_catalog_product->getTotalProductsByCategoryId($result['category_id']) .')';
              if ($this->category_id == $result['category_id']) {
                 $output .= '<a href="' . $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $new_path))  . '"><b>' . $result['name'] . '</b></a>'. $getTotal;
              } else {
                 $output .= '<a href="' . $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $new_path))  . '">' . $result['name'] . '</a>' . $getTotal;
              }

hocam üstteki kodu uyguladıkm fakat ana kategoride sayıların toplamını göstermiyor

Hocam Mrb alt kategorilerde miktarlar görüyor fakat ana karegoride toplam görünmüyor görünmesini nasıl sağlarım
 

osman

OpenCart-TR
Katılım
26 Eyl 2011
Mesajlar
88
Tepkime puanı
0
Puanları
6
bu konu ile ilgilenebilecek bi arkadaş yokmu.............
 
Üst