Expertrec_Recommendation - Version 1.2.20

Version Notes

Expertrec Recommendation plugin for magento sites.

Download this release

Release Info

Developer melchi
Extension Expertrec_Recommendation
Version 1.2.20
Comparing to
See all releases


Code changes from version 1.2.19 to 1.2.20

app/code/community/Expertrec/Recommendation/Model/Api/Request.php CHANGED
@@ -77,8 +77,8 @@
77
  $request->setUri($this->url)
78
  ->setHeaders($this->headers)
79
  ->setMethod($this->method)
80
- ->setParameterGet("user",$this->userId)
81
- ->setConfig(array('timeout' => 1));
82
  if($this->method == Zend_Http_Client::GET) {
83
  $request->setParameterGet($this->getData());
84
  }
77
  $request->setUri($this->url)
78
  ->setHeaders($this->headers)
79
  ->setMethod($this->method)
80
+ ->setParameterGet("user",$this->userId);
81
+ // ->setConfig(array('timeout' => 1));
82
  if($this->method == Zend_Http_Client::GET) {
83
  $request->setParameterGet($this->getData());
84
  }
app/code/community/Expertrec/Recommendation/Model/Feed/Formatter.php CHANGED
@@ -86,6 +86,9 @@
86
  }
87
 
88
  protected function _getImage($fieldName, $product) {
 
 
 
89
  try {
90
  $width = Mage::getStoreConfig(self::IMAGE_WIDTH);
91
  $height = Mage::getStoreConfig(self::IMAGE_HEIGHT);
@@ -93,29 +96,61 @@
93
  $theight = Mage::getStoreConfig(self::THUMBNAIL_HEIGHT);
94
  if('expert_image' == $fieldName ){
95
  if($this->_oConfig['generateImage']){
96
- return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($this->_oConfig['imageWidth'], $this->_oConfig['imageHeight']);
 
 
97
  }else if(!empty($width) && !empty($height)){
98
- return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($width, $height);
 
 
99
  }else if(empty($width) && !empty($height)){
100
- return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($this->_oConfig['imageWidth'], $height);
 
 
101
  }else if(empty($height) && !empty($width)){
102
- return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($width, $this->_oConfig['imageHeight']);
 
 
103
  }else if(empty($height) && empty($width)){
104
- return (string)Mage::helper('catalog/image')->init($product, 'image')->resize($this->_oConfig['imageWidth'], $this->_oConfig['imageHeight']);
 
105
  }
106
  }else if('expert_smallImage' == $fieldName){
107
- return (string)Mage::helper('catalog/image')->init($product, 'image')->resize(250,250);
 
 
108
  }else if ('expert_thumbnail' == $fieldName) {
109
  if(!empty($twidth) && !empty($theight)){
110
- return (string)Mage::helper('catalog/image')->init($product, 'thumbnail')->resize($twidth, $theight);
 
 
111
  }else if(empty($twidth) && !empty($theight)){
112
- return (string)Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(80, $theight);
 
 
113
  }else if(empty($theight) && !empty($twidth)){
114
- return (string)Mage::helper('catalog/image')->init($product, 'thumbnail')->resize($twidth, 80);
 
 
115
  }else if(empty($theight) && empty($twidth)){
116
- return (string)Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(80,80);
 
117
  }
118
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  } catch (Exception $e) {
120
  Mage::getSingleton('expertrec_recommendation/log')->log("Error while fetching the image" . $e->getMessage());
121
  }
86
  }
87
 
88
  protected function _getImage($fieldName, $product) {
89
+
90
+ $storeId = $product->getStoreId();
91
+
92
  try {
93
  $width = Mage::getStoreConfig(self::IMAGE_WIDTH);
94
  $height = Mage::getStoreConfig(self::IMAGE_HEIGHT);
96
  $theight = Mage::getStoreConfig(self::THUMBNAIL_HEIGHT);
97
  if('expert_image' == $fieldName ){
98
  if($this->_oConfig['generateImage']){
99
+
100
+ $image_obj = Mage::helper('catalog/image')->init($product, 'image')->resize($this->_oConfig['imageWidth'], $this->_oConfig['imageHeight']);
101
+
102
  }else if(!empty($width) && !empty($height)){
103
+
104
+ $image_obj = Mage::helper('catalog/image')->init($product, 'image')->resize($width, $height);
105
+
106
  }else if(empty($width) && !empty($height)){
107
+
108
+ $image_obj = Mage::helper('catalog/image')->init($product, 'image')->resize($this->_oConfig['imageWidth'], $height);
109
+
110
  }else if(empty($height) && !empty($width)){
111
+
112
+ $image_obj = Mage::helper('catalog/image')->init($product, 'image')->resize($width, $this->_oConfig['imageHeight']);
113
+
114
  }else if(empty($height) && empty($width)){
115
+
116
+ $image_obj = Mage::helper('catalog/image')->init($product, 'image')->resize($this->_oConfig['imageWidth'], $this->_oConfig['imageHeight']);
117
  }
118
  }else if('expert_smallImage' == $fieldName){
119
+
120
+ $image_obj = Mage::helper('catalog/image')->init($product, 'image')->resize(250,250);
121
+
122
  }else if ('expert_thumbnail' == $fieldName) {
123
  if(!empty($twidth) && !empty($theight)){
124
+
125
+ $image_obj = Mage::helper('catalog/image')->init($product, 'thumbnail')->resize($twidth, $theight);
126
+
127
  }else if(empty($twidth) && !empty($theight)){
128
+
129
+ $image_obj = Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(80, $theight);
130
+
131
  }else if(empty($theight) && !empty($twidth)){
132
+
133
+ $image_obj = Mage::helper('catalog/image')->init($product, 'thumbnail')->resize($twidth, 80);
134
+
135
  }else if(empty($theight) && empty($twidth)){
136
+
137
+ $image_obj = Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(80,80);
138
  }
139
  }
140
+ $image_url = (string)$image_obj;
141
+ // parse image_url and check the image_path is valid with http/ response status = 200
142
+ // and if it valid return image with store specific base_url
143
+ // else return base_url as it is
144
+ // this check is to get image_url from media directory, for multisite
145
+ //('different media dir on each site' and 'sharing same media_dir of a site to all sites')
146
+ $image_parsed_url = parse_url($image_url);
147
+ $image_url_path = substr($image_parsed_url['path'], 1);
148
+ $image_store_url = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK).$image_url_path;
149
+ $headers = @get_headers($image_store_url);
150
+ if(!strpos($headers[0],'200')===false){
151
+ $image_url = $image_store_url;
152
+ }
153
+ return $image_url;
154
  } catch (Exception $e) {
155
  Mage::getSingleton('expertrec_recommendation/log')->log("Error while fetching the image" . $e->getMessage());
156
  }
app/code/community/Expertrec/Recommendation/Model/Observer.php CHANGED
@@ -18,14 +18,29 @@ class Expertrec_Recommendation_Model_Observer {
18
  */
19
  public function trackAddToCart(Varien_Event_Observer $observer) {
20
 
 
 
21
  $product = $observer->getEvent()->getProduct();
22
  if(!$product instanceof Mage_Catalog_Model_Product) {
23
- Mage::getSingleton('expertrec_recommendation/log')->log('AddToCart_Track: product is not a valid type',Zend_Log::ERR);
24
  return $this;
25
  }
26
  //return unique product id
27
  $uniqueId = Mage::helper('expertrec_recommendation')->getUniqueId($product);
28
  $ci_id = $_COOKIE['ci_id'];
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  //sending request
31
  //return boolean
@@ -36,6 +51,8 @@ class Expertrec_Recommendation_Model_Observer {
36
  'item' => $uniqueId,
37
  'event' => 3,
38
  'sku' => $product->getSku(),
 
 
39
  'domain' => $_SERVER['HTTP_HOST'],
40
  'ip' => isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'])
41
 
@@ -46,7 +63,7 @@ class Expertrec_Recommendation_Model_Observer {
46
 
47
  // Mage::getSingleton('expertrec_recommendation/log')->log("AddToCart_Track: request made with uniqueId ".$uniqueId);
48
  if(!$response) {
49
- Mage::getSingleton('expertrec_recommendation/log')->log('AddToCart_Track: request failed for product with uniqueId #'.$uniqueId,Zend_Log::ERR);
50
  }
51
  return $this;
52
  }
@@ -56,10 +73,12 @@ class Expertrec_Recommendation_Model_Observer {
56
  */
57
  public function trackOrder(Varien_Event_Observer $observer) {
58
 
 
 
59
  $payment = $observer->getEvent()->getPayment();
60
 
61
  if(!$payment instanceof Mage_Sales_Model_Order_Payment) {
62
- Mage::getSingleton('expertrec_recommendation/log')->log('Order_Track: payment is not a valid type',Zend_Log::ERR);
63
  return $this;
64
  }
65
  $items = $payment->getOrder()->getAllVisibleItems();
@@ -68,10 +87,21 @@ class Expertrec_Recommendation_Model_Observer {
68
  return $this;
69
  }
70
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  foreach($items as $item) {
72
  if($item instanceof Mage_Sales_Model_Order) {
73
- Mage::getSingleton('expertrec_recommendation/log')
74
- ->log('Order_Track: request failed because item is of instancetype '.get_class($item), Zend_Log::ERR);
75
  continue;
76
  }
77
  $product =$item->getProduct();
@@ -82,6 +112,7 @@ class Expertrec_Recommendation_Model_Observer {
82
  //return unique product id
83
  $uniqueId = Mage::helper('expertrec_recommendation')->getUniqueId($product, $item);
84
  $ci_id = $_COOKIE['ci_id'];
 
85
 
86
  //sending request
87
  //return boolean
@@ -92,6 +123,8 @@ class Expertrec_Recommendation_Model_Observer {
92
  'item' => $uniqueId,
93
  'event' => 2,
94
  'sku' => $item->getSku(),
 
 
95
  'qty' => $item->getQtyOrdered(),
96
  'price' => $item->getPriceInclTax(),
97
  'domain' => $_SERVER['HTTP_HOST'],
@@ -101,10 +134,10 @@ class Expertrec_Recommendation_Model_Observer {
101
  ->prepareRequest()
102
  ->sendRequest();
103
 
104
- // Mage::getSingleton('expertrec_recommendation/log')->log("Order_Track: request made with uniqueId ".$uniqueId);
105
 
106
  if(!$response) {
107
- Mage::getSingleton('expertrec_recommendation/log')->log('Order_Track: request failed for product with uniqueId #'.$uniqueId,Zend_Log::ERR);
108
  }
109
  }
110
  return $this;
@@ -115,10 +148,12 @@ class Expertrec_Recommendation_Model_Observer {
115
  * Method to track remove item from cart
116
  */
117
  public function trackRemoveItem(Varien_Event_Observer $observer){
 
 
118
 
119
  $product = $observer->getQuoteItem()->getProduct();
120
  if(!$product instanceof Mage_Catalog_Model_Product) {
121
- Mage::getSingleton('expertrec_recommendation/log')->log('RemoveItemFromCart_Track: product is not a valid type',Zend_Log::ERR);
122
  return $this;
123
  }
124
 
@@ -127,6 +162,19 @@ class Expertrec_Recommendation_Model_Observer {
127
 
128
  $sku = $product->getSku();
129
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  //sending request
131
  //return boolean
132
  $response = Mage::getModel('expertrec_recommendation/api_request')
@@ -135,6 +183,8 @@ class Expertrec_Recommendation_Model_Observer {
135
  'item' => $uniqueId,
136
  'event' => 11,
137
  'sku' => $sku,
 
 
138
  'domain' => $_SERVER['HTTP_HOST'],
139
  'ip' => isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'])
140
  )
@@ -144,7 +194,7 @@ class Expertrec_Recommendation_Model_Observer {
144
 
145
  //Mage::getSingleton('expertrec_recommendation/log')->log("RemoveItemFromCart_Track: request with uniqueId #".$uniqueId." and sku: ".$sku);
146
  if(!$response) {
147
- Mage::getSingleton('expertrec_recommendation/log')->log('RemoveItemFromCart_Track: request failed for product with uniqueId #'.$uniqueId,Zend_Log::ERR);
148
  }
149
  return $this;
150
  }
@@ -164,6 +214,8 @@ class Expertrec_Recommendation_Model_Observer {
164
  $logger->log('DeleteCatalogProduct_Track: product is not a valid type');
165
  return $this;
166
  }
 
 
167
 
168
  $finalUrl = $this->getFeedEndpoint();
169
  if(empty($finalUrl)){
@@ -283,7 +335,7 @@ class Expertrec_Recommendation_Model_Observer {
283
  $logger->log("product # ".$producttId." is disabled for store # ".$storeId);
284
 
285
  $status_info = '2'.chr(4).'Disabled';
286
- $disabled_array = array('status' => $status_info,'entity_id' => $producttId,'storeId' => $storeId,'websiteId' => $websiteId);
287
 
288
  $finalUrl_disabled = $feedUrl.'/disabled';
289
  // $logger->log("final disabled url is : ".$finalUrl_disabled);
@@ -321,7 +373,7 @@ class Expertrec_Recommendation_Model_Observer {
321
  $logger->log("product # ".$producttId." is out_of_stock for store # ".$storeId);
322
 
323
  $qty = $productt->getData('qty');
324
- $stock_array = array('qty' => $qty,'entity_id' => $producttId,'is_in_stock'=>0,'storeId' => $storeId,'websiteId' => $websiteId);
325
 
326
  $finalUrl_stock = $feedUrl.'/stock';
327
  // $logger->log("final stock url is : ".$finalUrl_stock);
@@ -370,10 +422,43 @@ class Expertrec_Recommendation_Model_Observer {
370
  $resultArray = Mage::getSingleton('expertrec_recommendation/feed_formatter')
371
  ->init()
372
  ->prepareRow($header,$selectedProduct);
373
- $resultArray['storeId'] = $storeId;
374
- $resultArray['websiteId'] = $websiteId;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
 
376
- $logger->log("product # ".$productId." has data for store # ".$storeId);
 
 
 
 
 
 
 
 
 
 
 
377
  // $logger->log(print_r($resultArray,1));
378
 
379
  $finalUrl = $feedUrl.'/product';
@@ -430,34 +515,54 @@ class Expertrec_Recommendation_Model_Observer {
430
  $logger = Mage::getSingleton('expertrec_recommendation/log');
431
  $category = $observer->getEvent()->getCategory();
432
 
433
- // $logger->log("Hook on category after save");
 
 
 
 
 
 
 
 
434
 
435
  // get category url
436
- $store = Mage::app()->getStore();
437
  $category_url = $store->getBaseUrl().$category->getUrlPath();
438
 
 
 
 
 
439
  // get path with name
440
  $pathIdArray = explode('/', $category->getPath());
441
- $storeId = $store->getId();
442
  $pathNameArray = array();
443
 
444
  for($i=0;$i<count($pathIdArray);$i++){
445
- $categoryy = Mage::getModel('catalog/category')->setStoreId($storeId)->load($pathIdArray[$i]);
 
 
446
  $pathNameArray[$i] = $categoryy->getName();
447
  }
 
 
 
 
448
  //removing Root catalog which is $pathNameArrray[0]
449
- array_shift($pathNameArray);
450
  $category_path = implode('/', $pathNameArray);
451
 
452
- array_shift($pathIdArray);
453
  $category_id_path = implode('/', $pathIdArray);
454
 
455
- $categoryArray = array('categoryId' => $category->getId(),
456
- 'categoryName' => $category->getName(),
457
  'categoryIdPath' => $category_id_path,
458
  'categoryNamePath' => $category_path,
459
- 'categoryUrl' => $category_url);
 
 
460
 
 
461
  // passing category to identify category url
462
  $feedUrl = $this->getFeedEndpoint();
463
  $finalUrl = $feedUrl.'/category';
@@ -582,6 +687,19 @@ class Expertrec_Recommendation_Model_Observer {
582
  //return unique product id
583
  $uniqueId = Mage::helper('expertrec_recommendation')->getUniqueId($product);
584
  $ci_id = $_COOKIE['ci_id'];
 
 
 
 
 
 
 
 
 
 
 
 
 
585
 
586
  //sending request
587
  //return boolean
@@ -592,6 +710,8 @@ class Expertrec_Recommendation_Model_Observer {
592
  'item' => $uniqueId,
593
  'event' => 17,
594
  'sku' => $product->getSku(),
 
 
595
  'domain' => $_SERVER['HTTP_HOST'],
596
  'ip' => isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'])
597
 
@@ -614,51 +734,67 @@ class Expertrec_Recommendation_Model_Observer {
614
  $item = $observer->getEvent()->getItem();
615
  $item_array = $item->getData();
616
 
 
617
  $product_id = $item_array["product_id"];
618
- $qty = $item_array["qty"];
619
 
620
- if ($qty == 0){
621
- $stockArray = array('entity_id' => $product_id, 'qty' => $qty, 'is_in_stock' =>0);
622
 
623
- $feedUrl = $this->getFeedEndpoint();
624
- $finalUrl = $feedUrl.'/stock';
625
- if(empty($finalUrl)){
626
- return $this;
627
- }
628
 
629
- //sending request
630
- $response = Mage::getModel('expertrec_recommendation/api_request')
631
- ->setPrepareRequestStatus(false)
632
- ->setUserId('expertrec')
633
- ->setUrl($finalUrl)
634
- ->setMethod(Zend_Http_Client::POST)
635
- ->setData($stockArray)
636
- ->setHeader("Content-Type",'application/json')
637
- ->setPrepareRequestStatus(true)
638
- ->sendRequest();
639
-
640
- $mid = Mage::getStoreConfig(self::MERCHANT_ID);
641
- $feedUrl = "https://feed.expertrec.com/magento/n01eba6261ad7f174cd3a16523e86e65/";
642
- $finalUrl = $feedUrl.''.$mid.'/stock';
643
-
644
- //sending request
645
- $response = Mage::getModel('expertrec_recommendation/api_request')
646
- ->setPrepareRequestStatus(false)
647
- ->setUserId('expertrec')
648
- ->setUrl($finalUrl)
649
- ->setMethod(Zend_Http_Client::POST)
650
- ->setData($stockArray)
651
- ->setHeader("Content-Type",'application/json')
652
- ->setPrepareRequestStatus(true)
653
- ->sendRequest();
654
-
655
- // $logger->log('SUCCESS : request made for stock status with Id #'.$product_id);
656
- if(!$response) {
657
- $logger->log('request failed for stock status with Id #'.$product_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
658
  }
659
  }
660
 
661
-
662
  }
663
 
664
 
18
  */
19
  public function trackAddToCart(Varien_Event_Observer $observer) {
20
 
21
+ $logger = Mage::getSingleton('expertrec_recommendation/log');
22
+
23
  $product = $observer->getEvent()->getProduct();
24
  if(!$product instanceof Mage_Catalog_Model_Product) {
25
+ $logger->log('AddToCart_Track: product is not a valid type',Zend_Log::ERR);
26
  return $this;
27
  }
28
  //return unique product id
29
  $uniqueId = Mage::helper('expertrec_recommendation')->getUniqueId($product);
30
  $ci_id = $_COOKIE['ci_id'];
31
+
32
+ // Gets the current store's details
33
+ $store = Mage::app()->getStore();
34
+
35
+ // Gets the current store's id
36
+ $storeId = Mage::app()->getStore()->getStoreId();
37
+
38
+ // Gets the current website's id
39
+ $websiteId = Mage::app()->getStore()->getWebsiteId();
40
+
41
+ $logger->log("Added to cart for product # ".$uniqueId);
42
+ // $logger->log("store_id ".$storeId);
43
+ // $logger->log("website_id ".$websiteId);
44
 
45
  //sending request
46
  //return boolean
51
  'item' => $uniqueId,
52
  'event' => 3,
53
  'sku' => $product->getSku(),
54
+ 'sid' => $storeId,
55
+ 'wid' => $websiteId,
56
  'domain' => $_SERVER['HTTP_HOST'],
57
  'ip' => isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'])
58
 
63
 
64
  // Mage::getSingleton('expertrec_recommendation/log')->log("AddToCart_Track: request made with uniqueId ".$uniqueId);
65
  if(!$response) {
66
+ $logger->log('AddToCart_Track: request failed for product with uniqueId #'.$uniqueId,Zend_Log::ERR);
67
  }
68
  return $this;
69
  }
73
  */
74
  public function trackOrder(Varien_Event_Observer $observer) {
75
 
76
+ $logger = Mage::getSingleton('expertrec_recommendation/log');
77
+
78
  $payment = $observer->getEvent()->getPayment();
79
 
80
  if(!$payment instanceof Mage_Sales_Model_Order_Payment) {
81
+ $logger->log('Order_Track: payment is not a valid type',Zend_Log::ERR);
82
  return $this;
83
  }
84
  $items = $payment->getOrder()->getAllVisibleItems();
87
  return $this;
88
  }
89
 
90
+ // Gets the current store's details
91
+ $store = Mage::app()->getStore();
92
+
93
+ // Gets the current store's id
94
+ $storeId = Mage::app()->getStore()->getStoreId();
95
+
96
+ // Gets the current website's id
97
+ $websiteId = Mage::app()->getStore()->getWebsiteId();
98
+
99
+ // $logger->log("store_id ".$storeId);
100
+ // $logger->log("website_id ".$websiteId);
101
+
102
  foreach($items as $item) {
103
  if($item instanceof Mage_Sales_Model_Order) {
104
+ $logger->log('Order_Track: request failed because item is of instancetype '.get_class($item), Zend_Log::ERR);
 
105
  continue;
106
  }
107
  $product =$item->getProduct();
112
  //return unique product id
113
  $uniqueId = Mage::helper('expertrec_recommendation')->getUniqueId($product, $item);
114
  $ci_id = $_COOKIE['ci_id'];
115
+ $logger->log("trackOrder for product # ".$uniqueId);
116
 
117
  //sending request
118
  //return boolean
123
  'item' => $uniqueId,
124
  'event' => 2,
125
  'sku' => $item->getSku(),
126
+ 'sid' => $storeId,
127
+ 'wid' => $websiteId,
128
  'qty' => $item->getQtyOrdered(),
129
  'price' => $item->getPriceInclTax(),
130
  'domain' => $_SERVER['HTTP_HOST'],
134
  ->prepareRequest()
135
  ->sendRequest();
136
 
137
+ // $logger->log("Order_Track: request made with uniqueId ".$uniqueId);
138
 
139
  if(!$response) {
140
+ $logger->log('Order_Track: request failed for product with uniqueId #'.$uniqueId,Zend_Log::ERR);
141
  }
142
  }
143
  return $this;
148
  * Method to track remove item from cart
149
  */
150
  public function trackRemoveItem(Varien_Event_Observer $observer){
151
+
152
+ $logger = Mage::getSingleton('expertrec_recommendation/log');
153
 
154
  $product = $observer->getQuoteItem()->getProduct();
155
  if(!$product instanceof Mage_Catalog_Model_Product) {
156
+ $logger->log('RemoveItemFromCart_Track: product is not a valid type',Zend_Log::ERR);
157
  return $this;
158
  }
159
 
162
 
163
  $sku = $product->getSku();
164
 
165
+ // Gets the current store's details
166
+ $store = Mage::app()->getStore();
167
+
168
+ // Gets the current store's id
169
+ $storeId = Mage::app()->getStore()->getStoreId();
170
+
171
+ // Gets the current website's id
172
+ $websiteId = Mage::app()->getStore()->getWebsiteId();
173
+
174
+ $logger->log("trackRemoveItem for product # ".$uniqueId);
175
+ // $logger->log("store_id ".$storeId);
176
+ // $logger->log("website_id ".$websiteId);
177
+
178
  //sending request
179
  //return boolean
180
  $response = Mage::getModel('expertrec_recommendation/api_request')
183
  'item' => $uniqueId,
184
  'event' => 11,
185
  'sku' => $sku,
186
+ 'sid' => $storeId,
187
+ 'wid' => $websiteId,
188
  'domain' => $_SERVER['HTTP_HOST'],
189
  'ip' => isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'])
190
  )
194
 
195
  //Mage::getSingleton('expertrec_recommendation/log')->log("RemoveItemFromCart_Track: request with uniqueId #".$uniqueId." and sku: ".$sku);
196
  if(!$response) {
197
+ $logger->log('RemoveItemFromCart_Track: request failed for product with uniqueId #'.$uniqueId,Zend_Log::ERR);
198
  }
199
  return $this;
200
  }
214
  $logger->log('DeleteCatalogProduct_Track: product is not a valid type');
215
  return $this;
216
  }
217
+
218
+ $logger->log("Deleted product # ".$product->getId());
219
 
220
  $finalUrl = $this->getFeedEndpoint();
221
  if(empty($finalUrl)){
335
  $logger->log("product # ".$producttId." is disabled for store # ".$storeId);
336
 
337
  $status_info = '2'.chr(4).'Disabled';
338
+ $disabled_array = array('status' => $status_info,'entity_id' => $producttId,'sid' => $storeId,'wid' => $websiteId);
339
 
340
  $finalUrl_disabled = $feedUrl.'/disabled';
341
  // $logger->log("final disabled url is : ".$finalUrl_disabled);
373
  $logger->log("product # ".$producttId." is out_of_stock for store # ".$storeId);
374
 
375
  $qty = $productt->getData('qty');
376
+ $stock_array = array('qty' => $qty,'entity_id' => $producttId,'is_in_stock'=>0,'sid' => $storeId,'wid' => $websiteId);
377
 
378
  $finalUrl_stock = $feedUrl.'/stock';
379
  // $logger->log("final stock url is : ".$finalUrl_stock);
422
  $resultArray = Mage::getSingleton('expertrec_recommendation/feed_formatter')
423
  ->init()
424
  ->prepareRow($header,$selectedProduct);
425
+ $resultArray['sid'] = $storeId;
426
+ $resultArray['wid'] = $websiteId;
427
+ $resultArray['type'] = $selectedProduct->getTypeId();
428
+
429
+ if($selectedProduct->getTypeId() == 'grouped'){
430
+
431
+ $associatedProducts = $selectedProduct->getTypeInstance(true)->getAssociatedProducts($selectedProduct);
432
+ $associatedProductsIds = array();
433
+ foreach($associatedProducts as $childProduct){
434
+ $associatedProductsIds[] = $childProduct->getId();
435
+ }
436
+ $resultArray['associatedProductsIds'] = $associatedProductsIds;
437
+ }
438
+
439
+
440
+ if($selectedProduct->getTypeId() == 'configurable'){
441
+
442
+ $childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$selectedProduct);
443
+ $associatedProductsIds = array();
444
+ foreach($childProducts as $childProduct){
445
+ $associatedProductsIds[] = $childProduct->getId();
446
+ }
447
+ $resultArray['associatedProductsIds'] = $associatedProductsIds;
448
+ }
449
 
450
+ if($selectedProduct->getTypeId() == 'bundle'){
451
+
452
+ $childProducts = $selectedProduct->getTypeInstance(true)->getSelectionsCollection($selectedProduct->getTypeInstance(true)->getOptionsIds($selectedProduct), $selectedProduct);
453
+
454
+ $associatedProductsIds = array();
455
+ foreach($childProducts as $childProduct) {
456
+ $associatedProductsIds[] = $childProduct->getId();
457
+ }
458
+ $resultArray['associatedProductsIds'] = $associatedProductsIds;
459
+ }
460
+
461
+ $logger->log("product # ".$productId." has valid data for store # ".$storeId);
462
  // $logger->log(print_r($resultArray,1));
463
 
464
  $finalUrl = $feedUrl.'/product';
515
  $logger = Mage::getSingleton('expertrec_recommendation/log');
516
  $category = $observer->getEvent()->getCategory();
517
 
518
+ $category_data = $category->getData();
519
+
520
+ $storeId = $category_data['store_id'];
521
+
522
+ $store = Mage::app()->getStore($storeId);
523
+
524
+ $websiteId = $store->getWebsiteId();
525
+
526
+ $category->setStoreId($storeId);
527
 
528
  // get category url
 
529
  $category_url = $store->getBaseUrl().$category->getUrlPath();
530
 
531
+ $category_id = $category->getId();
532
+ $logger->log("saved Category for # ".$category_id);
533
+ $category_name = $category->getName();
534
+
535
  // get path with name
536
  $pathIdArray = explode('/', $category->getPath());
537
+ // $storeId = $store->getId();
538
  $pathNameArray = array();
539
 
540
  for($i=0;$i<count($pathIdArray);$i++){
541
+ $categoryy = Mage::getModel('catalog/category');
542
+ $categoryy->setStoreId($storeId);
543
+ $categoryy->load($pathIdArray[$i]);
544
  $pathNameArray[$i] = $categoryy->getName();
545
  }
546
+ // if($category->getName() == ''){
547
+ // $categoryy = Mage::getModel('catalog/category')->load($category->getId());
548
+ // $category_name = $categoryy->getName();
549
+ // }
550
  //removing Root catalog which is $pathNameArrray[0]
551
+ // array_shift($pathNameArray);
552
  $category_path = implode('/', $pathNameArray);
553
 
554
+ // array_shift($pathIdArray);
555
  $category_id_path = implode('/', $pathIdArray);
556
 
557
+ $categoryArray = array('categoryId' => $category_id,
558
+ 'categoryName' => $category_name,
559
  'categoryIdPath' => $category_id_path,
560
  'categoryNamePath' => $category_path,
561
+ 'categoryUrl' => $category_url,
562
+ 'sid' => $storeId,
563
+ 'wid' => $websiteId);
564
 
565
+ //$logger->log("array ".print_r($categoryArray,1));
566
  // passing category to identify category url
567
  $feedUrl = $this->getFeedEndpoint();
568
  $finalUrl = $feedUrl.'/category';
687
  //return unique product id
688
  $uniqueId = Mage::helper('expertrec_recommendation')->getUniqueId($product);
689
  $ci_id = $_COOKIE['ci_id'];
690
+
691
+ // Gets the current store's details
692
+ $store = Mage::app()->getStore();
693
+
694
+ // Gets the current store's id
695
+ $storeId = Mage::app()->getStore()->getStoreId();
696
+
697
+ // Gets the current website's id
698
+ $websiteId = Mage::app()->getStore()->getWebsiteId();
699
+
700
+ $logger->log("added to Wishlist for product # ".$uniqueId);
701
+ // $logger->log("store_id ".$storeId);
702
+ // $logger->log("website_id ".$websiteId);
703
 
704
  //sending request
705
  //return boolean
710
  'item' => $uniqueId,
711
  'event' => 17,
712
  'sku' => $product->getSku(),
713
+ 'sid' => $storeId,
714
+ 'wid' => $websiteId,
715
  'domain' => $_SERVER['HTTP_HOST'],
716
  'ip' => isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'])
717
 
734
  $item = $observer->getEvent()->getItem();
735
  $item_array = $item->getData();
736
 
737
+
738
  $product_id = $item_array["product_id"];
 
739
 
740
+ $product_stores = Mage::getModel('catalog/product')->load($product_id);
 
741
 
742
+ //Checking for stock details
743
+ $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct( $product_id);
744
+ $qty = $stockItem->getData('qty');
745
+ $inStock = $stockItem->getData('is_in_stock');
746
+ $storeIds = $product_stores->getStoreIds();
747
 
748
+ foreach($storeIds as $storeId){
749
+
750
+ $store = Mage::app()->getStore($storeId);
751
+
752
+ $websiteId = $store->getWebsiteId();
753
+
754
+ //Magento has a default out of stock check, custom quantity can be set
755
+ if ($inStock == 0){
756
+ $logger->log("Out of stock".$product_id);
757
+ $stockArray = array('entity_id' => $product_id, 'qty' => $qty, 'is_in_stock' =>0, 'sid' => $storeId, 'wid'=> $websiteId);
758
+
759
+ $feedUrl = $this->getFeedEndpoint();
760
+ $finalUrl = $feedUrl.'/stock';
761
+ if(empty($finalUrl)){
762
+ return $this;
763
+ }
764
+
765
+ //sending request
766
+ $response = Mage::getModel('expertrec_recommendation/api_request')
767
+ ->setPrepareRequestStatus(false)
768
+ ->setUserId('expertrec')
769
+ ->setUrl($finalUrl)
770
+ ->setMethod(Zend_Http_Client::POST)
771
+ ->setData($stockArray)
772
+ ->setHeader("Content-Type",'application/json')
773
+ ->setPrepareRequestStatus(true)
774
+ ->sendRequest();
775
+
776
+ $mid = Mage::getStoreConfig(self::MERCHANT_ID);
777
+ $feedUrl = "https://feed.expertrec.com/magento/n01eba6261ad7f174cd3a16523e86e65/";
778
+ $finalUrl = $feedUrl.''.$mid.'/stock';
779
+
780
+ //sending request
781
+ $response = Mage::getModel('expertrec_recommendation/api_request')
782
+ ->setPrepareRequestStatus(false)
783
+ ->setUserId('expertrec')
784
+ ->setUrl($finalUrl)
785
+ ->setMethod(Zend_Http_Client::POST)
786
+ ->setData($stockArray)
787
+ ->setHeader("Content-Type",'application/json')
788
+ ->setPrepareRequestStatus(true)
789
+ ->sendRequest();
790
+
791
+ // $logger->log('SUCCESS : request made for stock status with Id #'.$product_id);
792
+ if(!$response) {
793
+ $logger->log('request failed for stock status with Id #'.$product_id);
794
+ }
795
  }
796
  }
797
 
 
798
  }
799
 
800
 
app/code/community/Expertrec/Recommendation/controllers/ApiController.php CHANGED
@@ -26,8 +26,8 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
26
  const CONFIG_SECRET = 'expertrec/general/secret';
27
  const PUSHED_FEED_PAGES = 'expertrec/general/expertrec_feed_pushed_pages';
28
 
29
- const BUILD_NO = "1495462844";
30
- const EXPERTREC_VERSION = "1.2.19";
31
  private $_password;
32
  private $_storeId = array();
33
 
@@ -786,6 +786,8 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
786
  $mid = Mage::getStoreConfig(self::MERCHANT_ID);
787
  $secret = Mage::getStoreConfig(self::CONFIG_SECRET);
788
 
 
 
789
  // checking mid set/not
790
  if($mid == "new_user"){
791
 
@@ -811,15 +813,15 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
811
  $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
812
  $siteArray['currencyRates'] = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));
813
 
814
- $apiUrl = "http://magento.expertrec.com/20ff3ab58c9cd8ad52e24501cc46c84c/getSecretMid";
815
  try{
816
  // send request
817
  $request = new Zend_Http_Client();
818
  $request->setUri($apiUrl)
819
  ->setHeaders("Content-Type",'application/json')
820
  ->setMethod(Zend_Http_Client::GET)
821
- ->setParameterGet($siteArray)
822
- ->setConfig(array('timeout' => 1));
823
 
824
  //response with mid and secret
825
  $response = $request->request();
@@ -838,6 +840,7 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
838
  }
839
  catch (Zend_Http_Client_Exception $e) {
840
  $this->logger()->log('Pull-Feed : ERROR : '.sprintf($apiUrl .' Failed to create mid&secret because HTTP error: %s ', $e->getMessage()),Zend_Log::ERR);
 
841
  }
842
  }
843
  else{
@@ -868,8 +871,8 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
868
  $request = new Zend_Http_Client();
869
  $request->setUri($finalUrl)
870
  ->setHeaders("Content-Type",'application/json')
871
- ->setMethod(Zend_Http_Client::GET)
872
- ->setConfig(array('timeout' => 1));
873
 
874
  //response with mid and secret
875
  $response = $request->request();
@@ -974,23 +977,23 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
974
  $this->printLog('Pull-Feed : getCurrency : Started currency','',$debug);
975
 
976
  try{
 
 
 
 
977
 
978
- $baseCurrency = Mage::app()->getStore()->getBaseCurrencyCode();
979
- $currCurrency = Mage::app()->getStore()->getCurrentCurrencyCode();
980
-
981
- $this->printLog('Pull-Feed : getCurrency : Collecting currency info ','',$debug);
982
-
983
- $baseCurrencyCode = Mage::app()->getBaseCurrencyCode();
984
-
985
- $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
986
- $allCurrencyRates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));
987
-
988
- $this->printLog('Pull-Feed : getCurrency : Collecting all currency rates ','',$debug);
989
 
990
- $array_currency = array(
991
- 'baseCurrency' => $baseCurrency,
992
- 'currCurrency' => $currCurrency,
993
- 'currencyRates' => $allCurrencyRates);
 
994
 
995
  // $this->logger()->log('currency '.print_r($array_currency,1));
996
  $finalurl = $finalUrl.'currency';
@@ -1032,34 +1035,88 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
1032
  try{
1033
 
1034
  $finalurl = $finalUrl.'all_categories';
1035
-
1036
- $category = Mage::getModel('catalog/category');
1037
- $tree = $category->getTreeModel();
1038
- $tree->load();
1039
- $ids = $tree->getCollection()->getAllIds();
1040
 
1041
- $this->printLog('Pull-Feed : getCategories : Collecting tree of category id ','',$debug);
 
1042
 
1043
- if ($ids){
1044
 
1045
- $this->printLog('Pull-Feed : getCategories : If the ids are not null, then iterate','',$debug);
1046
 
1047
- for($i=0;$i<count($ids);$i++){
1048
 
1049
- $id = $ids[$i];
1050
- $cat = Mage::getModel('catalog/category');
1051
- $cat->load($id);
1052
 
1053
- $this->printLog('Pull-Feed : getCategories : Collecting catagory name and info for id # ',$id,$debug);
 
1054
 
1055
- $entity_id = $cat->getId();
1056
- $name = $cat->getName();
1057
- $url_key = $cat->getUrlKey();
1058
- $url_path = $cat->getUrlPath();
1059
- $catarr['cat_id'] = $entity_id;
1060
- $catarr['cat_name'] = $name;
1061
-
1062
- $pathIdArray = explode('/', $cat->getPath());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1063
  $pathNameArray = array();
1064
 
1065
  for($j=0;$j<count($pathIdArray);$j++){
@@ -1069,11 +1126,13 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
1069
  }
1070
 
1071
  $category_id_path = implode(chr(3), $pathIdArray);
1072
- $catarr['cat_id_path'] = $category_id_path;
1073
  $category_path = implode(chr(3), $pathNameArray);
1074
- $catarr['cat_name_path'] = $category_path;
 
 
1075
 
1076
- // $this->logger()->log('result-array '.print_r($catarr,1));
1077
  $this->printLog('Pull-Feed : getCategories : Send the category info to endpoint as ',$finalurl,$debug);
1078
 
1079
  // sending request
@@ -1088,15 +1147,14 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
1088
  ->sendRequest();
1089
 
1090
  if(!$response) {
1091
- $this->logger()->log('Pull-Feed : ERROR : Request failed for all_categories with category # '.$id);
1092
  }
1093
  else{
1094
- $this->printLog('Pull-Feed : getCategories : Request with all_categories sent successfully for category # ',$id,$debug);
1095
  }
1096
  }
1097
- $this->logger()->log('Pull-Feed : Request with all_categories sent successfully ');
1098
  }
1099
-
1100
  }catch (Exception $e) {
1101
  $this->logger()->log('Pull-Feed : ERROR : Exception on collecting all_categories '.$e->getMessage());
1102
  }
@@ -1119,10 +1177,14 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
1119
  $feedConfig = Mage::getSingleton('expertrec_recommendation/feed_feedconfig');
1120
 
1121
  foreach ($this->_storeId as $storeId) {
1122
- $array = array();
1123
 
1124
  $this->printLog('Pull-Feed : getPopularQueries : Collecting popular_queries for store # ',$storeId,$debug);
1125
 
 
 
 
 
1126
  $collection = Mage::getResourceModel('catalogsearch/query_collection')
1127
  ->addStoreFilter($storeId)
1128
  ->setStoreId($storeId);
@@ -1130,18 +1192,25 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
1130
 
1131
  foreach ($collection as $suggestion) {
1132
  $value = $suggestion->getData();
1133
- $array[] = $value;
1134
  }
1135
 
1136
  $this->printLog('Pull-Feed : getPopularQueries : Send popular_queries info to endpoint as ',$finalurl,$debug);
1137
 
 
 
 
 
 
 
 
1138
  // sending request
1139
  $response = Mage::getModel('expertrec_recommendation/api_request')
1140
  ->setPrepareRequestStatus(false)
1141
  ->setUserId('expertrec')
1142
  ->setUrl($finalurl)
1143
  ->setMethod(Zend_Http_Client::POST)
1144
- ->setData($array)
1145
  ->setHeader("Content-Type",'application/json')
1146
  ->setPrepareRequestStatus(true)
1147
  ->sendRequest();
@@ -1305,9 +1374,44 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
1305
 
1306
  $this->printLog('Pull-Feed : getFeedData : Collecting info of product_id # ',$product->getId(),$debug);
1307
 
 
 
1308
  $resultArray = $formatter->prepareRow($header,$product);
1309
- $resultArray['storeId'] = $storeId;
1310
- $resultArray['websiteId'] = $websiteId;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1311
  // $this->logger()->log('res '.print_r($resultArray,1));
1312
 
1313
  $this->printLog('Pull-Feed : getFeedData : Send request to endpoint as ',$finalurl,$debug);
26
  const CONFIG_SECRET = 'expertrec/general/secret';
27
  const PUSHED_FEED_PAGES = 'expertrec/general/expertrec_feed_pushed_pages';
28
 
29
+ const BUILD_NO = "1496109923";
30
+ const EXPERTREC_VERSION = "1.2.20";
31
  private $_password;
32
  private $_storeId = array();
33
 
786
  $mid = Mage::getStoreConfig(self::MERCHANT_ID);
787
  $secret = Mage::getStoreConfig(self::CONFIG_SECRET);
788
 
789
+ $data = array('merchantid' => $mid, 'secret' => $secret );
790
+
791
  // checking mid set/not
792
  if($mid == "new_user"){
793
 
813
  $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
814
  $siteArray['currencyRates'] = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));
815
 
816
+ $apiUrl = "https://magento.expertrec.com/20ff3ab58c9cd8ad52e24501cc46c84c/getSecretMid";
817
  try{
818
  // send request
819
  $request = new Zend_Http_Client();
820
  $request->setUri($apiUrl)
821
  ->setHeaders("Content-Type",'application/json')
822
  ->setMethod(Zend_Http_Client::GET)
823
+ ->setParameterGet($siteArray);
824
+ // ->setConfig(array('timeout' => 1));
825
 
826
  //response with mid and secret
827
  $response = $request->request();
840
  }
841
  catch (Zend_Http_Client_Exception $e) {
842
  $this->logger()->log('Pull-Feed : ERROR : '.sprintf($apiUrl .' Failed to create mid&secret because HTTP error: %s ', $e->getMessage()),Zend_Log::ERR);
843
+ die("Cant able to set mid & secret");
844
  }
845
  }
846
  else{
871
  $request = new Zend_Http_Client();
872
  $request->setUri($finalUrl)
873
  ->setHeaders("Content-Type",'application/json')
874
+ ->setMethod(Zend_Http_Client::GET);
875
+ // ->setConfig(array('timeout' => 1));
876
 
877
  //response with mid and secret
878
  $response = $request->request();
977
  $this->printLog('Pull-Feed : getCurrency : Started currency','',$debug);
978
 
979
  try{
980
+ $websites = Mage::app()->getWebsites();
981
+ $array_currency = array();
982
+ foreach ($websites as $website) {
983
+ $websiteId = $website->getId();
984
 
985
+ $storeIds = $website->getStoreIds();
986
+ foreach ($storeIds as $storeId){
987
+
988
+ $baseCurrencyCode = Mage::app()->getWebsite($websiteId)->getBaseCurrencyCode();
989
+ $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
990
+ $allCurrencyRates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));
 
 
 
 
 
991
 
992
+ $this->printLog('Pull-Feed : getCurrency : Collecting currency info for website #',$websiteId,$debug);
993
+
994
+ $array_currency[]=array('wid' => $websiteId, 'sid' => $storeId, 'baseCurrency' => $baseCurrencyCode, 'currencyRates' => $allCurrencyRates);
995
+ }
996
+ }
997
 
998
  // $this->logger()->log('currency '.print_r($array_currency,1));
999
  $finalurl = $finalUrl.'currency';
1035
  try{
1036
 
1037
  $finalurl = $finalUrl.'all_categories';
 
 
 
 
 
1038
 
1039
+ //Iterating over stores, as category tree is dependent on store
1040
+ foreach ($this->_storeId as $storeId) {
1041
 
1042
+ $this->printLog('Pull-Feed : getCategories : Collecting categories for store # ',$storeId,$debug);
1043
 
1044
+ $rootCategoryId = Mage::app()->getStore($storeId)->getRootCategoryId();
1045
 
1046
+ $root_category = Mage::getModel('catalog/category')->load($rootCategoryId);
1047
 
1048
+ $catarr['categoryId'] = $root_category->getId();
1049
+ $catarr['categoryName'] = $root_category->getName();
1050
+ // $category_id_path = $category->getPath();
1051
 
1052
+ $store = Mage::app()->getStore($storeId);
1053
+ $category_url = $store->getBaseUrl().$root_category->getUrlPath();
1054
 
1055
+ $catarr['categoryUrl'] = $category_url;
1056
+
1057
+ //Fetching website details from storeId
1058
+ $store = Mage::app()->getStore($storeId);
1059
+ $websiteId = $store->getWebsiteId();
1060
+
1061
+ $this->printLog('Pull-Feed : getCategories : Collecting root_catagory name and info for cat_id # ',$catarr['cat_id'],$debug);
1062
+
1063
+ $pathIdArray = explode('/', $root_category->getPath());
1064
+ $pathNameArray = array();
1065
+
1066
+ for($j=0;$j<count($pathIdArray);$j++){
1067
+ $categoryy=Mage::getModel('catalog/category')->load($pathIdArray[$j]);
1068
+ $pathNameArray[$j] = $categoryy->getName();
1069
+ }
1070
+
1071
+ $category_id_path = implode(chr(3), $pathIdArray);
1072
+ $catarr['categoryIdPath'] = $category_id_path;
1073
+ $category_path = implode(chr(3), $pathNameArray);
1074
+ $catarr['categoryNamePath'] = $category_path;
1075
+ $catarr['sid'] = $storeId;
1076
+ $catarr['wid'] = $websiteId;
1077
+
1078
+ //$this->logger()->log("catarr ".print_r($catarr,1));
1079
+
1080
+ $this->printLog('Pull-Feed : getCategories : Send the category info to endpoint as ',$finalurl,$debug);
1081
+
1082
+ // sending request
1083
+ $response = Mage::getModel('expertrec_recommendation/api_request')
1084
+ ->setPrepareRequestStatus(false)
1085
+ ->setUserId('expertrec')
1086
+ ->setUrl($finalurl)
1087
+ ->setMethod(Zend_Http_Client::POST)
1088
+ ->setData($catarr)
1089
+ ->setHeader("Content-Type",'application/json')
1090
+ ->setPrepareRequestStatus(true)
1091
+ ->sendRequest();
1092
+
1093
+ if(!$response) {
1094
+ $this->logger()->log('Pull-Feed : ERROR : Request failed for all_categories with category # '.$catarr['cat_id']);
1095
+ }
1096
+ else{
1097
+ $this->printLog('Pull-Feed : getCategories : Request with all_categories sent successfully for category # ',$catarr['cat_id'],$debug);
1098
+ }
1099
+
1100
+ $categories = Mage::getModel('catalog/category')
1101
+ ->getCollection()
1102
+ ->setStoreId($storeId)
1103
+ ->addFieldToFilter('is_active', 1)
1104
+ ->addAttributeToFilter('path', array('like' => "1/{$rootCategoryId}/%"))
1105
+ ->addAttributeToSelect('*');
1106
+
1107
+ foreach($categories as $category){
1108
+ $catarr=array();
1109
+ $catarr['categoryId'] = $category->getId();
1110
+ $catarr['categoryName'] = $category->getName();
1111
+
1112
+ $category_url = $store->getBaseUrl().$category->getUrlPath();
1113
+
1114
+ $catarr['categoryUrl'] = $category_url;
1115
+ // $category_id_path = $category->getPath();
1116
+
1117
+ $this->printLog('Pull-Feed : getCategories : Collecting catagory name and info for cat_id # ',$catarr['cat_id'],$debug);
1118
+
1119
+ $pathIdArray = explode('/', $category->getPath());
1120
  $pathNameArray = array();
1121
 
1122
  for($j=0;$j<count($pathIdArray);$j++){
1126
  }
1127
 
1128
  $category_id_path = implode(chr(3), $pathIdArray);
1129
+ $catarr['categoryIdPath'] = $category_id_path;
1130
  $category_path = implode(chr(3), $pathNameArray);
1131
+ $catarr['categoryNamePath'] = $category_path;
1132
+ $catarr['wid'] = $websiteId;
1133
+ $catarr['sid'] = $storeId;
1134
 
1135
+ //$this->logger()->log('result-array '.print_r($catarr,1));
1136
  $this->printLog('Pull-Feed : getCategories : Send the category info to endpoint as ',$finalurl,$debug);
1137
 
1138
  // sending request
1147
  ->sendRequest();
1148
 
1149
  if(!$response) {
1150
+ $this->logger()->log('Pull-Feed : ERROR : Request failed for all_categories with category # '.$catarr['cat_id']);
1151
  }
1152
  else{
1153
+ $this->printLog('Pull-Feed : getCategories : Request with all_categories sent successfully for category # ',$catarr['cat_id'],$debug);
1154
  }
1155
  }
 
1156
  }
1157
+ $this->logger()->log('Pull-Feed : Request with all_categories sent successfully ');
1158
  }catch (Exception $e) {
1159
  $this->logger()->log('Pull-Feed : ERROR : Exception on collecting all_categories '.$e->getMessage());
1160
  }
1177
  $feedConfig = Mage::getSingleton('expertrec_recommendation/feed_feedconfig');
1178
 
1179
  foreach ($this->_storeId as $storeId) {
1180
+ $queryArray = array();
1181
 
1182
  $this->printLog('Pull-Feed : getPopularQueries : Collecting popular_queries for store # ',$storeId,$debug);
1183
 
1184
+ //Fetching website details from storeId
1185
+ $store = Mage::app()->getStore($storeId);
1186
+ $websiteId = $store->getWebsiteId();
1187
+
1188
  $collection = Mage::getResourceModel('catalogsearch/query_collection')
1189
  ->addStoreFilter($storeId)
1190
  ->setStoreId($storeId);
1192
 
1193
  foreach ($collection as $suggestion) {
1194
  $value = $suggestion->getData();
1195
+ $queryArray[] = $value;
1196
  }
1197
 
1198
  $this->printLog('Pull-Feed : getPopularQueries : Send popular_queries info to endpoint as ',$finalurl,$debug);
1199
 
1200
+ //Creating an associative array to hold the data
1201
+ $queriesArray = array();
1202
+ $queriesArray['wid'] = $websiteId;
1203
+ $queriesArray['sid'] = $storeId;
1204
+ $queriesArray['query'] = $queryArray;
1205
+
1206
+ // $this->logger()->log("query ".print_r($queriesArray,1));
1207
  // sending request
1208
  $response = Mage::getModel('expertrec_recommendation/api_request')
1209
  ->setPrepareRequestStatus(false)
1210
  ->setUserId('expertrec')
1211
  ->setUrl($finalurl)
1212
  ->setMethod(Zend_Http_Client::POST)
1213
+ ->setData($queriesArray)
1214
  ->setHeader("Content-Type",'application/json')
1215
  ->setPrepareRequestStatus(true)
1216
  ->sendRequest();
1374
 
1375
  $this->printLog('Pull-Feed : getFeedData : Collecting info of product_id # ',$product->getId(),$debug);
1376
 
1377
+ $product->setStoreId($storeId);
1378
+
1379
  $resultArray = $formatter->prepareRow($header,$product);
1380
+ $resultArray['sid'] = $storeId;
1381
+ $resultArray['wid'] = $websiteId;
1382
+ $resultArray['type'] = $product->getTypeId();
1383
+
1384
+ if($product->getTypeId() == 'grouped'){
1385
+
1386
+ $associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
1387
+ $associatedProductsIds = array();
1388
+ foreach($associatedProducts as $childProduct){
1389
+ $associatedProductsIds[] = $childProduct->getId();
1390
+ }
1391
+ $resultArray['associatedProductsIds'] = $associatedProductsIds;
1392
+ }
1393
+
1394
+
1395
+ if($product->getTypeId() == 'configurable'){
1396
+
1397
+ $childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$product);
1398
+ $associatedProductsIds = array();
1399
+ foreach($childProducts as $childProduct){
1400
+ $associatedProductsIds[] = $childProduct->getId();
1401
+ }
1402
+ $resultArray['associatedProductsIds'] = $associatedProductsIds;
1403
+ }
1404
+
1405
+ if($product->getTypeId() == 'bundle'){
1406
+
1407
+ $childProducts = $product->getTypeInstance(true)->getSelectionsCollection($product->getTypeInstance(true)->getOptionsIds($product), $product);
1408
+
1409
+ $associatedProductsIds = array();
1410
+ foreach($childProducts as $childProduct) {
1411
+ $associatedProductsIds[] = $childProduct->getId();
1412
+ }
1413
+ $resultArray['associatedProductsIds'] = $associatedProductsIds;
1414
+ }
1415
  // $this->logger()->log('res '.print_r($resultArray,1));
1416
 
1417
  $this->printLog('Pull-Feed : getFeedData : Send request to endpoint as ',$finalurl,$debug);
app/code/community/Expertrec/Recommendation/controllers/IndexController.php CHANGED
@@ -152,7 +152,8 @@
152
  header('Expires: 0');
153
  header('Cache-Control: must-revalidate, post-check=0,pre-check=0');
154
  header('Content-Description: File Transfer');
155
- header("Content-Type: application/octet-stream");
 
156
  header('Pragma: public');
157
  header("Content-Length:".filesize($attachment_location));
158
  header("Content-Disposition: attachment; filename=".$fileName);
152
  header('Expires: 0');
153
  header('Cache-Control: must-revalidate, post-check=0,pre-check=0');
154
  header('Content-Description: File Transfer');
155
+ // header("Content-Type: application/octet-stream");
156
+ header("Content-Type: text/plain");
157
  header('Pragma: public');
158
  header("Content-Length:".filesize($attachment_location));
159
  header("Content-Disposition: attachment; filename=".$fileName);
app/code/community/Expertrec/Recommendation/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Expertrec_Recommendation>
5
- <version>1.2.19</version>
6
  </Expertrec_Recommendation>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Expertrec_Recommendation>
5
+ <version>1.2.20</version>
6
  </Expertrec_Recommendation>
7
  </modules>
8
  <global>
app/code/community/Expertrec/Recommendation/sql/expertrec_setup/{mysql4-install-1.2.19.php → mysql4-install-1.2.20.php} RENAMED
@@ -11,7 +11,7 @@
11
 
12
  $mage_ver = Mage::getVersion();
13
  $php_ver = phpversion();
14
- $expertrec_version = "1.2.19";
15
 
16
  $installer->startSetup();
17
 
11
 
12
  $mage_ver = Mage::getVersion();
13
  $php_ver = phpversion();
14
+ $expertrec_version = "1.2.20";
15
 
16
  $installer->startSetup();
17
 
app/code/community/Expertrec/Recommendation/sql/expertrec_setup/{mysql4-upgrade-1.2.18-1.2.19.php → mysql4-upgrade-1.2.19-1.2.20.php} RENAMED
@@ -11,7 +11,7 @@
11
 
12
  $mage_ver = Mage::getVersion();
13
  $php_ver = phpversion();
14
- $expertrec_version = "1.2.19";
15
 
16
  $installer->startSetup();
17
 
11
 
12
  $mage_ver = Mage::getVersion();
13
  $php_ver = phpversion();
14
+ $expertrec_version = "1.2.20";
15
 
16
  $installer->startSetup();
17
 
app/design/frontend/base/default/template/expertrec/recommendation/tracker.phtml CHANGED
@@ -16,6 +16,8 @@
16
  ?>
17
  if(typeof expertSiteConf == 'undefined' || expertSiteConf == null) {
18
  var expertSiteConf = {
 
 
19
  currency: "<?php echo Mage::app()->getStore()->getCurrentCurrencyCode(); ?>",
20
  formkey:"<?php echo $formKey; ?>"
21
  <?php if (isset($category)) { ?>
@@ -24,9 +26,10 @@
24
  };
25
  }
26
  window.expertrecconf = {
 
27
  merchantId:"<?php echo Mage::getStoreConfig('expertrec/general/mid');?>",
28
- webId:"<?php echo Mage::app()->getWebsite()->getId();?>",
29
- storeId: "<?php echo Mage::app()->getStore()->getId(); ?>",
30
  currency: "<?php echo Mage::app()->getStore()->getCurrentCurrencyCode(); ?>",
31
  currency_rate: "<?php echo Mage::app()->getStore()->getCurrentCurrencyRate(); ?>"};
32
 
16
  ?>
17
  if(typeof expertSiteConf == 'undefined' || expertSiteConf == null) {
18
  var expertSiteConf = {
19
+ wid:"<?php echo Mage::app()->getWebsite()->getId();?>",
20
+ sid: "<?php echo Mage::app()->getStore()->getId(); ?>",
21
  currency: "<?php echo Mage::app()->getStore()->getCurrentCurrencyCode(); ?>",
22
  formkey:"<?php echo $formKey; ?>"
23
  <?php if (isset($category)) { ?>
26
  };
27
  }
28
  window.expertrecconf = {
29
+ formkey:"<?php echo $formKey; ?>",
30
  merchantId:"<?php echo Mage::getStoreConfig('expertrec/general/mid');?>",
31
+ wid:"<?php echo Mage::app()->getWebsite()->getId();?>",
32
+ sid: "<?php echo Mage::app()->getStore()->getId(); ?>",
33
  currency: "<?php echo Mage::app()->getStore()->getCurrentCurrencyCode(); ?>",
34
  currency_rate: "<?php echo Mage::app()->getStore()->getCurrentCurrencyRate(); ?>"};
35
 
app/design/frontend/base/default/template/expertrec/recommendation/tracking/product.phtml CHANGED
@@ -3,6 +3,7 @@
3
  <?php $product = Mage::registry('current_product');
4
  if (isset($product)) { ?>
5
  expertSiteConf["pid"] = "<?php echo Mage::helper('expertrec_recommendation')->getUniqueId($product); ?>";
 
6
  <?php } ?>
7
  (function(){
8
  var pid = expertSiteConf.pid ? expertSiteConf.pid : window.location.href;
3
  <?php $product = Mage::registry('current_product');
4
  if (isset($product)) { ?>
5
  expertSiteConf["pid"] = "<?php echo Mage::helper('expertrec_recommendation')->getUniqueId($product); ?>";
6
+ expertrecconf["pid"] = "<?php echo Mage::helper('expertrec_recommendation')->getUniqueId($product); ?>";
7
  <?php } ?>
8
  (function(){
9
  var pid = expertSiteConf.pid ? expertSiteConf.pid : window.location.href;
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Expertrec_Recommendation</name>
4
- <version>1.2.19</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Expertrec search extension helps you have complete control over your site search results. You will be able to add instant autocomplete, spell corrections that learn from the user behaviour on your site, and show product recommendations within the search user interface. It also adds search results pages with facets, sorting by different attributes.</description>
11
  <notes>Expertrec Recommendation plugin for magento sites.</notes>
12
  <authors><author><name>melchi</name><user>melchi</user><email>magento@cloudinfra.in</email></author><author><name>magento</name><user>magento</user><email>magento-team@cloudinfra.in</email></author></authors>
13
- <date>2017-05-22</date>
14
- <time>14:22:01</time>
15
- <contents><target name="magecommunity"><dir name="Expertrec"><dir name="Recommendation"><dir name="Block"><file name="Api.php" hash="e7997269c80ea4c7bc24ad67f843ca00"/><file name="Popularqueries.php" hash="5e305e1b2fc913e8eae6d8c540a02b60"/></dir><dir name="Helper"><file name="Autocompletehelper.php" hash="2a4f4202f7414158764a8e05cbefd596"/><file name="Data.php" hash="7e3728b4efa9ee373f73878a6a665528"/><file name="Filehelper.php" hash="f0deaedcbef965a14b905aea7946d533"/><dir name="Search"><file name="Layout.php" hash="6b0681539b719913caa5107a16ba8549"/></dir><file name="Suggestionhelper.php" hash="9316b6a6412961fbcd05d5a33dc23bcd"/></dir><dir name="Model"><dir name="Api"><file name="Request.php" hash="cd9a43c25e5251df1af848d6a8d371fb"/></dir><dir name="Feed"><file name="Feedconfig.php" hash="77a806249b1a64a5e0e83d010f835130"/><file name="Feedcreator.php" hash="e32cb528c8fb5085adfa06aaae9a92a7"/><file name="Feedfilter.php" hash="46f355afbd085ff796ea1c16e030bbec"/><file name="Formatter.php" hash="56659f46e253ade747ac54fd46ccc5b4"/></dir><file name="Feed.php" hash="3ddfbd9ba5d9845d1d546581a9f71701"/><file name="Log.php" hash="a96f0a142abc0a2c49e8134599d1eb93"/><file name="Observer.php" hash="ff50a621b1c3e52c989a7cbf619959ac"/><dir name="Translator"><file name="Category.php" hash="a1d8248562da426aab2ca319cebbb3c9"/></dir><file name="Validate.php" hash="c4be906568d7e10e51e6a4a42541bf5c"/><dir name="Writer"><file name="Abstract.php" hash="cafb19a4f943e200b775caec92bebd93"/><file name="Csv.php" hash="27d3188526f885de87b882d196a16c6d"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="4aec75bacab301a25c34bc2eecb57bcf"/></dir><file name="ApiController.php" hash="155ca10f6599d8e30e4dbe46f74928fc"/><dir name="CatalogSearch"><file name="ResultController.php" hash="e740f44c0cef4aa83545f2278626e7de"/></dir><file name="ConfigController.php" hash="07af2da00256ce6ab54a98b2980ea348"/><file name="IndexController.php" hash="842d75f0f36821bf930c46230ff85f6c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="4d5ac7be55302f8555d5b3191e8cb70d"/><file name="config.xml" hash="cdf627cb24abd70ea10c20a75f576d80"/></dir><dir name="sql"><dir name="expertrec_setup"><file name="mysql4-install-1.2.19.php" hash="f69bc4933d4cce73f31e6f477e3984ca"/><file name="mysql4-upgrade-1.2.18-1.2.19.php" hash="24bd898de55a5d6e9bfb2fee567856c5"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Expertrec_Recommendation.xml" hash="c314465f907c89dfe912035be8d48e71"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="expertrec"><file name="recommendation.xml" hash="371adcaac50e40e1abba2b41cd598bf8"/></dir></dir><dir name="template"><dir name="expertrec"><dir name="feed"><file name="info.phtml" hash="a41d86f3cc01eb09a7dab6da3b203612"/></dir><dir name="page"><dir name="html"><file name="sterms.phtml" hash="c4de444a084eb1c03ce2c92bb8f6d875"/></dir></dir><dir name="recommendation"><file name="tracker.phtml" hash="a80415bee05d71184583b3346343a4fb"/><dir name="tracking"><file name="product.phtml" hash="3dda590a1cdfb25461fbdecd0b548860"/></dir></dir><dir name="search"><file name="custom.phtml" hash="b1bccc7ed9a04472add4192e05dcca24"/><file name="list.phtml" hash="9ff42c7a725ecab6274b1ab768fed95b"/><file name="view.phtml" hash="f86df8e975bf5bfb7733b85655f1911c"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="expertrec"><file name="recommendation.xml" hash="640762ea93c7657975314b8282f53498"/></dir></dir><dir name="template"><dir name="expertrec"><dir name="recommendation"><file name="notifications.phtml" hash="f264dfe05d0fd53c754a071a28cd415c"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Expertrec_Recommendation</name>
4
+ <version>1.2.20</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
10
  <description>Expertrec search extension helps you have complete control over your site search results. You will be able to add instant autocomplete, spell corrections that learn from the user behaviour on your site, and show product recommendations within the search user interface. It also adds search results pages with facets, sorting by different attributes.</description>
11
  <notes>Expertrec Recommendation plugin for magento sites.</notes>
12
  <authors><author><name>melchi</name><user>melchi</user><email>magento@cloudinfra.in</email></author><author><name>magento</name><user>magento</user><email>magento-team@cloudinfra.in</email></author></authors>
13
+ <date>2017-05-30</date>
14
+ <time>14:07:06</time>
15
+ <contents><target name="magecommunity"><dir name="Expertrec"><dir name="Recommendation"><dir name="Block"><file name="Api.php" hash="e7997269c80ea4c7bc24ad67f843ca00"/><file name="Popularqueries.php" hash="5e305e1b2fc913e8eae6d8c540a02b60"/></dir><dir name="Helper"><file name="Autocompletehelper.php" hash="2a4f4202f7414158764a8e05cbefd596"/><file name="Data.php" hash="7e3728b4efa9ee373f73878a6a665528"/><file name="Filehelper.php" hash="f0deaedcbef965a14b905aea7946d533"/><dir name="Search"><file name="Layout.php" hash="6b0681539b719913caa5107a16ba8549"/></dir><file name="Suggestionhelper.php" hash="9316b6a6412961fbcd05d5a33dc23bcd"/></dir><dir name="Model"><dir name="Api"><file name="Request.php" hash="e33377d5c0d1badc289718de06c080cb"/></dir><dir name="Feed"><file name="Feedconfig.php" hash="77a806249b1a64a5e0e83d010f835130"/><file name="Feedcreator.php" hash="e32cb528c8fb5085adfa06aaae9a92a7"/><file name="Feedfilter.php" hash="46f355afbd085ff796ea1c16e030bbec"/><file name="Formatter.php" hash="fc0bb8bdb091e6efd33433d0be17c779"/></dir><file name="Feed.php" hash="3ddfbd9ba5d9845d1d546581a9f71701"/><file name="Log.php" hash="a96f0a142abc0a2c49e8134599d1eb93"/><file name="Observer.php" hash="90afbcc8db2ef4b97b921112af253e78"/><dir name="Translator"><file name="Category.php" hash="a1d8248562da426aab2ca319cebbb3c9"/></dir><file name="Validate.php" hash="c4be906568d7e10e51e6a4a42541bf5c"/><dir name="Writer"><file name="Abstract.php" hash="cafb19a4f943e200b775caec92bebd93"/><file name="Csv.php" hash="27d3188526f885de87b882d196a16c6d"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="4aec75bacab301a25c34bc2eecb57bcf"/></dir><file name="ApiController.php" hash="e836b1931a22f50d7350ed2cac334ca4"/><dir name="CatalogSearch"><file name="ResultController.php" hash="e740f44c0cef4aa83545f2278626e7de"/></dir><file name="ConfigController.php" hash="07af2da00256ce6ab54a98b2980ea348"/><file name="IndexController.php" hash="7b7a4da293bd9778324c6b89d71a01ad"/></dir><dir name="etc"><file name="adminhtml.xml" hash="4d5ac7be55302f8555d5b3191e8cb70d"/><file name="config.xml" hash="dc2d93b0563e5dd8fc45b78e3f95dc90"/></dir><dir name="sql"><dir name="expertrec_setup"><file name="mysql4-install-1.2.20.php" hash="e5a86b17f9bcda5325c0e1242fa075ec"/><file name="mysql4-upgrade-1.2.19-1.2.20.php" hash="708a9435eb2843057d87d17fe8043b8c"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Expertrec_Recommendation.xml" hash="c314465f907c89dfe912035be8d48e71"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="expertrec"><file name="recommendation.xml" hash="371adcaac50e40e1abba2b41cd598bf8"/></dir></dir><dir name="template"><dir name="expertrec"><dir name="feed"><file name="info.phtml" hash="a41d86f3cc01eb09a7dab6da3b203612"/></dir><dir name="page"><dir name="html"><file name="sterms.phtml" hash="c4de444a084eb1c03ce2c92bb8f6d875"/></dir></dir><dir name="recommendation"><file name="tracker.phtml" hash="224eb09882eb29efdb16e874273ae2dc"/><dir name="tracking"><file name="product.phtml" hash="22c8a35ae1e546a2fb916fe363c0437d"/></dir></dir><dir name="search"><file name="custom.phtml" hash="b1bccc7ed9a04472add4192e05dcca24"/><file name="list.phtml" hash="9ff42c7a725ecab6274b1ab768fed95b"/><file name="view.phtml" hash="f86df8e975bf5bfb7733b85655f1911c"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="expertrec"><file name="recommendation.xml" hash="640762ea93c7657975314b8282f53498"/></dir></dir><dir name="template"><dir name="expertrec"><dir name="recommendation"><file name="notifications.phtml" hash="f264dfe05d0fd53c754a071a28cd415c"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>