Version Notes
Expertrec Recommendation plugin for magento sites.
Download this release
Release Info
Developer | melchi |
Extension | Expertrec_Recommendation |
Version | 1.2.17 |
Comparing to | |
See all releases |
Code changes from version 1.2.16 to 1.2.17
- app/code/community/Expertrec/Recommendation/Block/Popularqueries.php +71 -0
- app/code/community/Expertrec/Recommendation/Model/Feed/Feedfilter.php +1 -0
- app/code/community/Expertrec/Recommendation/Model/Feed/Formatter.php +5 -1
- app/code/community/Expertrec/Recommendation/Model/Observer.php +176 -55
- app/code/community/Expertrec/Recommendation/controllers/ApiController.php +2 -2
- app/code/community/Expertrec/Recommendation/etc/config.xml +12 -1
- app/code/community/Expertrec/Recommendation/sql/expertrec_setup/{mysql4-install-1.2.16.php → mysql4-install-1.2.17.php} +1 -1
- app/code/community/Expertrec/Recommendation/sql/expertrec_setup/{mysql4-upgrade-1.2.15-1.2.16.php → mysql4-upgrade-1.2.16-1.2.17.php} +1 -1
- app/design/frontend/base/default/layout/expertrec/recommendation.xml +5 -0
- app/design/frontend/base/default/template/expertrec/page/html/sterms.phtml +42 -0
- app/design/frontend/base/default/template/expertrec/recommendation/tracker.phtml +2 -2
- package.xml +4 -4
app/code/community/Expertrec/Recommendation/Block/Popularqueries.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magento.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magento.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_CatalogSearch
|
23 |
+
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Catalogsearch term block
|
29 |
+
*
|
30 |
+
* @category Mage
|
31 |
+
* @package Mage_CatalogSearch
|
32 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
+
*/
|
34 |
+
class Expertrec_Recommendation_Block_Popularqueries extends Mage_CatalogSearch_Block_Term
|
35 |
+
{
|
36 |
+
|
37 |
+
protected function _loadTerms()
|
38 |
+
{
|
39 |
+
if (empty($this->_terms)) {
|
40 |
+
$this->_terms = array();
|
41 |
+
$terms = Mage::getResourceModel('catalogsearch/query_collection')
|
42 |
+
->setPopularQueryFilter(Mage::app()->getStore()->getId())
|
43 |
+
->setPageSize(30)
|
44 |
+
->load()
|
45 |
+
->getItems();
|
46 |
+
|
47 |
+
if( count($terms) == 0 ) {
|
48 |
+
return $this;
|
49 |
+
}
|
50 |
+
|
51 |
+
$this->_maxPopularity = reset($terms)->getPopularity();
|
52 |
+
$this->_minPopularity = end($terms)->getPopularity();
|
53 |
+
$range = $this->_maxPopularity - $this->_minPopularity;
|
54 |
+
$range = ( $range == 0 ) ? 1 : $range;
|
55 |
+
foreach ($terms as $term) {
|
56 |
+
if( !$term->getPopularity() ) {
|
57 |
+
continue;
|
58 |
+
}
|
59 |
+
$term->setRatio(($term->getPopularity()-$this->_minPopularity)/$range);
|
60 |
+
$temp[$term->getName()] = $term;
|
61 |
+
$termKeys[] = $term->getName();
|
62 |
+
}
|
63 |
+
natcasesort($termKeys);
|
64 |
+
|
65 |
+
foreach ($termKeys as $termKey) {
|
66 |
+
$this->_terms[$termKey] = $temp[$termKey];
|
67 |
+
}
|
68 |
+
}
|
69 |
+
return $this;
|
70 |
+
}
|
71 |
+
}
|
app/code/community/Expertrec/Recommendation/Model/Feed/Feedfilter.php
CHANGED
@@ -30,6 +30,7 @@
|
|
30 |
->addAttributeToSelect('*')
|
31 |
->joinTable($catalogInventoryTable, 'product_id=entity_id', $stockfields, null, 'left')
|
32 |
->addCategoryIds()
|
|
|
33 |
// ->addAttributeToFilter('visibility',$visiblityCondition)
|
34 |
->addPriceData(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID, $website->getWebsiteId());
|
35 |
if(in_array('not_visible_individually',$storedFiltersArray) || in_array('visible_catalog',$storedFiltersArray) || in_array('visible_search',$storedFiltersArray) || in_array('visible_catalog_search',$storedFiltersArray) ){
|
30 |
->addAttributeToSelect('*')
|
31 |
->joinTable($catalogInventoryTable, 'product_id=entity_id', $stockfields, null, 'left')
|
32 |
->addCategoryIds()
|
33 |
+
->addUrlRewrite()
|
34 |
// ->addAttributeToFilter('visibility',$visiblityCondition)
|
35 |
->addPriceData(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID, $website->getWebsiteId());
|
36 |
if(in_array('not_visible_individually',$storedFiltersArray) || in_array('visible_catalog',$storedFiltersArray) || in_array('visible_search',$storedFiltersArray) || in_array('visible_catalog_search',$storedFiltersArray) ){
|
app/code/community/Expertrec/Recommendation/Model/Feed/Formatter.php
CHANGED
@@ -43,7 +43,11 @@
|
|
43 |
case 'expert_url':
|
44 |
//$vValue=$product->getProductUrl();
|
45 |
//changing ProductUrl from /index.php/catalog/product/view/id/539/s/racer-back-maxi-dress/ to /index.php/racer-back-maxi-dress.html
|
46 |
-
|
|
|
|
|
|
|
|
|
47 |
$vValue=$url;
|
48 |
break;
|
49 |
case 'qty':
|
43 |
case 'expert_url':
|
44 |
//$vValue=$product->getProductUrl();
|
45 |
//changing ProductUrl from /index.php/catalog/product/view/id/539/s/racer-back-maxi-dress/ to /index.php/racer-back-maxi-dress.html
|
46 |
+
//$url = Mage::getBaseUrl().$product->url_path;
|
47 |
+
//Stripping the parts of the getpayload, only URL needed
|
48 |
+
$url =$product->getUrlInStore(array('_ignore_category' => true));
|
49 |
+
$url = substr($url,0,strpos($url,"?"));
|
50 |
+
//Mage::getSingleton('expertrec_recommendation/log')->log("Getting product url ".$url);
|
51 |
$vValue=$url;
|
52 |
break;
|
53 |
case 'qty':
|
app/code/community/Expertrec/Recommendation/Model/Observer.php
CHANGED
@@ -206,9 +206,16 @@ class Expertrec_Recommendation_Model_Observer {
|
|
206 |
* Method to track save product
|
207 |
*/
|
208 |
public function saveProduct(Varien_Event_Observer $observer){
|
|
|
209 |
$logger = Mage::getSingleton('expertrec_recommendation/log');
|
|
|
|
|
210 |
$product = $observer->getEvent()->getDataObject();
|
211 |
|
|
|
|
|
|
|
|
|
212 |
if (!isset($product) ||
|
213 |
!$product instanceof Mage_Catalog_Model_Product ||
|
214 |
!$product->hasData('entity_id'))
|
@@ -218,6 +225,9 @@ class Expertrec_Recommendation_Model_Observer {
|
|
218 |
}
|
219 |
|
220 |
try{
|
|
|
|
|
|
|
221 |
$storedHeaders = Mage::getStoreConfig(self::CONFIG_HEADERS);
|
222 |
if (isset($storedHeaders)){
|
223 |
$header = explode(',', $storedHeaders);
|
@@ -228,17 +238,25 @@ class Expertrec_Recommendation_Model_Observer {
|
|
228 |
if(!empty($header)){
|
229 |
// passing product to identify product url
|
230 |
$feedUrl = $this->getFeedEndpoint();
|
231 |
-
$finalUrl = $feedUrl.'/product';
|
232 |
-
if(empty($finalUrl)){
|
233 |
-
return $this;
|
234 |
-
}
|
235 |
|
236 |
-
$
|
237 |
-
|
238 |
-
|
|
|
|
|
239 |
|
|
|
|
|
240 |
$productId = $product->getId();
|
241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
$coreResource = Mage::getSingleton("core/resource");
|
243 |
$catalogInventoryTable = method_exists($coreResource, 'getTableName')
|
244 |
? $coreResource->getTableName('cataloginventory_stock_item') : 'cataloginventory_stock_item';
|
@@ -246,60 +264,163 @@ class Expertrec_Recommendation_Model_Observer {
|
|
246 |
"use_config_manage_stock" => "use_config_manage_stock", "is_in_stock" => "is_in_stock");
|
247 |
|
248 |
$collection = Mage::getModel('catalog/product')->getCollection();
|
249 |
-
|
250 |
-
$collection->
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
->
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
}
|
294 |
}
|
295 |
}
|
|
|
296 |
}
|
297 |
}
|
298 |
-
|
299 |
-
$logger->log("SaveCatalogProduct_Track error: ".$e->getMessage());
|
300 |
}
|
301 |
-
|
|
|
302 |
}
|
|
|
|
|
303 |
|
304 |
/**
|
305 |
* Method to track save Category
|
@@ -497,7 +618,7 @@ class Expertrec_Recommendation_Model_Observer {
|
|
497 |
$qty = $item_array["qty"];
|
498 |
|
499 |
if ($qty == 0){
|
500 |
-
$stockArray = array('
|
501 |
|
502 |
$feedUrl = $this->getFeedEndpoint();
|
503 |
$finalUrl = $feedUrl.'/stock';
|
206 |
* Method to track save product
|
207 |
*/
|
208 |
public function saveProduct(Varien_Event_Observer $observer){
|
209 |
+
|
210 |
$logger = Mage::getSingleton('expertrec_recommendation/log');
|
211 |
+
|
212 |
+
//Fetching product
|
213 |
$product = $observer->getEvent()->getDataObject();
|
214 |
|
215 |
+
//Apply rule to get updated price details
|
216 |
+
Mage::getModel('catalogrule/rule')->applyAllRulesToProduct($product);
|
217 |
+
|
218 |
+
//sanity check
|
219 |
if (!isset($product) ||
|
220 |
!$product instanceof Mage_Catalog_Model_Product ||
|
221 |
!$product->hasData('entity_id'))
|
225 |
}
|
226 |
|
227 |
try{
|
228 |
+
//Fetching global out of stock
|
229 |
+
$global_display_out_of_stock = Mage::getStoreConfig('cataloginventory/options/show_out_of_stock');
|
230 |
+
|
231 |
$storedHeaders = Mage::getStoreConfig(self::CONFIG_HEADERS);
|
232 |
if (isset($storedHeaders)){
|
233 |
$header = explode(',', $storedHeaders);
|
238 |
if(!empty($header)){
|
239 |
// passing product to identify product url
|
240 |
$feedUrl = $this->getFeedEndpoint();
|
|
|
|
|
|
|
|
|
241 |
|
242 |
+
$mid = Mage::getStoreConfig(self::MERCHANT_ID);
|
243 |
+
$feedUrl_new = "https://feed.expertrec.com/magento/n01eba6261ad7f174cd3a16523e86e65/".$mid;
|
244 |
+
|
245 |
+
$storeIds = $product->getStoreIds();
|
246 |
+
if(!empty($storeIds)){
|
247 |
|
248 |
+
foreach($storeIds as $storeId){
|
249 |
+
//Need to refetch the product based on wid
|
250 |
$productId = $product->getId();
|
251 |
|
252 |
+
// $logger->log("for store # ".$storeId);
|
253 |
+
|
254 |
+
$store = Mage::app()->getStore($storeId);
|
255 |
+
|
256 |
+
$websiteId = $store->getWebsiteId();
|
257 |
+
$website = Mage::app()->getWebsite($websiteId);
|
258 |
+
|
259 |
+
//Fetching collection
|
260 |
$coreResource = Mage::getSingleton("core/resource");
|
261 |
$catalogInventoryTable = method_exists($coreResource, 'getTableName')
|
262 |
? $coreResource->getTableName('cataloginventory_stock_item') : 'cataloginventory_stock_item';
|
264 |
"use_config_manage_stock" => "use_config_manage_stock", "is_in_stock" => "is_in_stock");
|
265 |
|
266 |
$collection = Mage::getModel('catalog/product')->getCollection();
|
267 |
+
//Filtering the fetched collection
|
268 |
+
$collection->addFieldToFilter('entity_id',$productId)
|
269 |
+
->addWebsiteFilter($websiteId)
|
270 |
+
->setStoreId($storeId)
|
271 |
+
->addAttributeToSelect('*')
|
272 |
+
->addCategoryIds()
|
273 |
+
->joinTable($catalogInventoryTable, 'product_id=entity_id', $stockfields, null, 'left');
|
274 |
+
|
275 |
+
//Looping to check disable and out of stock
|
276 |
+
foreach($collection as $productt){
|
277 |
+
|
278 |
+
$producttId = $productt->getId();
|
279 |
+
$status = $productt->getData('status');
|
280 |
+
|
281 |
+
//If product is disabled, send a BE hit
|
282 |
+
if($status == 2){
|
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);
|
290 |
+
|
291 |
+
$response = Mage::getModel('expertrec_recommendation/api_request')
|
292 |
+
->setPrepareRequestStatus(false)
|
293 |
+
->setUserId('expertrec')
|
294 |
+
->setUrl($finalUrl_disabled)
|
295 |
+
->setMethod(Zend_Http_Client::POST)
|
296 |
+
->setData($disabled_array)
|
297 |
+
->setHeader("Content-Type",'application/json')
|
298 |
+
->setPrepareRequestStatus(true)
|
299 |
+
->sendRequest();
|
300 |
+
|
301 |
+
$finalUrl_disabled_new = $feedUrl_new.'/disabled';
|
302 |
+
|
303 |
+
//sending request to 2 endpoints, for backward compatibility
|
304 |
+
$response = Mage::getModel('expertrec_recommendation/api_request')
|
305 |
+
->setPrepareRequestStatus(false)
|
306 |
+
->setUserId('expertrec')
|
307 |
+
->setUrl($finalUrl_disabled_new)
|
308 |
+
->setMethod(Zend_Http_Client::POST)
|
309 |
+
->setData($disabled_array)
|
310 |
+
->setHeader("Content-Type",'application/json')
|
311 |
+
->setPrepareRequestStatus(true)
|
312 |
+
->sendRequest();
|
313 |
+
|
314 |
+
if(!$response) {
|
315 |
+
$logger->log('SaveCatalogProduct_Track: request failed for product with Id #'.$product->getId());
|
316 |
+
}
|
317 |
+
}
|
318 |
+
else{
|
319 |
+
//This can only mean that the product is out of stock, and didn't return a value because global out of stock is not set
|
320 |
+
if($productt->getData("is_in_stock") == 0 && $global_display_out_of_stock == 0 ){
|
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);
|
328 |
+
|
329 |
+
$response = Mage::getModel('expertrec_recommendation/api_request')
|
330 |
+
->setPrepareRequestStatus(false)
|
331 |
+
->setUserId('expertrec')
|
332 |
+
->setUrl($finalUrl_stock)
|
333 |
+
->setMethod(Zend_Http_Client::POST)
|
334 |
+
->setData($stock_array)
|
335 |
+
->setHeader("Content-Type",'application/json')
|
336 |
+
->setPrepareRequestStatus(true)
|
337 |
+
->sendRequest();
|
338 |
+
|
339 |
+
$finalUrl_stock_new = $feedUrl_new.'/stock';
|
340 |
+
|
341 |
+
//sending request to 2 endpoints, for backward compatibility
|
342 |
+
$response = Mage::getModel('expertrec_recommendation/api_request')
|
343 |
+
->setPrepareRequestStatus(false)
|
344 |
+
->setUserId('expertrec')
|
345 |
+
->setUrl($finalUrl_stock_new)
|
346 |
+
->setMethod(Zend_Http_Client::POST)
|
347 |
+
->setData($stock_array)
|
348 |
+
->setHeader("Content-Type",'application/json')
|
349 |
+
->setPrepareRequestStatus(true)
|
350 |
+
->sendRequest();
|
351 |
+
|
352 |
+
if(!$response) {
|
353 |
+
$logger->log('SaveCatalogProduct_Track: request failed for product with Id #'.$product->getId());
|
354 |
+
}
|
355 |
+
}else{
|
356 |
+
//Fetch price data for product if it is in stock, or if it is out of stock and has global setting to true
|
357 |
+
$collectionWithPrice = Mage::getModel('catalog/product')->getCollection();
|
358 |
+
$collectionWithPrice->addFieldToFilter('entity_id',$producttId)
|
359 |
+
->addWebsiteFilter($websiteId)
|
360 |
+
->setStoreId($storeId)
|
361 |
+
->addAttributeToSelect('*')
|
362 |
+
->addCategoryIds()
|
363 |
+
->joinTable($catalogInventoryTable, 'product_id=entity_id', $stockfields, null, 'left')
|
364 |
+
->addPriceData(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID, $websiteId);
|
365 |
+
//Looping on price product, to send BE hit
|
366 |
+
foreach($collectionWithPrice as $selectedProduct){
|
367 |
+
|
368 |
+
$selectedProduct->setStoreId($storeId);
|
369 |
+
|
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';
|
380 |
+
// $logger->log("final product url is : ".$finalUrl);
|
381 |
+
|
382 |
+
|
383 |
+
$response = Mage::getModel('expertrec_recommendation/api_request')
|
384 |
+
->setPrepareRequestStatus(false)
|
385 |
+
->setUserId('expertrec')
|
386 |
+
->setUrl($finalUrl)
|
387 |
+
->setMethod(Zend_Http_Client::POST)
|
388 |
+
->setData($resultArray)
|
389 |
+
->setHeader("Content-Type",'application/json')
|
390 |
+
->setPrepareRequestStatus(true)
|
391 |
+
->sendRequest();
|
392 |
+
|
393 |
+
$finalUrl_new = $feedUrl_new.'/product';
|
394 |
+
|
395 |
+
//sending request to 2 endpoints, for backward compatibility
|
396 |
+
$response = Mage::getModel('expertrec_recommendation/api_request')
|
397 |
+
->setPrepareRequestStatus(false)
|
398 |
+
->setUserId('expertrec')
|
399 |
+
->setUrl($finalUrl_new)
|
400 |
+
->setMethod(Zend_Http_Client::POST)
|
401 |
+
->setData($resultArray)
|
402 |
+
->setHeader("Content-Type",'application/json')
|
403 |
+
->setPrepareRequestStatus(true)
|
404 |
+
->sendRequest();
|
405 |
+
|
406 |
+
if(!$response) {
|
407 |
+
$logger->log('SaveCatalogProduct_Track: request failed for product with Id #'.$product->getId());
|
408 |
+
}
|
409 |
+
|
410 |
+
}
|
411 |
}
|
412 |
}
|
413 |
}
|
414 |
+
|
415 |
}
|
416 |
}
|
417 |
+
|
|
|
418 |
}
|
419 |
+
}catch (Exception $e) {
|
420 |
+
$logger->log("SaveCatalogProduct_Track error: ".$e->getMessage());
|
421 |
}
|
422 |
+
return $this;
|
423 |
+
}
|
424 |
|
425 |
/**
|
426 |
* Method to track save Category
|
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';
|
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 = "
|
30 |
-
const EXPERTREC_VERSION = "1.2.
|
31 |
private $_password;
|
32 |
private $_storeId = array();
|
33 |
|
26 |
const CONFIG_SECRET = 'expertrec/general/secret';
|
27 |
const PUSHED_FEED_PAGES = 'expertrec/general/expertrec_feed_pushed_pages';
|
28 |
|
29 |
+
const BUILD_NO = "1495177474";
|
30 |
+
const EXPERTREC_VERSION = "1.2.17";
|
31 |
private $_password;
|
32 |
private $_storeId = array();
|
33 |
|
app/code/community/Expertrec/Recommendation/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Expertrec_Recommendation>
|
5 |
-
<version>1.2.
|
6 |
</Expertrec_Recommendation>
|
7 |
</modules>
|
8 |
<global>
|
@@ -113,6 +113,17 @@
|
|
113 |
</expertrec_recommendation_save_stock>
|
114 |
</observers>
|
115 |
</cataloginventory_stock_item_save_after>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
</events>
|
117 |
</global>
|
118 |
<frontend>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Expertrec_Recommendation>
|
5 |
+
<version>1.2.17</version>
|
6 |
</Expertrec_Recommendation>
|
7 |
</modules>
|
8 |
<global>
|
113 |
</expertrec_recommendation_save_stock>
|
114 |
</observers>
|
115 |
</cataloginventory_stock_item_save_after>
|
116 |
+
|
117 |
+
<!-- <adminhtml_controller_urlrewrite_save>
|
118 |
+
<observers>
|
119 |
+
<expertrec_recommendation_save_url>
|
120 |
+
<type>singleton</type>
|
121 |
+
<class>expertrec_recommendation/observer</class>
|
122 |
+
<method>url</method>
|
123 |
+
</expertrec_recommendation_save_url>
|
124 |
+
</observers>
|
125 |
+
</adminhtml_controller_urlrewrite_save>-->
|
126 |
+
|
127 |
</events>
|
128 |
</global>
|
129 |
<frontend>
|
app/code/community/Expertrec/Recommendation/sql/expertrec_setup/{mysql4-install-1.2.16.php → mysql4-install-1.2.17.php}
RENAMED
@@ -11,7 +11,7 @@
|
|
11 |
|
12 |
$mage_ver = Mage::getVersion();
|
13 |
$php_ver = phpversion();
|
14 |
-
$expertrec_version = "1.2.
|
15 |
|
16 |
$installer->startSetup();
|
17 |
|
11 |
|
12 |
$mage_ver = Mage::getVersion();
|
13 |
$php_ver = phpversion();
|
14 |
+
$expertrec_version = "1.2.17";
|
15 |
|
16 |
$installer->startSetup();
|
17 |
|
app/code/community/Expertrec/Recommendation/sql/expertrec_setup/{mysql4-upgrade-1.2.15-1.2.16.php → mysql4-upgrade-1.2.16-1.2.17.php}
RENAMED
@@ -11,7 +11,7 @@
|
|
11 |
|
12 |
$mage_ver = Mage::getVersion();
|
13 |
$php_ver = phpversion();
|
14 |
-
$expertrec_version = "1.2.
|
15 |
|
16 |
$installer->startSetup();
|
17 |
|
11 |
|
12 |
$mage_ver = Mage::getVersion();
|
13 |
$php_ver = phpversion();
|
14 |
+
$expertrec_version = "1.2.17";
|
15 |
|
16 |
$installer->startSetup();
|
17 |
|
app/design/frontend/base/default/layout/expertrec/recommendation.xml
CHANGED
@@ -10,6 +10,11 @@
|
|
10 |
<block name="expertrec.rec.tracking" template="expertrec/recommendation/tracker.phtml" after="-" type="core/template"/>
|
11 |
</reference>
|
12 |
</default>
|
|
|
|
|
|
|
|
|
|
|
13 |
<catalog_product_view>
|
14 |
<reference name="before_body_end">
|
15 |
<block name="expertrec.rec.analytics.producttracking" template="expertrec/recommendation/tracking/product.phtml" after="-" type="core/template"/>
|
10 |
<block name="expertrec.rec.tracking" template="expertrec/recommendation/tracker.phtml" after="-" type="core/template"/>
|
11 |
</reference>
|
12 |
</default>
|
13 |
+
<cms_index_index>
|
14 |
+
<reference name="footer.before">
|
15 |
+
<block type="expertrec_recommendation/popularqueries" name="search_terms" template="expertrec/page/html/sterms.phtml"/>
|
16 |
+
</reference>
|
17 |
+
</cms_index_index>
|
18 |
<catalog_product_view>
|
19 |
<reference name="before_body_end">
|
20 |
<block name="expertrec.rec.analytics.producttracking" template="expertrec/recommendation/tracking/product.phtml" after="-" type="core/template"/>
|
app/design/frontend/base/default/template/expertrec/page/html/sterms.phtml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magento.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magento.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<div class="footer-container expert-popular-query">
|
28 |
+
<h1 class="expert-popular-query-title" style="color: #636363;font-family: 'Raleway', 'Helvetica Neue', Verdana, Arial, sans-serif;font-size: 24px; font-weight: 400;font-style: normal;line-height: 1.2; border-bottom: none; text-align:center;"><?php echo $this->__('Popular Searches') ?></h1>
|
29 |
+
|
30 |
+
<?php if( sizeof($this->getTerms()) > 0 ): ?>
|
31 |
+
<ul class="expert-popular-query-listing" style="font-size:18px;">
|
32 |
+
<?php foreach ($this->getTerms() as $_term): ?>
|
33 |
+
<li class="expert-popular-query-list" style="display:inline;margin-right:10px;"><a class="expert-popular-query-link" href="<?php echo $this->getSearchUrl($_term) ?>" style="font-size:<?php echo $_term->getRatio()*70+75 ?>%;"><?php echo $this->escapeHtml($_term->getName()) ?></a></li>
|
34 |
+
<?php endforeach; ?>
|
35 |
+
</ul>
|
36 |
+
|
37 |
+
<?php else: ?>
|
38 |
+
<p class="expert-popular-query-msg"><?php echo $this->__('There are no search terms available.'); ?></p>
|
39 |
+
<?php endif; ?>
|
40 |
+
<div class="expert-popular-query-logo" style="text-align:right">
|
41 |
+
<span>Search by </span><a href="//expertrec.com" target="_blank" style="color:#191A15"><span style="color:#1b75b9;font-size: 14px;">expert<span style="color:#ef5b27;font-size:14px;margin-left:1px">Rec</span></span></a></div>
|
42 |
+
</div>
|
app/design/frontend/base/default/template/expertrec/recommendation/tracker.phtml
CHANGED
@@ -27,8 +27,8 @@
|
|
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 |
-
|
32 |
|
33 |
/* * * DON'T EDIT BELOW LINE * * */
|
34 |
(function(){var domain=window.location.hostname.replace(/\./g,""),ea=document.createElement('script');ea.type='text/javascript';ea.async=true;ea.src='//d3qm5o86jyjko6.cloudfront.net/magento/expertrec_'+domain+'.js';var m=document.getElementsByTagName('script')[0];m.parentNode.insertBefore(ea,m)})();var _eaq=_eaq || [];function expertApi(){if(window.expertrec_true){var args=Array.prototype.slice.call(arguments);window.ea_apispec[args[0]](args.slice(1,args.length))}else{_eaq.push(arguments);}}
|
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 |
|
33 |
/* * * DON'T EDIT BELOW LINE * * */
|
34 |
(function(){var domain=window.location.hostname.replace(/\./g,""),ea=document.createElement('script');ea.type='text/javascript';ea.async=true;ea.src='//d3qm5o86jyjko6.cloudfront.net/magento/expertrec_'+domain+'.js';var m=document.getElementsByTagName('script')[0];m.parentNode.insertBefore(ea,m)})();var _eaq=_eaq || [];function expertApi(){if(window.expertrec_true){var args=Array.prototype.slice.call(arguments);window.ea_apispec[args[0]](args.slice(1,args.length))}else{_eaq.push(arguments);}}
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Expertrec_Recommendation</name>
|
4 |
-
<version>1.2.
|
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-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Expertrec"><dir name="Recommendation"><dir name="Block"><file name="Api.php" hash="e7997269c80ea4c7bc24ad67f843ca00"/></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="
|
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.17</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-19</date>
|
14 |
+
<time>07:05:00</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="f8640a75cb1a46c0a51db62233d8954e"/></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="e93977c160250e51b29e82da5dd12653"/><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="613fc56bd34df509473251e4b1e2e78e"/></dir><dir name="sql"><dir name="expertrec_setup"><file name="mysql4-install-1.2.17.php" hash="ae8dca1514f6fe26f22134bb9283baa1"/><file name="mysql4-upgrade-1.2.16-1.2.17.php" hash="b3e1922876f6da050019ab2bb665db0c"/></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="c8b2bae06f377f7c9e0ef3e186c3ac61"/></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>
|