예제 #1
0
 /**
  * When a magento product deleted
  * @param unknown $observer
  */
 public function productDeleteAfter($observer)
 {
     if ($this->autoIndex) {
         $product = $observer->getEvent()->getProduct();
         $this->updateSolrIndex($product->getId());
     }
 }
예제 #2
0
 /**
  * When a magento product deleted
  * @param unknown $observer
  */
 public function productDeleteAfter($observer)
 {
     $availableCores = array_keys($this->ultility->getAvailableCores());
     $solr_server_url = Mage::getStoreConfig('webmods_solrsearch/settings/solr_server_url', 0);
     $product = $observer->getEvent()->getProduct();
     foreach ($availableCores as $solrcore) {
         $Url = trim($solr_server_url, '/') . '/' . $solrcore . '/update?stream.body=<delete><query>products_id:' . $product->getId() . '</query></delete>&commit=true';
         Mage::getResourceModel('solrsearch/solr')->doRequest($Url);
         //Remove product id from log table
         $this->ultility->removeLogProductId($product->getId());
     }
 }