epoqRS - Version 1.1.6

Version Notes

- Minor bugfixes
- Added Enterprise 1.9 Fullpagecache compatibility

Download this release

Release Info

Developer Magento Core Team
Extension epoqRS
Version 1.1.6
Comparing to
See all releases


Code changes from version 1.1.2 to 1.1.6

app/code/community/Flagbit/EpoqInterface/Block/Abstract.php CHANGED
@@ -11,7 +11,7 @@
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
- * @version $Id: Abstract.php 574 2010-11-19 08:19:43Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
@@ -90,9 +90,8 @@ class Flagbit_EpoqInterface_Block_Abstract extends Mage_Core_Block_Abstract
90
 
91
  $_taxHelper = $this->helper('tax');
92
  $_simplePricesTax = ($_taxHelper->displayPriceIncludingTax() || $_taxHelper->displayBothPrices());
93
- $_minimalPriceValue = $product->getMinimalPrice();
94
- return $_taxHelper->getPrice($product, $_minimalPriceValue, $_simplePricesTax);
95
-
96
  }
97
 
98
  return $product->getFinalPrice();
@@ -126,7 +125,7 @@ class Flagbit_EpoqInterface_Block_Abstract extends Mage_Core_Block_Abstract
126
  $attributes = $product->getAttributes();
127
  foreach ($attributes as $attribute) {
128
  // if ($attribute->getIsVisibleOnFront() && $attribute->getIsUserDefined() && !in_array($attribute->getAttributeCode(), $excludeAttr)) {
129
- if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), $excludeAttr)) {
130
 
131
  $value = $attribute->getFrontend()->getValue($product);
132
 
@@ -201,6 +200,18 @@ class Flagbit_EpoqInterface_Block_Abstract extends Mage_Core_Block_Abstract
201
  return $this->_product;
202
  }
203
 
 
 
 
 
 
 
 
 
 
 
 
 
204
 
205
  /**
206
  * get current Category
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
+ * @version $Id: Abstract.php 673 2011-07-27 14:18:59Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
90
 
91
  $_taxHelper = $this->helper('tax');
92
  $_simplePricesTax = ($_taxHelper->displayPriceIncludingTax() || $_taxHelper->displayBothPrices());
93
+ $_minimalPriceValue = $product->getFinalPrice();
94
+ return $_taxHelper->getPrice($product, $_minimalPriceValue, $_simplePricesTax);
 
95
  }
96
 
97
  return $product->getFinalPrice();
125
  $attributes = $product->getAttributes();
126
  foreach ($attributes as $attribute) {
127
  // if ($attribute->getIsVisibleOnFront() && $attribute->getIsUserDefined() && !in_array($attribute->getAttributeCode(), $excludeAttr)) {
128
+ if (($attribute->getIsVisibleOnFront() or $attribute->getIsSearchable() or $attribute->getIsFilterable()) && !in_array($attribute->getAttributeCode(), $excludeAttr)) {
129
 
130
  $value = $attribute->getFrontend()->getValue($product);
131
 
200
  return $this->_product;
201
  }
202
 
203
+
204
+ /**
205
+ * Escape quotes in java scripts
206
+ *
207
+ * @param mixed $data
208
+ * @param string $quote
209
+ * @return mixed
210
+ */
211
+ public function jsQuoteEscape($data, $quote = '\'')
212
+ {
213
+ return $this->helper('core')->jsQuoteEscape($data, $quote);
214
+ }
215
 
216
  /**
217
  * get current Category
app/code/community/Flagbit/EpoqInterface/Block/Export/Productlist.php CHANGED
@@ -11,12 +11,20 @@
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
- * @version $Id: Productlist.php 574 2010-11-19 08:19:43Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
18
  class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterface_Block_Abstract
19
  {
 
 
 
 
 
 
 
 
20
 
21
  /**
22
  * generates the Output
@@ -60,6 +68,8 @@ class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterfa
60
  if($this->getRequest()->getParam('part')){
61
  $products->getSelect()->limitPage($this->getRequest()->getParam('part', 1), $this->getRequest()->getParam('limit', 1000));
62
  }
 
 
63
 
64
  Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
65
  //Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
@@ -91,6 +101,9 @@ class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterfa
91
  /*@var $product Mage_Catalog_Model_Product */
92
  $product->setData($args['row']);
93
  $product->load($product->getId());
 
 
 
94
  $parentProduct = array();
95
  if(method_exists($product, 'getParentProductIds')){
96
  $product->loadParentProductIds();
@@ -106,7 +119,7 @@ class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterfa
106
 
107
  // create Item xml Element
108
  $elemItem = $xmlObj->createElement('item');
109
-
110
  $data = array(
111
  'title' => $product->getName(),
112
  'link' => $product->getProductUrl(),
@@ -117,7 +130,8 @@ class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterfa
117
  'g:price' => $this->getProductPrice($product),
118
  'g:image_link' => (string) $this->helper('catalog/image')->init($product, 'image'),
119
  'g:product_type'=> implode('>', $this->getCategoryPath(true)),
120
- 'g:brand' => $this->getProduct()->getManufacturer(),
 
121
  'g:upc' => $this->getProduct()->getSku(),
122
  'g:quantity' => $this->getProduct()->isSaleable(),
123
 
@@ -129,6 +143,8 @@ class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterfa
129
 
130
  );
131
 
 
 
132
  // set Product variant
133
  if(isset($parentProduct[0])){
134
  $data['e:variant_of'] = $parentProduct[0];
@@ -155,6 +171,23 @@ class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterfa
155
 
156
  }
157
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  /**
159
  * get Product Variants
160
  *
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
+ * @version $Id: Productlist.php 673 2011-07-27 14:18:59Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
18
  class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterface_Block_Abstract
19
  {
20
+
21
+
22
+ /**
23
+ * Product Type Instances singletons
24
+ *
25
+ * @var array
26
+ */
27
+ protected $_productTypeInstances = array();
28
 
29
  /**
30
  * generates the Output
68
  if($this->getRequest()->getParam('part')){
69
  $products->getSelect()->limitPage($this->getRequest()->getParam('part', 1), $this->getRequest()->getParam('limit', 1000));
70
  }
71
+
72
+ Mage::helper('epoqinterface/debug')->log('Export select query: '.(string) $products->getSelect());
73
 
74
  Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
75
  //Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
101
  /*@var $product Mage_Catalog_Model_Product */
102
  $product->setData($args['row']);
103
  $product->load($product->getId());
104
+
105
+ $this->setProductTypeInstance($product);
106
+
107
  $parentProduct = array();
108
  if(method_exists($product, 'getParentProductIds')){
109
  $product->loadParentProductIds();
119
 
120
  // create Item xml Element
121
  $elemItem = $xmlObj->createElement('item');
122
+
123
  $data = array(
124
  'title' => $product->getName(),
125
  'link' => $product->getProductUrl(),
130
  'g:price' => $this->getProductPrice($product),
131
  'g:image_link' => (string) $this->helper('catalog/image')->init($product, 'image'),
132
  'g:product_type'=> implode('>', $this->getCategoryPath(true)),
133
+ 'g:brand' => is_object($this->getProduct()->getResource()
134
+ ->getAttribute('manufacturer')) ? $this->getProduct()->getAttributeText('manufacturer') : '',
135
  'g:upc' => $this->getProduct()->getSku(),
136
  'g:quantity' => $this->getProduct()->isSaleable(),
137
 
143
 
144
  );
145
 
146
+
147
+
148
  // set Product variant
149
  if(isset($parentProduct[0])){
150
  $data['e:variant_of'] = $parentProduct[0];
171
 
172
  }
173
 
174
+ /**
175
+ * ReDefine Product Type Instance to Product
176
+ *
177
+ * @param Mage_Catalog_Model_Product $product
178
+ * @return Mage_Catalog_Model_Convert_Adapter_Product
179
+ */
180
+ public function setProductTypeInstance(Mage_Catalog_Model_Product $product)
181
+ {
182
+ $type = $product->getTypeId();
183
+ if (!isset($this->_productTypeInstances[$type])) {
184
+ $this->_productTypeInstances[$type] = Mage::getSingleton('catalog/product_type')
185
+ ->factory($product, true);
186
+ }
187
+ $product->setTypeInstance($this->_productTypeInstances[$type], true);
188
+ return $this;
189
+ }
190
+
191
  /**
192
  * get Product Variants
193
  *
app/code/community/Flagbit/EpoqInterface/Block/Track/Order.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* *
3
+ * This script is part of the epoq Recommendation Service project *
4
+ * *
5
+ * epoqinterface is free software; you can redistribute it and/or modify *
6
+ * it under the terms of the GNU General Public License version 2 as *
7
+ * published by the Free Software Foundation. *
8
+ * *
9
+ * This script is distributed in the hope that it will be useful, but *
10
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
11
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
+ * Public License for more details. *
13
+ * *
14
+ * @version $Id: Cart.php 487 2010-08-05 12:32:57Z weller $
15
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
+ */
17
+ class Flagbit_EpoqInterface_Block_Track_Order extends Flagbit_EpoqInterface_Block_Abstract
18
+ {
19
+
20
+ protected function _toHtml()
21
+ {
22
+ $output = '';
23
+ $orderIds = $this->getOrderIds();
24
+ if (empty($orderIds) || !is_array($orderIds)) {
25
+ return;
26
+ }
27
+
28
+ $collection = Mage::getResourceModel('sales/order_collection')
29
+ ->addFieldToFilter('entity_id', array('in' => $orderIds))
30
+ ;
31
+
32
+
33
+ $variables = array(
34
+ 'epoq_tenantId' => Mage::getStoreConfig('epoqinterface/config/tenant_id'),
35
+ 'epoq_sessionId' => Mage::getSingleton('core/session')->getSessionId(),
36
+ );
37
+
38
+ foreach($collection as $order){
39
+ $this->setOrder($order);
40
+ $output .= $this->getJavascriptOutput(
41
+ $this->arrayToString(
42
+ $this->getParamsArray()
43
+ ),
44
+ 'processCart');
45
+ }
46
+
47
+ return $output;
48
+ }
49
+
50
+ protected function getParamsArray(){
51
+
52
+ $variables = parent::getParamsArray();
53
+
54
+ $items = $this->getOrder()->getAllVisibleItems();
55
+
56
+ /*@var $item Mage_Sales_Model_Quote_Item */
57
+ foreach ($items as $key => $item){
58
+
59
+ if ($option = $item->getOptionByCode('simple_product')) {
60
+ $variables['epoq_variantOfList'][$key] = $item->getProductId();
61
+ }
62
+
63
+ $variables['epoq_productIds'][$key] = $this->jsQuoteEscape($item->getProductId());
64
+ $variables['epoq_quantities'][$key] = $this->jsQuoteEscape($item->getQtyOrdered());
65
+ $variables['epoq_unitPrices'][$key] = $this->jsQuoteEscape($item->getBasePrice());
66
+ }
67
+
68
+ return $variables;
69
+ }
70
+
71
+ }
app/code/community/Flagbit/EpoqInterface/Block/Track/Product.php CHANGED
@@ -11,7 +11,7 @@
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
- * @version $Id: Product.php 242 2009-08-25 14:15:49Z tuerk $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
+ * @version $Id: Product.php 583 2010-11-26 10:08:21Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
app/code/community/Flagbit/EpoqInterface/Helper/Data.php CHANGED
@@ -11,7 +11,7 @@
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
- * @version $Id: Data.php 238 2009-07-03 09:22:08Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
  class Flagbit_EpoqInterface_Helper_Data extends Mage_Core_Helper_Abstract
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
+ * @version $Id: Data.php 583 2010-11-26 10:08:21Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
  class Flagbit_EpoqInterface_Helper_Data extends Mage_Core_Helper_Abstract
app/code/community/Flagbit/EpoqInterface/Helper/Debug.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* *
3
+ * This script is part of the epoq Recommendation Service project *
4
+ * *
5
+ * epoqinterface is free software; you can redistribute it and/or modify *
6
+ * it under the terms of the GNU General Public License version 2 as *
7
+ * published by the Free Software Foundation. *
8
+ * *
9
+ * This script is distributed in the hope that it will be useful, but *
10
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
11
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
+ * Public License for more details. *
13
+ * *
14
+ * @version $Id: Data.php 583 2010-11-26 10:08:21Z weller $
15
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
+ */
17
+ class Flagbit_EpoqInterface_Helper_Debug extends Mage_Core_Helper_Abstract
18
+ {
19
+ const LOG_FILE_NAME = 'epoq.log';
20
+
21
+ /**
22
+ * XML Config Path to Product Identifier Setting
23
+ *
24
+ * @var string
25
+ */
26
+ const XML_CONFIG_PATH_DEBUG_MODE = 'epoqinterface/config/debug';
27
+
28
+ /**
29
+ * Debug Log to file var/log/epoq.log
30
+ *
31
+ * @param $message
32
+ * @param $level
33
+ * @param $file
34
+ * @param $forceLog
35
+ */
36
+ public function log($message)
37
+ {
38
+
39
+ if(Mage::getStoreConfig(self::XML_CONFIG_PATH_DEBUG_MODE)) {
40
+ Mage::log($message, null, self::LOG_FILE_NAME, true);
41
+ }
42
+ return $this;
43
+ }
44
+ }
app/code/community/Flagbit/EpoqInterface/Model/Abstract.php CHANGED
@@ -43,7 +43,7 @@ class Flagbit_EpoqInterface_Model_Abstract extends Mage_Core_Model_Abstract {
43
  if($this->getIsErrorHandling()
44
  && $this->getFailureCount() >= Mage::getStoreConfig(self::XML_MAX_ATTEMPTS_PATH)
45
  && $this->getRequestFailureTime() > time()){
46
-
47
  return null;
48
  }
49
 
@@ -51,13 +51,20 @@ class Flagbit_EpoqInterface_Model_Abstract extends Mage_Core_Model_Abstract {
51
  /*@var $result Zend_Rest_Client_Result */
52
  $result = $this->getRestClient()->get();
53
 
 
 
 
 
54
  }catch (Exception $e){
55
 
56
  // developer mode
57
  if(Mage::getIsDeveloperMode()){
58
 
59
- Zend_Debug::dump($this->getRestClient()->getUri()->getUri());
60
- Zend_Debug::dump($this->getRestClient()->getHttpClient()->getLastResponse());
 
 
 
61
  throw $e;
62
 
63
  // error handling
43
  if($this->getIsErrorHandling()
44
  && $this->getFailureCount() >= Mage::getStoreConfig(self::XML_MAX_ATTEMPTS_PATH)
45
  && $this->getRequestFailureTime() > time()){
46
+ Mage::helper('epoqinterface/debug')->log('error handling is on: '.$this->getRequestFailureTime().' > '.time());
47
  return null;
48
  }
49
 
51
  /*@var $result Zend_Rest_Client_Result */
52
  $result = $this->getRestClient()->get();
53
 
54
+ Mage::helper('epoqinterface/debug')
55
+ ->log('Request URI: '.$this->getRestClient()->getUri()->getUri())
56
+ ->log('Response: '.$this->getRestClient()->getHttpClient()->getLastResponse());
57
+
58
  }catch (Exception $e){
59
 
60
  // developer mode
61
  if(Mage::getIsDeveloperMode()){
62
 
63
+ Mage::helper('epoqinterface/debug')
64
+ ->log('Exception: '.$e->getMessage())
65
+ ->log('Request URI: '.$this->getRestClient()->getUri()->getUri())
66
+ ->log('Response: '.$this->getRestClient()->getHttpClient()->getLastResponse());
67
+
68
  throw $e;
69
 
70
  // error handling
app/code/community/Flagbit/EpoqInterface/Model/Observer.php CHANGED
@@ -11,12 +11,31 @@
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
- * @version $Id: Observer.php 248 2010-03-11 09:52:13Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
18
  class Flagbit_EpoqInterface_Model_Observer {
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  /**
21
  * get Session
22
  *
@@ -69,25 +88,8 @@ class Flagbit_EpoqInterface_Model_Observer {
69
  /*@var $order Mage_Sales_Model_Order */
70
  $order = $observer->getOrder();
71
 
72
- Mage::getSingleton('epoqinterface/customer_profiles')->send($order);
 
73
  }
74
-
75
- /**
76
- * Observer: sales_order_place_before
77
- *
78
- * @param Varien_Event_Observer $observer
79
- */
80
- public function salesOrderPlaceBefore($observer){
81
-
82
- $this->getSession()->setCartUpdate('process');
83
-
84
- /*@var $block Flagbit_EpoqInterface_Block_Track_Cart */
85
- if(!($block = Mage::app()->getLayout()->getBlock('epoqinterface_track_order'))){
86
- $block = Mage::app()->getLayout()->createBlock('epoqinterface/track_cart', 'epoqinterface_track_order');
87
- }
88
 
89
- $this->getSession()->setBlockTrackCartOutput($block->toHtml());
90
-
91
- }
92
-
93
  }
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
+ * @version $Id: Observer.php 664 2011-07-06 12:20:44Z rieker $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
18
  class Flagbit_EpoqInterface_Model_Observer {
19
 
20
+
21
+ /**
22
+ * Add order information into epoq block to render on checkout success pages
23
+ *
24
+ * @param Varien_Event_Observer $observer
25
+ */
26
+ public function setTrackOnOrderSuccessPageView(Varien_Event_Observer $observer)
27
+ {
28
+ $orderIds = $observer->getEvent()->getOrderIds();
29
+ if (empty($orderIds) || !is_array($orderIds)) {
30
+ return;
31
+ }
32
+ $block = Mage::app()->getFrontController()->getAction()->getLayout()->getBlock('epoqinterface_track_order');
33
+
34
+ if ($block) {
35
+ $block->setOrderIds($orderIds);
36
+ }
37
+ }
38
+
39
  /**
40
  * get Session
41
  *
88
  /*@var $order Mage_Sales_Model_Order */
89
  $order = $observer->getOrder();
90
 
91
+ Mage::getSingleton('epoqinterface/customer_profiles')->send($order);
92
+ Mage::getSingleton('epoqinterface/order')->send($order);
93
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
 
 
 
 
 
95
  }
app/code/community/Flagbit/EpoqInterface/Model/Order.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* *
3
+ * This script is part of the epoq Recommendation Service project *
4
+ * *
5
+ * epoqinterface is free software; you can redistribute it and/or modify *
6
+ * it under the terms of the GNU General Public License version 2 as *
7
+ * published by the Free Software Foundation. *
8
+ * *
9
+ * This script is distributed in the hope that it will be useful, but *
10
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
11
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
+ * Public License for more details. *
13
+ * *
14
+ * @version $Id: Cart.php 5 2009-07-03 09:22:08Z weller $
15
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
+ */
17
+
18
+ class Flagbit_EpoqInterface_Model_Order extends Flagbit_EpoqInterface_Model_Abstract {
19
+
20
+
21
+ /**
22
+ * send Customer Data
23
+ *
24
+ * @param Mage_Sales_Model_Order $order
25
+ */
26
+ public function send($order){
27
+
28
+ $data = array(
29
+ 'action' => 'processCart'
30
+ );
31
+
32
+ Mage::getSingleton('epoqinterface/recommendation_cart', $this->getData());
33
+ }
34
+
35
+
36
+ }
37
+
app/code/community/Flagbit/EpoqInterface/Model/Recommendation/Abstract.php CHANGED
@@ -11,13 +11,13 @@
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
- * @version $Id: Abstract.php 466 2010-07-08 12:30:54Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
18
  class Flagbit_EpoqInterface_Model_Recommendation_Abstract extends Flagbit_EpoqInterface_Model_Abstract {
19
-
20
-
21
  /**
22
  * Constructor
23
  *
@@ -33,102 +33,93 @@ class Flagbit_EpoqInterface_Model_Recommendation_Abstract extends Flagbit_EpoqIn
33
  $this->_data = $args[0];
34
 
35
  $this->_construct();
36
-
37
- // get Data
38
- $result = $this->_doRequest();
39
- if(!$result instanceof Zend_Rest_Client_Result){
40
- return;
41
- }
42
 
43
- // generate product ID array
44
- $productIds = array();
45
- if($result->getIterator() instanceof SimpleXMLElement){
46
-
47
- foreach($result->getIterator()->recommendation as $product){
48
- $productIds[] = (int) $product->productId;
49
-
50
- }
51
- }
52
-
53
- // set Data
54
- $this->setProductIds($productIds);
55
- $this->setRecommendationId((string) $result->getIterator()->recommendationId);
56
 
57
- $this->getSession()->setLastRecommentationId($this->getRecommendationId());
58
- $this->getSession()->setLastRecommentationProducts($this->getProductIds());
59
-
 
 
 
60
  }
61
-
62
 
63
  /**
64
  * get Product Collection
65
  *
66
  * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
67
  */
68
- public function getCollection(){
69
-
70
- /*@var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection */
71
- $collection = Mage::getResourceModel('catalog/product_collection');
72
-
73
- $collection->addIdFilter($this->getProductIds());
74
- return $collection;
75
- }
76
-
77
- /**
78
- * return Zend Rest Client
79
- *
80
- * @return Zend_Rest_Client
81
- */
82
- public function getRestClient(){
 
 
 
 
 
 
83
 
84
- if(!$this->_restClient instanceof Zend_Rest_Client) {
85
-
86
- $url = $this->getRestUrl().'getRecommendationsFor'.$this->_getRecommendationFor.'?'.$this->_httpBuildQuery($this->getParamsArray());
 
 
 
 
 
 
87
 
88
- $this->_restClient = new Zend_Rest_Client($url);
89
- $this->_restClient->getHttpClient()->setConfig(
90
- array(
91
- 'timeout' => Mage::getStoreConfig(self::XML_TIMEOUT_PATH)
92
- )
93
- );
94
- }
95
-
96
- return $this->_restClient;
97
- }
98
-
99
- protected function _httpBuildQuery($array, $previousKey=''){
100
-
101
- $string = '';
102
- foreach($array as $key => $value){
103
-
104
- if(is_array($value)){
105
- $string .= ($string ? '&' : '').$this->_httpBuildQuery($value, $key);
106
- continue;
107
- }
108
-
109
- $string .= ($string ? '&' : '').(is_numeric($key) && $previousKey ? $previousKey : $key ).($value ? '='.urlencode($value) : '');
110
- }
111
- return $string;
112
- }
113
-
114
-
115
- protected function getParamsArray(){
116
-
117
- $variables = array(
118
- 'tenantId' => Mage::getStoreConfig(self::XML_TENANT_ID_PATH),
119
- 'sessionId' => Mage::getSingleton('core/session')->getSessionId(),
120
- 'demo' => Mage::getStoreConfig(self::XML_DEMO_PATH) ? 6 : 0,
121
- 'widgetTheme' => 'xml',
122
- 'rules' => $this->getRules()
123
- );
124
-
125
- if($customerId = Mage::getSingleton('customer/session')->getId()){
126
- $variables['customerId'] = $customerId;
127
- }
128
-
129
- return $variables;
130
- }
131
-
132
 
133
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  }
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
+ * @version $Id: Abstract.php 666 2011-07-06 13:44:33Z rieker $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
18
  class Flagbit_EpoqInterface_Model_Recommendation_Abstract extends Flagbit_EpoqInterface_Model_Abstract {
19
+
20
+
21
  /**
22
  * Constructor
23
  *
33
  $this->_data = $args[0];
34
 
35
  $this->_construct();
 
 
 
 
 
 
36
 
37
+ // get Data
38
+ $result = $this->_doRequest();
39
+ if (!$result instanceof Zend_Rest_Client_Result) {
40
+ return;
41
+ }
42
+
43
+ // generate product ID array
44
+ $productIds = array();
45
+ if ($result->getIterator() instanceof SimpleXMLElement) {
46
+ foreach ($result->getIterator()->recommendation as $product) {
47
+ $productIds[] = (int) $product->productId;
48
+ }
49
+ }
50
 
51
+ // set Data
52
+ $this->setProductIds($productIds);
53
+ $this->setRecommendationId((string) $result->getIterator()->recommendationId);
54
+
55
+ $this->getSession()->setLastRecommentationId($this->getRecommendationId());
56
+ $this->getSession()->setLastRecommentationProducts($this->getProductIds());
57
  }
 
58
 
59
  /**
60
  * get Product Collection
61
  *
62
  * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
63
  */
64
+ public function getCollection()
65
+ {
66
+ /*@var $collection Flagbit_EpoqInterface_Model_Rescource_Eav_Mysql4_Product_Collection */
67
+ $collection = Mage::getResourceModel('epoqinterface/product_collection');
68
+ $collection->setProductIds($this->getProductIds());
69
+ return $collection;
70
+ }
71
+
72
+ /**
73
+ * return Zend Rest Client
74
+ *
75
+ * @return Zend_Rest_Client
76
+ */
77
+ public function getRestClient()
78
+ {
79
+ if (!$this->_restClient instanceof Zend_Rest_Client) {
80
+ if (array_key_exists('action', $this->getData()) && $this->getData('action') == 'processCart') {
81
+ $url = $this->getRestUrl().'processCart?'.$this->_httpBuildQuery($this->getParamsArray());
82
+ } else {
83
+ $url = $this->getRestUrl().'getRecommendationsFor'.$this->_getRecommendationFor.'?'.$this->_httpBuildQuery($this->getParamsArray());
84
+ }
85
 
86
+ $this->_restClient = new Zend_Rest_Client($url);
87
+ $this->_restClient->getHttpClient()->setConfig(
88
+ array(
89
+ 'timeout' => Mage::getStoreConfig(self::XML_TIMEOUT_PATH)
90
+ )
91
+ );
92
+ }
93
+ return $this->_restClient;
94
+ }
95
 
96
+ protected function _httpBuildQuery($array, $previousKey='')
97
+ {
98
+ $string = '';
99
+ foreach ($array as $key => $value) {
100
+ if (is_array($value)) {
101
+ $string .= ($string ? '&' : '').$this->_httpBuildQuery($value, $key);
102
+ continue;
103
+ }
104
+ $string .= ($string ? '&' : '').(is_numeric($key) && $previousKey ? $previousKey : $key ).($value ? '='.urlencode($value) : '');
105
+ }
106
+ return $string;
107
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
 
109
+ protected function getParamsArray()
110
+ {
111
+ $variables = array(
112
+ 'tenantId' => Mage::getStoreConfig(self::XML_TENANT_ID_PATH),
113
+ 'sessionId' => Mage::getSingleton('core/session')->getSessionId(),
114
+ 'demo' => Mage::getStoreConfig(self::XML_DEMO_PATH) ? 6 : 0,
115
+ 'widgetTheme' => 'xml',
116
+ 'rules' => $this->getRules()
117
+ );
118
+
119
+ if ($customerId = Mage::getSingleton('customer/session')->getId()) {
120
+ $variables['customerId'] = $customerId;
121
+ }
122
+
123
+ return $variables;
124
+ }
125
  }
app/code/community/Flagbit/EpoqInterface/Model/Recommendation/Cart.php CHANGED
@@ -11,55 +11,52 @@
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
- * @version $Id: Cart.php 238 2009-07-03 09:22:08Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
18
  class Flagbit_EpoqInterface_Model_Recommendation_Cart extends Flagbit_EpoqInterface_Model_Recommendation_Abstract {
19
 
20
- protected $_getRecommendationFor = 'Cart';
21
-
22
- protected function getParamsArray(){
23
-
24
- $params = parent::getParamsArray();
25
-
26
  $items = $this->getQuote()->getAllVisibleItems();
27
-
28
- /*@var $item Mage_Sales_Model_Quote_Item */
29
- foreach ($items as $key => $item){
30
-
31
- if ($option = $item->getOptionByCode('simple_product')) {
32
-
33
- $product = $option->getProduct();
34
- $variables['variantOf'][$key] = $item->getProduct()->getId();
35
- }else{
36
- $product = $item->getProduct();
37
- }
38
-
39
- $params['productId'][$key] = $product->getId();
40
- $params['quantity'][$key] = $item->getQty();
41
- $params['unitPrice'][$key] = $item->getPrice();
42
- }
43
 
44
- $params['updateCart'] = '';
45
-
46
- return $params;
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
-
50
  /**
51
  * get Quote
52
  *
53
  * @return Mage_Sales_Model_Quote
54
  */
55
- protected function getQuote(){
56
-
57
- if($this->_quote === null){
58
- $this->_quote = Mage::getSingleton('checkout/cart')->getQuote();
59
- }
60
-
61
- return $this->_quote;
62
- }
63
-
64
- }
65
-
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
+ * @version $Id: Cart.php 666 2011-07-06 13:44:33Z rieker $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
18
  class Flagbit_EpoqInterface_Model_Recommendation_Cart extends Flagbit_EpoqInterface_Model_Recommendation_Abstract {
19
 
20
+ protected $_getRecommendationFor = 'Cart';
21
+
22
+ protected function getParamsArray()
23
+ {
24
+ $params = parent::getParamsArray();
25
+
26
  $items = $this->getQuote()->getAllVisibleItems();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
+ /*@var $item Mage_Sales_Model_Quote_Item */
29
+ foreach ($items as $key => $item) {
30
+ if ($option = $item->getOptionByCode('simple_product')) {
31
+ $product = $option->getProduct();
32
+ $variables['variantOf'][$key] = $item->getProduct()->getId();
33
+ } else {
34
+ $product = $item->getProduct();
35
+ }
36
+
37
+ $params['productId'][$key] = $product->getId();
38
+ $params['quantity'][$key] = $item->getQty();
39
+ $params['unitPrice'][$key] = $item->getPrice();
40
+ }
41
+
42
+ $parentData = parent::getData();
43
+ if (!array_key_exists('action', $parentData)) {
44
+ $params['updateCart'] = '';
45
+ }
46
+
47
+ return $params;
48
+ }
49
 
 
50
  /**
51
  * get Quote
52
  *
53
  * @return Mage_Sales_Model_Quote
54
  */
55
+ protected function getQuote()
56
+ {
57
+ if ($this->_quote === null) {
58
+ $this->_quote = Mage::getSingleton('checkout/cart')->getQuote();
59
+ }
60
+ return $this->_quote;
61
+ }
62
+ }
 
 
 
app/code/community/Flagbit/EpoqInterface/Model/Recommendation/Product.php CHANGED
@@ -11,7 +11,7 @@
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
- * @version $Id: Product.php 574 2010-11-19 08:19:43Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
+ * @version $Id: Product.php 583 2010-11-26 10:08:21Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
app/code/community/Flagbit/EpoqInterface/Model/Resource/Eav/Mysql4/Product/Collection.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* *
3
+ * This script is part of the epoq Recommendation Service project *
4
+ * *
5
+ * epoqinterface is free software; you can redistribute it and/or modify *
6
+ * it under the terms of the GNU General Public License version 2 as *
7
+ * published by the Free Software Foundation. *
8
+ * *
9
+ * This script is distributed in the hope that it will be useful, but *
10
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
11
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
+ * Public License for more details. *
13
+ * *
14
+ * @version $Id: Abstract.php 466 2010-07-08 12:30:54Z weller $
15
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
+ */
17
+
18
+ class Flagbit_EpoqInterface_Model_Resource_Eav_Mysql4_Product_Collection
19
+ extends Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
20
+ {
21
+
22
+ protected $_productIds = array();
23
+
24
+ /**
25
+ * Get collection size
26
+ *
27
+ * @return int
28
+ */
29
+ public function getSize()
30
+ {
31
+ return count($this->_productIds);
32
+ }
33
+
34
+ public function setProductIds($ids)
35
+ {
36
+ $this->_productIds = $ids;
37
+ return $this;
38
+ }
39
+
40
+
41
+ /**
42
+ * Load entities records into items
43
+ *
44
+ * @return Mage_Eav_Model_Entity_Collection_Abstract
45
+ */
46
+ public function _loadEntities($printQuery = false, $logQuery = false)
47
+ {
48
+
49
+ $productIds = $this->_productIds;
50
+ $idFieldName = 'entity_id';
51
+
52
+ if (!empty($productIds)) {
53
+
54
+ // add Filter to Query
55
+ $this->addFieldToFilter(
56
+ $idFieldName,
57
+ array('in'=>$productIds)
58
+ );
59
+
60
+ $this->_pageSize = null;
61
+ $entity = $this->getEntity();
62
+
63
+ $this->getSelect()->reset(Zend_Db_Select::LIMIT_COUNT);
64
+ $this->getSelect()->reset(Zend_Db_Select::LIMIT_OFFSET);
65
+
66
+ $this->printLogQuery($printQuery, $logQuery);
67
+
68
+ try {
69
+ $rows = $this->_fetchAll($this->getSelect());
70
+ } catch (Exception $e) {
71
+ Mage::printException($e, $this->getSelect());
72
+ $this->printLogQuery(true, true, $this->getSelect());
73
+ throw $e;
74
+ }
75
+
76
+ $items = array();
77
+ foreach ($rows as $v) {
78
+ $items[$v[$idFieldName]] = $v;
79
+ }
80
+
81
+ foreach ($productIds as $productId){
82
+
83
+ if(empty($items[$productId])){
84
+ continue;
85
+ }
86
+ $object = $this->getNewEmptyItem()
87
+ ->setData($items[$productId]);
88
+
89
+ $this->addItem($object);
90
+ if (isset($this->_itemsById[$object->getId()])) {
91
+ $this->_itemsById[$object->getId()][] = $object;
92
+ }
93
+ else {
94
+ $this->_itemsById[$object->getId()] = array($object);
95
+ }
96
+ }
97
+
98
+ }
99
+ return $this;
100
+ }
101
+
102
+
103
+ /**
104
+ * Set Order field
105
+ *
106
+ * @param string $attribute
107
+ * @param string $dir
108
+ * @return Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection
109
+ */
110
+ public function setOrder($attribute, $dir='desc')
111
+ {
112
+ return $this;
113
+ }
114
+ }
app/code/community/Flagbit/EpoqInterface/controllers/IndexController.php CHANGED
@@ -11,7 +11,7 @@
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
- * @version $Id: IndexController.php 471 2010-07-09 13:51:44Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
11
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
  * Public License for more details. *
13
  * *
14
+ * @version $Id: IndexController.php 673 2011-07-27 14:18:59Z weller $
15
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
16
  */
17
 
app/code/community/Flagbit/EpoqInterface/etc/config.xml CHANGED
@@ -12,7 +12,7 @@
12
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
13
  * Public License for more details. *
14
  * *
15
- * @version $Id: config.xml 574 2010-11-19 08:19:43Z weller $
16
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
17
  */
18
  -->
@@ -20,18 +20,16 @@
20
  <modules>
21
  <Flagbit_EpoqInterface>
22
  <active>true</active>
23
- <version>1.1.2</version>
24
  </Flagbit_EpoqInterface>
25
  </modules>
26
-
27
  <global>
28
-
29
  <helpers>
30
  <epoqinterface>
31
  <class>Flagbit_EpoqInterface_Helper</class>
32
  </epoqinterface>
33
  </helpers>
34
-
35
  <blocks>
36
  <epoqinterface>
37
  <class>Flagbit_EpoqInterface_Block</class>
@@ -40,9 +38,37 @@
40
  <models>
41
  <epoqinterface>
42
  <class>Flagbit_EpoqInterface_Model</class>
 
43
  </epoqinterface>
 
 
 
44
  </models>
45
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  <events>
47
  <checkout_cart_product_add_after>
48
  <observers>
@@ -71,53 +97,34 @@
71
  </epoqinterface>
72
  </observers>
73
  </controller_action_predispatch_checkout_cart_delete>
74
- <sales_order_save_before>
75
  <observers>
76
  <epoqinterface>
77
  <type>singleton</type>
78
  <class>epoqinterface/observer</class>
79
- <method>salesOrderPlaceBefore</method>
80
  </epoqinterface>
81
  </observers>
82
- </sales_order_save_before>
83
- <sales_order_save_after>
 
84
  <observers>
85
- <epoqinterface>
86
- <type>singleton</type>
87
  <class>epoqinterface/observer</class>
88
- <method>salesOrderPlaceAfter</method>
89
- </epoqinterface>
90
- </observers>
91
- </sales_order_save_after>
92
- </events>
93
- <rewrite>
94
- <epoqinterface>
95
- <from><![CDATA[#^/epoqinterface/#]]></from>
96
- <to>/epoqinterface/index/productlist/</to>
97
- </epoqinterface>
98
- </rewrite>
99
-
100
- </global>
101
-
102
- <frontend>
103
- <layout>
104
- <updates>
105
- <epoqinterface>
106
- <file>epoqinterface.xml</file>
107
- </epoqinterface>
108
- </updates>
109
- </layout>
110
-
111
- <routers>
112
- <epoqinterface>
113
- <use>standard</use>
114
- <args>
115
- <module>Flagbit_EpoqInterface</module>
116
- <frontName>epoqinterface</frontName>
117
- </args>
118
- </epoqinterface>
119
- </routers>
120
- </frontend>
121
 
122
  <adminhtml>
123
  <acl>
@@ -156,6 +163,7 @@
156
  <timeout>2</timeout>
157
  <demo>0</demo>
158
  <customer_profiles>0</customer_profiles>
 
159
  </config>
160
  <display_recommendation>
161
  <user>1</user>
@@ -177,7 +185,5 @@
177
  <rest_failure_counter>0</rest_failure_counter>
178
  </epoqinterface>
179
  </system>
180
- </default>
181
-
182
-
183
- </config>
12
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
13
  * Public License for more details. *
14
  * *
15
+ * @version $Id: config.xml 666 2011-07-06 13:44:33Z rieker $
16
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
17
  */
18
  -->
20
  <modules>
21
  <Flagbit_EpoqInterface>
22
  <active>true</active>
23
+ <version>1.1.6</version>
24
  </Flagbit_EpoqInterface>
25
  </modules>
26
+
27
  <global>
 
28
  <helpers>
29
  <epoqinterface>
30
  <class>Flagbit_EpoqInterface_Helper</class>
31
  </epoqinterface>
32
  </helpers>
 
33
  <blocks>
34
  <epoqinterface>
35
  <class>Flagbit_EpoqInterface_Block</class>
38
  <models>
39
  <epoqinterface>
40
  <class>Flagbit_EpoqInterface_Model</class>
41
+ <resourceModel>epoqinterface_mysql4</resourceModel>
42
  </epoqinterface>
43
+ <epoqinterface_mysql4>
44
+ <class>Flagbit_EpoqInterface_Model_Resource_Eav_Mysql4</class>
45
+ </epoqinterface_mysql4>
46
  </models>
47
+ <rewrite>
48
+ <epoqinterface>
49
+ <from><![CDATA[#^/epoqinterface/#]]></from>
50
+ <to>/epoqinterface/index/productlist/</to>
51
+ </epoqinterface>
52
+ </rewrite>
53
+ </global>
54
+
55
+ <frontend>
56
+ <layout>
57
+ <updates>
58
+ <epoqinterface>
59
+ <file>epoqinterface.xml</file>
60
+ </epoqinterface>
61
+ </updates>
62
+ </layout>
63
+ <routers>
64
+ <epoqinterface>
65
+ <use>standard</use>
66
+ <args>
67
+ <module>Flagbit_EpoqInterface</module>
68
+ <frontName>epoqinterface</frontName>
69
+ </args>
70
+ </epoqinterface>
71
+ </routers>
72
  <events>
73
  <checkout_cart_product_add_after>
74
  <observers>
97
  </epoqinterface>
98
  </observers>
99
  </controller_action_predispatch_checkout_cart_delete>
100
+ <sales_order_place_after>
101
  <observers>
102
  <epoqinterface>
103
  <type>singleton</type>
104
  <class>epoqinterface/observer</class>
105
+ <method>salesOrderPlaceAfter</method>
106
  </epoqinterface>
107
  </observers>
108
+ </sales_order_place_after>
109
+
110
+ <checkout_onepage_controller_success_action>
111
  <observers>
112
+ <epoqinterface_order_success>
 
113
  <class>epoqinterface/observer</class>
114
+ <method>setTrackOnOrderSuccessPageView</method>
115
+ </epoqinterface_order_success>
116
+ </observers>
117
+ </checkout_onepage_controller_success_action>
118
+ <checkout_multishipping_controller_success_action>
119
+ <observers>
120
+ <epoqinterface_order_success>
121
+ <class>epoqinterface/observer</class>
122
+ <method>setTrackOnOrderSuccessPageView</method>
123
+ </epoqinterface_order_success>
124
+ </observers>
125
+ </checkout_multishipping_controller_success_action>
126
+ </events>
127
+ </frontend>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
  <adminhtml>
130
  <acl>
163
  <timeout>2</timeout>
164
  <demo>0</demo>
165
  <customer_profiles>0</customer_profiles>
166
+ <debug>0</debug>
167
  </config>
168
  <display_recommendation>
169
  <user>1</user>
185
  <rest_failure_counter>0</rest_failure_counter>
186
  </epoqinterface>
187
  </system>
188
+ </default>
189
+ </config>
 
 
app/code/community/Flagbit/EpoqInterface/etc/system.xml CHANGED
@@ -12,7 +12,7 @@
12
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
13
  * Public License for more details. *
14
  * *
15
- * @version $Id: system.xml 245 2009-08-25 14:57:47Z tuerk $
16
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
17
  */
18
  -->
@@ -69,7 +69,16 @@
69
  <show_in_default>1</show_in_default>
70
  <show_in_website>1</show_in_website>
71
  <show_in_store>1</show_in_store>
72
- </demo>
 
 
 
 
 
 
 
 
 
73
  <!-- customer_profiles translate="label">
74
  <label>Send Customer Profiles</label>
75
  <frontend_type>select</frontend_type>
12
  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
13
  * Public License for more details. *
14
  * *
15
+ * @version $Id: system.xml 660 2011-06-10 14:09:05Z weller $
16
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
17
  */
18
  -->
69
  <show_in_default>1</show_in_default>
70
  <show_in_website>1</show_in_website>
71
  <show_in_store>1</show_in_store>
72
+ </demo>
73
+ <debug translate="label">
74
+ <label>Debug Log (var/log/epoq.log)</label>
75
+ <frontend_type>select</frontend_type>
76
+ <source_model>adminhtml/system_config_source_yesno</source_model>
77
+ <sort_order>40</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>1</show_in_website>
80
+ <show_in_store>1</show_in_store>
81
+ </debug>
82
  <!-- customer_profiles translate="label">
83
  <label>Send Customer Profiles</label>
84
  <frontend_type>select</frontend_type>
app/design/frontend/base/default/layout/epoqinterface.xml CHANGED
@@ -45,15 +45,15 @@
45
  </checkout_cart_index>
46
 
47
  <checkout_multishipping_success>
48
- <reference name="content">
49
- <block type="epoqinterface/track_cart" name="epoqinterface.track.cart"/>
50
- </reference>
51
  </checkout_multishipping_success>
52
 
53
  <checkout_onepage_success>
54
- <reference name="content">
55
- <block type="epoqinterface/track_cart" name="epoqinterface.track.cart"/>
56
- </reference>
57
  </checkout_onepage_success>
58
 
59
  <customer_account_index>
45
  </checkout_cart_index>
46
 
47
  <checkout_multishipping_success>
48
+ <reference name="before_body_end">
49
+ <block type="epoqinterface/track_order" name="epoqinterface_track_order" as="epoqinterface_track_order"/>
50
+ </reference>
51
  </checkout_multishipping_success>
52
 
53
  <checkout_onepage_success>
54
+ <reference name="before_body_end">
55
+ <block type="epoqinterface/track_order" name="epoqinterface_track_order" as="epoqinterface_track_order"/>
56
+ </reference>
57
  </checkout_onepage_success>
58
 
59
  <customer_account_index>
app/design/frontend/default/default/layout/epoqinterface.xml ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /* *
4
+ * This script is part of the epoq Recommendation Service project *
5
+ * *
6
+ * TypoGento is free software; you can redistribute it and/or modify it *
7
+ * under the terms of the GNU General Public License version 2 as *
8
+ * published by the Free Software Foundation. *
9
+ * *
10
+ * This script is distributed in the hope that it will be useful, but *
11
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
12
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
13
+ * Public License for more details. *
14
+ * *
15
+ * @version $Id: epoqinterface.xml 660 2011-06-10 14:09:05Z weller $
16
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
17
+ */
18
+ -->
19
+ <layout version="0.1.0">
20
+
21
+ <default>
22
+ <reference name="head">
23
+ <block type="epoqinterface/head" name="epoqinterface_head"/>
24
+ </reference>
25
+ </default>
26
+
27
+ <catalog_product_view>
28
+ <reference name="content">
29
+ <block type="epoqinterface/track_product" name="epoqinterface.track.product"/>
30
+ <reference name="product.info.additional">
31
+ <block type="epoqinterface/recommentation_product" name="epoqinterface.recommendation.product" template="epoqinterface/recommendation/product.phtml">
32
+ <!-- <action method="setRules"><rules>name(value)</rules></action> -->
33
+ </block>
34
+ </reference>
35
+ </reference>
36
+ </catalog_product_view>
37
+
38
+ <checkout_cart_index>
39
+ <reference name="content">
40
+ <block type="epoqinterface/track_cart" name="epoqinterface.track.cart"/>
41
+ <reference name="checkout.cart">
42
+ <block type="epoqinterface/recommentation_cart" name="epoqinterface.recommendation.cart" template="epoqinterface/recommendation/cart.phtml"/>
43
+ </reference>
44
+ </reference>
45
+ </checkout_cart_index>
46
+
47
+ <checkout_multishipping_success>
48
+ <reference name="before_body_end">
49
+ <block type="epoqinterface/track_order" name="epoqinterface_track_order" as="epoqinterface_track_order"/>
50
+ </reference>
51
+ </checkout_multishipping_success>
52
+
53
+ <checkout_onepage_success>
54
+ <reference name="before_body_end">
55
+ <block type="epoqinterface/track_order" name="epoqinterface_track_order" as="epoqinterface_track_order"/>
56
+ </reference>
57
+ </checkout_onepage_success>
58
+
59
+ <customer_account_index>
60
+ <reference name="customer_account_dashboard">
61
+ <block type="epoqinterface/recommentation_user" name="epoqinterface.recommendation.user" as="info1" template="epoqinterface/recommendation/user.phtml"/>
62
+ </reference>
63
+ </customer_account_index>
64
+
65
+ <epoqinterface_index_productlist>
66
+ <block type="epoqinterface/export_productlist" output="toHtml" name="epoqinterface.productlist"/>
67
+ </epoqinterface_index_productlist>
68
+ </layout>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>epoqRS</name>
4
- <version>1.1.2</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
@@ -15,9 +15,9 @@
15
  <notes>- Minor bugfixes
16
  - Added Enterprise 1.9 Fullpagecache compatibility</notes>
17
  <authors><author><name>Flagbit GmbH Co. KG</name><user>auto-converted</user><email>magento@flagbit.de</email></author></authors>
18
- <date>2010-11-22</date>
19
- <time>20:00:53</time>
20
- <contents><target name="magelocale"><dir name="de_DE"><file name="Flagbit_EpoqInterface.csv" hash="5643b01f9cbebd4ce9317d839a2e428b"/></dir></target><target name="magecommunity"><dir name="Flagbit"><dir name="EpoqInterface"><dir name="Block"><dir name="Export"><file name="Productlist.php" hash="0f570e5c7e11b7c2f0541620c1e0eeca"/></dir><dir name="Recommentation"><file name="Abstract.php" hash="cfae612e74727fcb3282ba5facd360a3"/><file name="Cart.php" hash="a5c689e8cfcf9f3c8f07b88d07003684"/><file name="Product.php" hash="d638397d1445e330997d1a57d60ce5d0"/><file name="User.php" hash="1e8b594b8c54fb475e4595dbe39059fc"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Version.php" hash="71e3964c13333a57929221aa8e2edf07"/></dir></dir></dir></dir><dir name="Track"><file name="Cart.php" hash="4e0ce66e9832296aa7539f0573e712f1"/><file name="Product.php" hash="24de1ef7d04e2356c943f27dc962aa60"/></dir><file name="Abstract.php" hash="a89d2de3e728db99459102a2c54c4a19"/><file name="Head.php" hash="b6844d21b14dc9ebb1697be9e12a57f9"/></dir><dir name="controllers"><file name="IndexController.php" hash="6a5dbe8275701af11cd07b59ff57f4a8"/></dir><dir name="documentation"><file name="Installation_Guide_Magento_epoq_RS_1.0.0.pdf" hash="0227444742853b68a6f600404dc0a92d"/></dir><dir name="etc"><file name="cache.xml" hash="d3698a0b91a9aa83cca30b0f35b1270f"/><file name="config.xml" hash="9a9c892c74a9a1dd49aade55fa3e593c"/><file name="system.xml" hash="be045020f604fcb0fe73c086cea8d3f2"/></dir><dir name="Helper"><file name="Data.php" hash="d838c052155e9263c1aaee676b29ced3"/></dir><dir name="Model"><dir name="Container"><file name="Product.php" hash="bb25e96a4159584c9701854d51962e52"/><file name="TrackProduct.php" hash="f95bbb60d7344859f71bd13b22d587c7"/></dir><dir name="Customer"><file name="Profiles.php" hash="fbedb6a3259a29db05b2c8783d02957b"/></dir><dir name="Recommendation"><file name="Abstract.php" hash="8ab50a9132dd79ecc0e216ccb326a5c2"/><file name="Cart.php" hash="fb66d1db5a156e7a89de52c4cfbc30ce"/><file name="Product.php" hash="ac0b68271069f594367328000d28e993"/><file name="User.php" hash="549e3ba3efe4035c47a7a6c8b13eb39f"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Attemps.php" hash="c01ebd5c76fd4d51305ed7111326d57d"/><file name="Idletime.php" hash="957ec9d0c4af2d52add60a9765c4e573"/><file name="Timeout.php" hash="95c38625ad50dc44ba2b2d371de1db65"/></dir></dir></dir><file name="Abstract.php" hash="0f7a742aec56269ded3152e66f3c9c2c"/><file name="Observer.php" hash="6a8bfa71b605dcf37874542e1d721a87"/><file name="Session.php" hash="413f7d31ad2d5878f20a7db7adf5d207"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="epoqinterface.xml" hash="41bcb5bd071cde519b317aad3d8df8fb"/></dir><dir name="template"><dir name="epoqinterface"><dir name="recommendation"><file name="cart.phtml" hash="e3246573dda615454289ff1d39d1a172"/><file name="product.phtml" hash="a6daaf727c1d4b2db7a65772883725bf"/><file name="user.phtml" hash="0c5584382092f0b469d054d08297ba8b"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Flagbit_EpoqInterface.xml" hash="8ada99bfdbcc7727ad36339bc11da6ec"/></dir></target></contents>
21
  <compatible/>
22
  <dependencies/>
23
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>epoqRS</name>
4
+ <version>1.1.6</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
15
  <notes>- Minor bugfixes
16
  - Added Enterprise 1.9 Fullpagecache compatibility</notes>
17
  <authors><author><name>Flagbit GmbH Co. KG</name><user>auto-converted</user><email>magento@flagbit.de</email></author></authors>
18
+ <date>2011-07-27</date>
19
+ <time>16:21:43</time>
20
+ <contents><target name="magelocale"><dir name="de_DE"><file name="Flagbit_EpoqInterface.csv" hash="5643b01f9cbebd4ce9317d839a2e428b"/></dir></target><target name="magecommunity"><dir name="Flagbit"><dir name="EpoqInterface"><dir name="Block"><dir name="Export"><file name="Productlist.php" hash="d499c6a4e1de52c255394388e901ea5f"/></dir><dir name="Recommentation"><file name="Abstract.php" hash="cfae612e74727fcb3282ba5facd360a3"/><file name="Cart.php" hash="a5c689e8cfcf9f3c8f07b88d07003684"/><file name="Product.php" hash="d638397d1445e330997d1a57d60ce5d0"/><file name="User.php" hash="1e8b594b8c54fb475e4595dbe39059fc"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Version.php" hash="71e3964c13333a57929221aa8e2edf07"/></dir></dir></dir></dir><dir name="Track"><file name="Cart.php" hash="4e0ce66e9832296aa7539f0573e712f1"/><file name="Order.php" hash="c707b8713c18d5cf461cecd0599d4308"/><file name="Product.php" hash="dd686a4945efe302cdb5902beaad9626"/></dir><file name="Abstract.php" hash="8bdcabd1d0c8ed69410562912516e59f"/><file name="Head.php" hash="b6844d21b14dc9ebb1697be9e12a57f9"/></dir><dir name="controllers"><file name="IndexController.php" hash="3bafbecbbb637b6b9a57c45d21c182cf"/></dir><dir name="documentation"><file name="Installation_Guide_Magento_epoq_RS_1.0.0.pdf" hash="0227444742853b68a6f600404dc0a92d"/></dir><dir name="etc"><file name="cache.xml" hash="d3698a0b91a9aa83cca30b0f35b1270f"/><file name="config.xml" hash="5654bb0b42eb4957a55d5f54265632be"/><file name="system.xml" hash="926c4e860754bf4eaad428c62ac236c1"/></dir><dir name="Helper"><file name="Data.php" hash="cda2b853bd923e033de47f87faf6bd78"/><file name="Debug.php" hash="7ab1e3121471d87ee59f02d129f308be"/></dir><dir name="Model"><dir name="Container"><file name="Product.php" hash="bb25e96a4159584c9701854d51962e52"/><file name="TrackProduct.php" hash="f95bbb60d7344859f71bd13b22d587c7"/></dir><dir name="Customer"><file name="Profiles.php" hash="fbedb6a3259a29db05b2c8783d02957b"/></dir><dir name="Recommendation"><file name="Abstract.php" hash="802bc1c01c3bd2b5053e07e8ee9d36eb"/><file name="Cart.php" hash="69de1db1a05bef9f795e6e4de45617af"/><file name="Product.php" hash="a86b84718495e92ffe0eb470c21f3d01"/><file name="User.php" hash="549e3ba3efe4035c47a7a6c8b13eb39f"/></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><dir name="Product"><file name="Collection.php" hash="a4f75912e9ab77fd4346ae1f949756ed"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Attemps.php" hash="c01ebd5c76fd4d51305ed7111326d57d"/><file name="Idletime.php" hash="957ec9d0c4af2d52add60a9765c4e573"/><file name="Timeout.php" hash="95c38625ad50dc44ba2b2d371de1db65"/></dir></dir></dir><file name="Abstract.php" hash="8e0b0fb6c149dac3df1a34ec886f1b6d"/><file name="Observer.php" hash="b164a1415ed688a38d6f684da82cf852"/><file name="Order.php" hash="b325cd7eb4723b47d87af480669701e6"/><file name="Session.php" hash="413f7d31ad2d5878f20a7db7adf5d207"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="epoqinterface.xml" hash="8deb118ffaded408e2f135934a2c34fb"/></dir><dir name="template"><dir name="epoqinterface"><dir name="recommendation"><file name="cart.phtml" hash="e3246573dda615454289ff1d39d1a172"/><file name="product.phtml" hash="a6daaf727c1d4b2db7a65772883725bf"/><file name="user.phtml" hash="0c5584382092f0b469d054d08297ba8b"/></dir></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="epoqinterface.xml" hash="d76009f0b7326fce1e3e300592930c74"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Flagbit_EpoqInterface.xml" hash="8ada99bfdbcc7727ad36339bc11da6ec"/></dir></target></contents>
21
  <compatible/>
22
  <dependencies/>
23
  </package>