2015-08-05 19 views
6

Ürün karşılaştırma linkim çalışmıyor. Bu Magento 1.9'da. Dizini temizlemenin istisnasıyla,Magento: Ürün Karşılaştırma link çalışmıyor

My issues are almost identical to this post. Denediğim başka bir şey var mı?

İşte sorunlar şunlardır:

ben "böyle-ve-bu tür ürün başarıyla Karşılaştırma listesine ekledi" belirten bir mesaj görünür, bir ürün üzerinde "Karşılaştırma Ekle" yi tıklayın

.

Ancak, karşılaştırılacak ürünler kenar çubuğunda "Karşılaştırılacak öğe yok."

catalog_compare_item tablosunun doğru ziyaretçi kimliği ve ürün kimliğiyle doldurulduğunu söyleyebilirim, ancak şablon/katalog/ürün/karşılaştır/sidebar.phtml öğesinde print_r($this->helper('catalog/product_compare')->getItemCount()) yaparsam, "0" döndürülür.

Kenar çubuğu neden karşılaştırılacak ürünleri göstermiyor?

+0

kontrol ettin Sagar bildirinürünler listenizdeki ürünler görünür, etkin ve stokta mı? – Fuser97381

+0

evet, evet ve evet! Ürünler her şekilde iyidir. Bu soruya cevap verdiğin için teşekkürler! – Jimmery

+0

Bir şey değil. İyi günler. – Fuser97381

cevap

7

Açıklamalardan, Magento DB'nizin report_compared_product_index tablosuna sahip olmadığı anlaşılıyor.

DB'nizde bu tablo yapısını oluşturmak için aşağıdaki SQL'i alın.

CREATE TABLE IF NOT EXISTS `report_compared_product_index` (
`index_id` bigint(20) unsigned NOT NULL COMMENT 'Index Id', 
    `visitor_id` int(10) unsigned DEFAULT NULL COMMENT 'Visitor Id', 
    `customer_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer Id', 
    `product_id` int(10) unsigned NOT NULL COMMENT 'Product Id', 
    `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id', 
    `added_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Added At' 
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Reports Compared Product Index Table' AUTO_INCREMENT=1 ; 

ALTER TABLE `report_compared_product_index` 
ADD PRIMARY KEY (`index_id`), ADD UNIQUE KEY `UNQ_REPORT_COMPARED_PRODUCT_INDEX_VISITOR_ID_PRODUCT_ID` (`visitor_id`,`product_id`), ADD UNIQUE KEY `UNQ_REPORT_COMPARED_PRODUCT_INDEX_CUSTOMER_ID_PRODUCT_ID` (`customer_id`,`product_id`), ADD KEY `IDX_REPORT_COMPARED_PRODUCT_INDEX_STORE_ID` (`store_id`), ADD KEY `IDX_REPORT_COMPARED_PRODUCT_INDEX_ADDED_AT` (`added_at`), ADD KEY `IDX_REPORT_COMPARED_PRODUCT_INDEX_PRODUCT_ID` (`product_id`); 

Bu yardımcı olursa bana bildirin.

1

Adım 1: Veritabanınızda "report_compared_product_index" tablosuna sahip olduğunuzdan emin olun.

Adım 2: önbelleğini temizlemeyi ve gerçekleştirmek indeksleme

adım 3: Aşağıdaki url gidin

app\code\core\Mage\Catalog\Helper\Product\Compare.php

aşağıdaki işlevi bulun

public function calculate($logout = false)

ve feryat kod yorumlama

// first visit 
 
     // if (!$this->_catalogSession->hasCatalogCompareItemsCount() && !$this->_customerId) { 
 
//   $count = 0; 
 
    //  } else { 
 
      /** @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Compare_Item_Collection */ 
 
      $collection = Mage::getResourceModel('catalog/product_compare_item_collection') 
 
       ->useProductItem(true); 
 
      if (!$logout && $this->_customerSession->isLoggedIn()) { 
 
       $collection->setCustomerId($this->_customerSession->getCustomerId()); 
 
      } elseif ($this->_customerId) { 
 
       $collection->setCustomerId($this->_customerId); 
 
      } else { 
 
       $collection->setVisitorId($this->_logVisitor->getId()); 
 
      } 
 

 
      /* Price data is added to consider item stock status using price index */ 
 
      $collection->addPriceData(); 
 

 
      $this->_productVisibility->addVisibleInSiteFilterToCollection($collection); 
 

 
      $count = $collection->getSize(); 
 
     // } 
 

 
     $this->_catalogSession->setCatalogCompareItemsCount($count); 
 

 
     return $this;

herhangi sorgu hala

Teşekkür

varsa bana

Bunu
İlgili konular