Version Notes
- Minor Bugfixes
- Ajax support
- Cookies
- Transmission of SKU / ProduktId
- Newsletter Template
Download this release
Release Info
Developer | Flagbit GmbH |
Extension | epoqRS |
Version | 1.2.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.8 to 1.2.0
- app/code/community/Flagbit/EpoqInterface/Block/Abstract.php +12 -7
- app/code/community/Flagbit/EpoqInterface/Block/Export/Productlist.php +17 -6
- app/code/community/Flagbit/EpoqInterface/Block/Head.php +7 -1
- app/code/community/Flagbit/EpoqInterface/Block/{Recommentation → Recommendation}/Abstract.php +2 -2
- app/code/community/Flagbit/EpoqInterface/Block/Recommendation/Ajaxproduct.php +106 -0
- app/code/community/Flagbit/EpoqInterface/Block/{Recommentation → Recommendation}/Cart.php +1 -1
- app/code/community/Flagbit/EpoqInterface/Block/{Recommentation → Recommendation}/Product.php +11 -3
- app/code/community/Flagbit/EpoqInterface/Block/{Recommentation → Recommendation}/User.php +1 -1
- app/code/community/Flagbit/EpoqInterface/Block/Result/List.php +78 -0
- app/code/community/Flagbit/EpoqInterface/Block/Track/Cart.php +8 -7
- app/code/community/Flagbit/EpoqInterface/Block/Track/Order.php +29 -7
- app/code/community/Flagbit/EpoqInterface/Block/Track/Product.php +7 -6
- app/code/community/Flagbit/EpoqInterface/Helper/Data.php +78 -6
- app/code/community/Flagbit/EpoqInterface/Model/Abstract.php +8 -2
- app/code/community/Flagbit/EpoqInterface/Model/Recommendation/Abstract.php +2 -2
- app/code/community/Flagbit/EpoqInterface/Model/Recommendation/Cart.php +2 -2
- app/code/community/Flagbit/EpoqInterface/Model/Resource/Eav/Mysql4/Product/Collection.php +74 -3
- app/code/community/Flagbit/EpoqInterface/Model/System/Config/Source/Identifier.php +37 -0
- app/code/community/Flagbit/EpoqInterface/controllers/IndexController.php +5 -7
- app/code/community/Flagbit/EpoqInterface/controllers/RecommendationController.php +23 -0
- app/code/community/Flagbit/EpoqInterface/etc/cache.xml +3 -3
- app/code/community/Flagbit/EpoqInterface/etc/config.xml +4 -2
- app/code/community/Flagbit/EpoqInterface/etc/system.xml +30 -4
- app/design/frontend/base/default/layout/epoqinterface.xml +4 -4
- app/design/frontend/base/default/template/epoqinterface/recommendation/cart.phtml +5 -5
- app/design/frontend/base/default/template/epoqinterface/recommendation/checkout.phtml +27 -0
- app/design/frontend/base/default/template/epoqinterface/recommendation/list.phtml +128 -0
- app/design/frontend/base/default/template/epoqinterface/recommendation/mailproduct.phtml +81 -0
- app/design/frontend/base/default/template/epoqinterface/recommendation/product.phtml +13 -12
- app/design/frontend/base/default/template/epoqinterface/recommendation/user.phtml +5 -5
- app/design/frontend/default/default/layout/epoqinterface.xml +4 -4
- app/design/frontend/default/default/template/epoqinterface/recommendation/cart.phtml +59 -0
- app/design/frontend/default/default/template/epoqinterface/recommendation/list.phtml +126 -0
- app/design/frontend/default/default/template/epoqinterface/recommendation/product.phtml +60 -0
- app/design/frontend/default/default/template/epoqinterface/recommendation/user.phtml +60 -0
- app/locale/de_DE/Flagbit_EpoqInterface.csv +5 -1
- js/epoqinterface/epoq_recommendations.js +66 -0
- package.xml +17 -13
app/code/community/Flagbit/EpoqInterface/Block/Abstract.php
CHANGED
@@ -19,7 +19,10 @@ class Flagbit_EpoqInterface_Block_Abstract extends Mage_Core_Block_Abstract
|
|
19 |
{
|
20 |
|
21 |
const XML_TENANT_ID_PATH = 'epoqinterface/config/tenant_id';
|
22 |
-
|
|
|
|
|
|
|
23 |
protected $_product = null;
|
24 |
|
25 |
|
@@ -40,19 +43,20 @@ class Flagbit_EpoqInterface_Block_Abstract extends Mage_Core_Block_Abstract
|
|
40 |
|
41 |
$variables = array(
|
42 |
'epoq_tenantId' => Mage::getStoreConfig(self::XML_TENANT_ID_PATH),
|
43 |
-
'epoq_sessionId' => Mage::getSingleton('core/session')->getSessionId(),
|
|
|
44 |
);
|
45 |
|
46 |
if($customerId = Mage::getSingleton('customer/session')->getId()){
|
47 |
$variables['epoq_customerId'] = $customerId;
|
48 |
}
|
49 |
|
50 |
-
if($this->getRequest()->getParam('
|
51 |
-
$variables['epoq_recommendationId'] = $this->getRequest()->getParam('
|
52 |
}
|
53 |
/*
|
54 |
-
if($this->
|
55 |
-
$variables['
|
56 |
}*/
|
57 |
|
58 |
return $variables;
|
@@ -194,7 +198,8 @@ class Flagbit_EpoqInterface_Block_Abstract extends Mage_Core_Block_Abstract
|
|
194 |
public function getProduct()
|
195 |
{
|
196 |
if($this->_product === null){
|
197 |
-
|
|
|
198 |
$this->_product = Mage::getSingleton('catalog/product')->load($productId);
|
199 |
}
|
200 |
return $this->_product;
|
19 |
{
|
20 |
|
21 |
const XML_TENANT_ID_PATH = 'epoqinterface/config/tenant_id';
|
22 |
+
const XML_AJAX_ENABLED = 'epoqinterface/config/ajax';
|
23 |
+
const XML_DEMO_PATH = 'epoqinterface/config/demo';
|
24 |
+
|
25 |
+
protected $_lastRecommendationId = null;
|
26 |
protected $_product = null;
|
27 |
|
28 |
|
43 |
|
44 |
$variables = array(
|
45 |
'epoq_tenantId' => Mage::getStoreConfig(self::XML_TENANT_ID_PATH),
|
46 |
+
'epoq_sessionId' => (!Mage::getStoreConfig(self::XML_AJAX_ENABLED) ? Mage::getSingleton('core/session')->getSessionId() : ''),
|
47 |
+
'epoq_demoMode' => Mage::getStoreConfig(self::XML_DEMO_PATH) ? 6 : '',
|
48 |
);
|
49 |
|
50 |
if($customerId = Mage::getSingleton('customer/session')->getId()){
|
51 |
$variables['epoq_customerId'] = $customerId;
|
52 |
}
|
53 |
|
54 |
+
if($this->getRequest()->getParam('recommendation_id')){
|
55 |
+
$variables['epoq_recommendationId'] = $this->getRequest()->getParam('recommendation_id');
|
56 |
}
|
57 |
/*
|
58 |
+
if($this->_lastRecommendationId !== null){
|
59 |
+
$variables['epoq_RecommendationId'] = $this->_lastRecommendationId;
|
60 |
}*/
|
61 |
|
62 |
return $variables;
|
198 |
public function getProduct()
|
199 |
{
|
200 |
if($this->_product === null){
|
201 |
+
// always receive the id to load product. not whats set in the backend
|
202 |
+
$productId = Mage::helper('epoqinterface')->getProductId('entity_id');
|
203 |
$this->_product = Mage::getSingleton('catalog/product')->load($productId);
|
204 |
}
|
205 |
return $this->_product;
|
app/code/community/Flagbit/EpoqInterface/Block/Export/Productlist.php
CHANGED
@@ -43,6 +43,8 @@ class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterfa
|
|
43 |
$elemRss->setAttribute ( 'xmlns:g' , 'http://base.google.com/ns/1.0' );
|
44 |
$elemRss->setAttribute ( 'xmlns:e' , 'http://base.google.com/cns/1.0' );
|
45 |
$elemRss->setAttribute ( 'xmlns:c' , 'http://base.google.com/cns/1.0' );
|
|
|
|
|
46 |
$xmlObj->appendChild( $elemRss );
|
47 |
|
48 |
// add Channel Element
|
@@ -58,7 +60,7 @@ class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterfa
|
|
58 |
->joinField('qty',
|
59 |
'cataloginventory/stock_item',
|
60 |
'qty',
|
61 |
-
'product_id=
|
62 |
'{{table}}.stock_id=1',
|
63 |
'left')
|
64 |
->addAttributeToSelect(array('name', 'short_description', 'price', 'image'), 'inner');
|
@@ -71,7 +73,7 @@ class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterfa
|
|
71 |
|
72 |
Mage::helper('epoqinterface/debug')->log('Export select query: '.(string) $products->getSelect());
|
73 |
|
74 |
-
|
75 |
//Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
|
76 |
|
77 |
/*
|
@@ -108,6 +110,9 @@ class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterfa
|
|
108 |
if(method_exists($product, 'getParentProductIds')){
|
109 |
$product->loadParentProductIds();
|
110 |
$parentProduct = $product->getParentProductIds();
|
|
|
|
|
|
|
111 |
}
|
112 |
|
113 |
// get Productcategory
|
@@ -125,7 +130,8 @@ class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterfa
|
|
125 |
'link' => $product->getProductUrl(),
|
126 |
|
127 |
// g Namespace
|
128 |
-
'g:
|
|
|
129 |
'description' => $product->getShortDescription(),
|
130 |
'g:price' => $this->getProductPrice($product),
|
131 |
'g:image_link' => (string) $this->helper('catalog/image')->init($product, 'image'),
|
@@ -153,7 +159,8 @@ class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterfa
|
|
153 |
}
|
154 |
if($product->isConfigurable()
|
155 |
&& $product->getTypeInstance(true) instanceof Mage_Catalog_Model_Product_Type_Configurable){
|
156 |
-
$data['e:
|
|
|
157 |
}
|
158 |
|
159 |
// add Product Attributes
|
@@ -195,13 +202,17 @@ class Flagbit_EpoqInterface_Block_Export_Productlist extends Flagbit_EpoqInterfa
|
|
195 |
* @param Mage_Catalog_Model_Product $product
|
196 |
* @return array
|
197 |
*/
|
198 |
-
protected function _getVariantIds($product){
|
199 |
|
200 |
$childProducts = $product->getTypeInstance(true)->getUsedProducts(null, $product);
|
201 |
$childProductIds = array();
|
202 |
foreach((array) $childProducts as $childProduct){
|
203 |
if ($childProduct->isSaleable()) {
|
204 |
-
$
|
|
|
|
|
|
|
|
|
205 |
}
|
206 |
}
|
207 |
return $childProductIds;
|
43 |
$elemRss->setAttribute ( 'xmlns:g' , 'http://base.google.com/ns/1.0' );
|
44 |
$elemRss->setAttribute ( 'xmlns:e' , 'http://base.google.com/cns/1.0' );
|
45 |
$elemRss->setAttribute ( 'xmlns:c' , 'http://base.google.com/cns/1.0' );
|
46 |
+
$elemRss->setAttribute ( 'magento' , Mage::getVersion() );
|
47 |
+
$elemRss->setAttribute ( 'epoq' , (string) Mage::getConfig()->getNode()->modules->Flagbit_EpoqInterface->version );
|
48 |
$xmlObj->appendChild( $elemRss );
|
49 |
|
50 |
// add Channel Element
|
60 |
->joinField('qty',
|
61 |
'cataloginventory/stock_item',
|
62 |
'qty',
|
63 |
+
'product_id='.Mage::helper('epoqinterface')->getIdFieldName(),
|
64 |
'{{table}}.stock_id=1',
|
65 |
'left')
|
66 |
->addAttributeToSelect(array('name', 'short_description', 'price', 'image'), 'inner');
|
73 |
|
74 |
Mage::helper('epoqinterface/debug')->log('Export select query: '.(string) $products->getSelect());
|
75 |
|
76 |
+
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
|
77 |
//Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
|
78 |
|
79 |
/*
|
110 |
if(method_exists($product, 'getParentProductIds')){
|
111 |
$product->loadParentProductIds();
|
112 |
$parentProduct = $product->getParentProductIds();
|
113 |
+
} elseif (method_exists($product, 'getParentIdsByChild')) {
|
114 |
+
$objConfigurableProduct = Mage::getModel('catalog/product_type_configurable');
|
115 |
+
$parentProduct = $objConfigurableProduct->getParentIdsByChild($product);
|
116 |
}
|
117 |
|
118 |
// get Productcategory
|
130 |
'link' => $product->getProductUrl(),
|
131 |
|
132 |
// g Namespace
|
133 |
+
'g:entity_id' => $product->getId(),
|
134 |
+
'g:id' => $product->getData(Mage::helper('epoqinterface')->getIdFieldName()),
|
135 |
'description' => $product->getShortDescription(),
|
136 |
'g:price' => $this->getProductPrice($product),
|
137 |
'g:image_link' => (string) $this->helper('catalog/image')->init($product, 'image'),
|
159 |
}
|
160 |
if($product->isConfigurable()
|
161 |
&& $product->getTypeInstance(true) instanceof Mage_Catalog_Model_Product_Type_Configurable){
|
162 |
+
$data['e:variants_id'] = implode(',', $this->_getVariantIds($product));
|
163 |
+
$data['e:variants_sku'] = implode(',', $this->_getVariantIds($product, 'sku'));
|
164 |
}
|
165 |
|
166 |
// add Product Attributes
|
202 |
* @param Mage_Catalog_Model_Product $product
|
203 |
* @return array
|
204 |
*/
|
205 |
+
protected function _getVariantIds($product, $type = 'id'){
|
206 |
|
207 |
$childProducts = $product->getTypeInstance(true)->getUsedProducts(null, $product);
|
208 |
$childProductIds = array();
|
209 |
foreach((array) $childProducts as $childProduct){
|
210 |
if ($childProduct->isSaleable()) {
|
211 |
+
if ($type == 'id') {
|
212 |
+
$childProductIds[] = $childProduct->getId();
|
213 |
+
} else {
|
214 |
+
$childProductIds[] = $childProduct->getSku();
|
215 |
+
}
|
216 |
}
|
217 |
}
|
218 |
return $childProductIds;
|
app/code/community/Flagbit/EpoqInterface/Block/Head.php
CHANGED
@@ -36,7 +36,13 @@ class Flagbit_EpoqInterface_Block_Head extends Mage_Core_Block_Abstract
|
|
36 |
$html .= 'document.write(unescape("%3Cscript src=\'" + eqJsHost + "rs.epoq.de/web-api/epoq.js\' type=\'text/javascript\'%3E%3C/script%3E"));' . "\n";
|
37 |
$html .= '//]]>' . "\n";
|
38 |
$html .= '</script>' . "\n";
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
return $html;
|
41 |
}
|
42 |
}
|
36 |
$html .= 'document.write(unescape("%3Cscript src=\'" + eqJsHost + "rs.epoq.de/web-api/epoq.js\' type=\'text/javascript\'%3E%3C/script%3E"));' . "\n";
|
37 |
$html .= '//]]>' . "\n";
|
38 |
$html .= '</script>' . "\n";
|
39 |
+
|
40 |
+
if(Mage::getStoreConfig(Flagbit_EpoqInterface_Block_Recommendation_Product::XML_USING_AJAX)){
|
41 |
+
$html .= '<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>'."\n";
|
42 |
+
$html .= '<script type="text/javascript" src="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS).'epoqinterface/jQuery_init.js"></script>' . "\n";
|
43 |
+
$html .= '<script type="text/javascript" src="http://rs.epoq.de/web-api/epoqgo.js"></script>'."\n";
|
44 |
+
}
|
45 |
+
|
46 |
return $html;
|
47 |
}
|
48 |
}
|
app/code/community/Flagbit/EpoqInterface/Block/{Recommentation → Recommendation}/Abstract.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
|
16 |
*/
|
17 |
|
18 |
-
class
|
19 |
{
|
20 |
protected $_columnCount = 4;
|
21 |
|
@@ -28,7 +28,7 @@ class Flagbit_EpoqInterface_Block_Recommentation_Abstract extends Mage_Catalog_B
|
|
28 |
protected function _prepareData()
|
29 |
{
|
30 |
|
31 |
-
$this->_itemCollection = Mage::
|
32 |
->addStoreFilter();
|
33 |
|
34 |
Mage::getResourceSingleton('checkout/cart')->addExcludeProductFilter($this->_itemCollection,
|
15 |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
|
16 |
*/
|
17 |
|
18 |
+
class Flagbit_EpoqInterface_Block_Recommendation_Abstract extends Mage_Catalog_Block_Product_Abstract
|
19 |
{
|
20 |
protected $_columnCount = 4;
|
21 |
|
28 |
protected function _prepareData()
|
29 |
{
|
30 |
|
31 |
+
$this->_itemCollection = Mage::getSingleton($this->_collectionModel, $this->getData())->getCollection()
|
32 |
->addStoreFilter();
|
33 |
|
34 |
Mage::getResourceSingleton('checkout/cart')->addExcludeProductFilter($this->_itemCollection,
|
app/code/community/Flagbit/EpoqInterface/Block/Recommendation/Ajaxproduct.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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: 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 |
+
|
18 |
+
class Flagbit_EpoqInterface_Block_Recommendation_Ajaxproduct extends Flagbit_EpoqInterface_Block_Recommendation_Abstract
|
19 |
+
{
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Retrieve loaded category collection
|
23 |
+
*
|
24 |
+
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
25 |
+
*/
|
26 |
+
public function getItemCollection()
|
27 |
+
{
|
28 |
+
// Zend_Debug::dump($this->getProductIds());
|
29 |
+
if (is_null($this->_productCollection))
|
30 |
+
{
|
31 |
+
$_layer = Mage::getModel('catalog/layer');
|
32 |
+
$this->_productCollection = Mage::getResourceModel('epoqinterface/product_collection');
|
33 |
+
$this->_productCollection->addIdFilter($this->getProductIds());
|
34 |
+
$this->_productCollection->setPageSize(count($this->getProductIds()));
|
35 |
+
$_layer->prepareProductCollection($this->_productCollection);
|
36 |
+
}
|
37 |
+
return $this->_productCollection;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function resetItemsIterator()
|
41 |
+
{
|
42 |
+
}
|
43 |
+
|
44 |
+
protected function _prepareData()
|
45 |
+
{
|
46 |
+
$this->getItems();
|
47 |
+
return $this;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Wrapper for standart strip_tags() function with extra functionality for html entities
|
52 |
+
*
|
53 |
+
* @param string $data
|
54 |
+
* @param string $allowableTags
|
55 |
+
* @param bool $allowHtmlEntities
|
56 |
+
*
|
57 |
+
* @return string
|
58 |
+
*/
|
59 |
+
|
60 |
+
public function stripTags($data, $allowableTags = null, $allowHtmlEntities = false)
|
61 |
+
{
|
62 |
+
if(method_exists(Mage_Catalog_Block_Product_List, __FUNCTION__))
|
63 |
+
{
|
64 |
+
return parent::stripTags($data, $allowableTags, $allowHtmlEntities);
|
65 |
+
}
|
66 |
+
|
67 |
+
$result = strip_tags($data, $allowableTags);
|
68 |
+
return $allowHtmlEntities ? $this->escapeHtml($result, $allowableTags) : $result;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Escape html entities
|
73 |
+
*
|
74 |
+
* @param mixed $data
|
75 |
+
* @param array $allowedTags
|
76 |
+
*
|
77 |
+
* @return mixed
|
78 |
+
*/
|
79 |
+
public function escapeHtml($data, $allowedTags = null)
|
80 |
+
{
|
81 |
+
if (is_array($data))
|
82 |
+
{
|
83 |
+
$result = array();
|
84 |
+
foreach ($data as $item)
|
85 |
+
{
|
86 |
+
$result[] = $this->escapeHtml($item);
|
87 |
+
}
|
88 |
+
} else {
|
89 |
+
if (strlen($data))
|
90 |
+
{
|
91 |
+
if (is_array($allowedTags) and !empty($allowedTags))
|
92 |
+
{
|
93 |
+
$allowed = implode('|', $allowedTags);
|
94 |
+
$result = preg_replace('/<([\/\s\r\n]*)(' . $allowed . ')([\/\s\r\n]*)>/si', '##$1$2$3##', $data);
|
95 |
+
$result = htmlspecialchars($result);
|
96 |
+
$result = preg_replace('/##([\/\s\r\n]*)(' . $allowed . ')([\/\s\r\n]*)##/si', '<$1$2$3>', $result);
|
97 |
+
} else {
|
98 |
+
$result = htmlspecialchars($data);
|
99 |
+
}
|
100 |
+
} else {
|
101 |
+
$result = $data;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
return $result;
|
105 |
+
}
|
106 |
+
}
|
app/code/community/Flagbit/EpoqInterface/Block/{Recommentation → Recommendation}/Cart.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
|
16 |
*/
|
17 |
|
18 |
-
class
|
19 |
{
|
20 |
|
21 |
protected $_collectionModel = 'epoqinterface/recommendation_cart';
|
15 |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
|
16 |
*/
|
17 |
|
18 |
+
class Flagbit_EpoqInterface_Block_Recommendation_Cart extends Flagbit_EpoqInterface_Block_Recommendation_Abstract
|
19 |
{
|
20 |
|
21 |
protected $_collectionModel = 'epoqinterface/recommendation_cart';
|
app/code/community/Flagbit/EpoqInterface/Block/{Recommentation → Recommendation}/Product.php
RENAMED
@@ -15,11 +15,12 @@
|
|
15 |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
|
16 |
*/
|
17 |
|
18 |
-
class
|
19 |
{
|
20 |
|
21 |
protected $_collectionModel = 'epoqinterface/recommendation_product';
|
22 |
-
const XML_STATUS_PATH = 'epoqinterface/display_recommendation/product';
|
|
|
23 |
|
24 |
/**
|
25 |
* Render block HTML
|
@@ -32,7 +33,14 @@ class Flagbit_EpoqInterface_Block_Recommentation_Product extends Flagbit_EpoqInt
|
|
32 |
if(!Mage::getStoreConfig(self::XML_STATUS_PATH)){
|
33 |
return '';
|
34 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
return parent::_toHtml();
|
37 |
-
}
|
38 |
}
|
15 |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
|
16 |
*/
|
17 |
|
18 |
+
class Flagbit_EpoqInterface_Block_Recommendation_Product extends Flagbit_EpoqInterface_Block_Recommendation_Abstract
|
19 |
{
|
20 |
|
21 |
protected $_collectionModel = 'epoqinterface/recommendation_product';
|
22 |
+
const XML_STATUS_PATH = 'epoqinterface/display_recommendation/product';
|
23 |
+
const XML_USING_AJAX = 'epoqinterface/config/ajax';
|
24 |
|
25 |
/**
|
26 |
* Render block HTML
|
33 |
if(!Mage::getStoreConfig(self::XML_STATUS_PATH)){
|
34 |
return '';
|
35 |
}
|
36 |
+
|
37 |
+
if(Mage::getStoreConfig(self::XML_USING_AJAX)){
|
38 |
+
$html = '';
|
39 |
+
$html .= '<p id="epoqWidget1"></p>'."\n";
|
40 |
+
$html .= '<script type="text/javascript" src="'.$this->getJsUrl('epoqinterface/epoq_recommendations.js').'"></script>'."\n";
|
41 |
+
return $html;
|
42 |
+
}
|
43 |
|
44 |
return parent::_toHtml();
|
45 |
+
}
|
46 |
}
|
app/code/community/Flagbit/EpoqInterface/Block/{Recommentation → Recommendation}/User.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
|
16 |
*/
|
17 |
|
18 |
-
class
|
19 |
{
|
20 |
|
21 |
protected $_collectionModel = 'epoqinterface/recommendation_user';
|
15 |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
|
16 |
*/
|
17 |
|
18 |
+
class Flagbit_EpoqInterface_Block_Recommendation_User extends Flagbit_EpoqInterface_Block_Recommendation_Abstract
|
19 |
{
|
20 |
|
21 |
protected $_collectionModel = 'epoqinterface/recommendation_user';
|
app/code/community/Flagbit/EpoqInterface/Block/Result/List.php
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Block Form
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_EpoqSearch
|
7 |
+
* @author Rouven Alexander Rieker <rouven.rieker@itabs.de>
|
8 |
+
*/
|
9 |
+
class Flagbit_EpoqInterface_Block_Result_List extends Mage_Catalog_Block_Product_List
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* Retrieve loaded category collection
|
13 |
+
*
|
14 |
+
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
15 |
+
*/
|
16 |
+
protected function _getProductCollection()
|
17 |
+
{
|
18 |
+
if (is_null($this->_productCollection)) {
|
19 |
+
$_layer = Mage::getModel('catalog/layer');
|
20 |
+
$this->_productCollection = Mage::getResourceModel('epoqinterface/product_collection');
|
21 |
+
$this->_productCollection->addIdFilter($this->getProductIds());
|
22 |
+
$this->_productCollection->setPageSize(count($this->getProductIds()));
|
23 |
+
$_layer->prepareProductCollection($this->_productCollection);
|
24 |
+
}
|
25 |
+
return $this->_productCollection;
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Wrapper for standart strip_tags() function with extra functionality for html entities
|
30 |
+
*
|
31 |
+
* @param string $data
|
32 |
+
* @param string $allowableTags
|
33 |
+
* @param bool $allowHtmlEntities
|
34 |
+
*
|
35 |
+
* @return string
|
36 |
+
*/
|
37 |
+
public function stripTags($data, $allowableTags = null, $allowHtmlEntities = false)
|
38 |
+
{
|
39 |
+
if(method_exists(Mage_Catalog_Block_Product_List, __FUNCTION__)){
|
40 |
+
return parent::stripTags($data, $allowableTags, $allowHtmlEntities);
|
41 |
+
}
|
42 |
+
$result = strip_tags($data, $allowableTags);
|
43 |
+
return $allowHtmlEntities ? $this->escapeHtml($result, $allowableTags) : $result;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Escape html entities
|
48 |
+
*
|
49 |
+
* @param mixed $data
|
50 |
+
* @param array $allowedTags
|
51 |
+
*
|
52 |
+
* @return mixed
|
53 |
+
*/
|
54 |
+
public function escapeHtml($data, $allowedTags = null)
|
55 |
+
{
|
56 |
+
if (is_array($data)) {
|
57 |
+
$result = array();
|
58 |
+
foreach ($data as $item) {
|
59 |
+
$result[] = $this->escapeHtml($item);
|
60 |
+
}
|
61 |
+
} else {
|
62 |
+
// process single item
|
63 |
+
if (strlen($data)) {
|
64 |
+
if (is_array($allowedTags) and !empty($allowedTags)) {
|
65 |
+
$allowed = implode('|', $allowedTags);
|
66 |
+
$result = preg_replace('/<([\/\s\r\n]*)(' . $allowed . ')([\/\s\r\n]*)>/si', '##$1$2$3##', $data);
|
67 |
+
$result = htmlspecialchars($result);
|
68 |
+
$result = preg_replace('/##([\/\s\r\n]*)(' . $allowed . ')([\/\s\r\n]*)##/si', '<$1$2$3>', $result);
|
69 |
+
} else {
|
70 |
+
$result = htmlspecialchars($data);
|
71 |
+
}
|
72 |
+
} else {
|
73 |
+
$result = $data;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
return $result;
|
77 |
+
}
|
78 |
+
}
|
app/code/community/Flagbit/EpoqInterface/Block/Track/Cart.php
CHANGED
@@ -64,21 +64,22 @@ class Flagbit_EpoqInterface_Block_Track_Cart extends Flagbit_EpoqInterface_Block
|
|
64 |
$items = $this->getQuote()->getAllVisibleItems();
|
65 |
|
66 |
/*@var $item Mage_Sales_Model_Quote_Item */
|
67 |
-
foreach ($items as $key => $item)
|
68 |
-
|
69 |
if ($option = $item->getOptionByCode('simple_product')) {
|
70 |
-
|
71 |
$product = $option->getProduct();
|
72 |
-
$variables['epoq_variantOfList'][$key] = $item->getProduct()->
|
73 |
-
}else{
|
74 |
$product = $item->getProduct();
|
75 |
}
|
76 |
|
77 |
-
$variables['epoq_productIds'][$key] = $product->
|
78 |
$variables['epoq_quantities'][$key] = $item->getQty();
|
79 |
$variables['epoq_unitPrices'][$key] = $item->getPrice();
|
80 |
}
|
81 |
-
|
|
|
|
|
82 |
return $variables;
|
83 |
}
|
84 |
|
64 |
$items = $this->getQuote()->getAllVisibleItems();
|
65 |
|
66 |
/*@var $item Mage_Sales_Model_Quote_Item */
|
67 |
+
foreach ($items as $key => $item)
|
68 |
+
{
|
69 |
if ($option = $item->getOptionByCode('simple_product')) {
|
|
|
70 |
$product = $option->getProduct();
|
71 |
+
$variables['epoq_variantOfList'][$key] = $item->getProduct()->getData(Mage::helper('epoqinterface')->getIdFieldName());
|
72 |
+
} else {
|
73 |
$product = $item->getProduct();
|
74 |
}
|
75 |
|
76 |
+
$variables['epoq_productIds'][$key] = $product->getData(Mage::helper('epoqinterface')->getIdFieldName());
|
77 |
$variables['epoq_quantities'][$key] = $item->getQty();
|
78 |
$variables['epoq_unitPrices'][$key] = $item->getPrice();
|
79 |
}
|
80 |
+
|
81 |
+
$variables['epoq_tag'] = Mage::helper('epoqinterface')->getCookieStatus();
|
82 |
+
|
83 |
return $variables;
|
84 |
}
|
85 |
|
app/code/community/Flagbit/EpoqInterface/Block/Track/Order.php
CHANGED
@@ -44,6 +44,10 @@ class Flagbit_EpoqInterface_Block_Track_Order extends Flagbit_EpoqInterface_Bloc
|
|
44 |
'processCart');
|
45 |
}
|
46 |
|
|
|
|
|
|
|
|
|
47 |
return $output;
|
48 |
}
|
49 |
|
@@ -55,13 +59,31 @@ class Flagbit_EpoqInterface_Block_Track_Order extends Flagbit_EpoqInterface_Bloc
|
|
55 |
|
56 |
/*@var $item Mage_Sales_Model_Quote_Item */
|
57 |
foreach ($items as $key => $item){
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
$variables['epoq_unitPrices'][$key] = $this->jsQuoteEscape($item->getBasePrice());
|
66 |
}
|
67 |
|
44 |
'processCart');
|
45 |
}
|
46 |
|
47 |
+
if (Mage::helper('epoqinterface')->getCookieStatus()) {
|
48 |
+
$output .= '<img src="http'.(Mage::app()->getStore()->isCurrentlySecure()?'s':'').'://'. Mage::getStoreConfig('epoqinterface/config/tenant_id') . '.arc.epoq.de/inbound-servletapi/pixel.png?tenantId='.Mage::getStoreConfig('epoqinterface/config/tenant_id').'&" />';
|
49 |
+
}
|
50 |
+
|
51 |
return $output;
|
52 |
}
|
53 |
|
59 |
|
60 |
/*@var $item Mage_Sales_Model_Quote_Item */
|
61 |
foreach ($items as $key => $item){
|
62 |
+
|
63 |
+
// set parent id of simple for variantOfList
|
64 |
+
if ($item->getProductType() == 'configurable') {
|
65 |
+
|
66 |
+
// loop child products
|
67 |
+
foreach ($item->getChildrenItems() as $child) {
|
68 |
+
$simpleProduct = $child;
|
69 |
+
}
|
70 |
+
|
71 |
+
if (Mage::helper('epoqinterface')->getIdFieldName() != 'entity_id') {
|
72 |
+
$variables['epoq_variantOfList'][$key] = Mage::helper('epoqinterface')->getProductSkuById($item->getProductId());
|
73 |
+
} else {
|
74 |
+
$variables['epoq_variantOfList'][$key] = $item->getProductId();
|
75 |
+
}
|
76 |
+
} else {
|
77 |
+
$simpleProduct = $item;
|
78 |
+
}
|
79 |
+
|
80 |
+
// check if simple is a valid product to avoid error
|
81 |
+
if ($simpleProduct instanceof Mage_Sales_Model_Order_Item) {
|
82 |
+
$variables['epoq_productIds'][$key] = $this->jsQuoteEscape($simpleProduct->getData((Mage::helper('epoqinterface')->getIdFieldName()=='entity_id'?'product_id':Mage::helper('epoqinterface')->getIdFieldName())));
|
83 |
+
} else {
|
84 |
+
$variables['epoq_productIds'][$key] = '';
|
85 |
+
}
|
86 |
+
$variables['epoq_quantities'][$key] = $this->jsQuoteEscape($item->getQtyOrdered());
|
87 |
$variables['epoq_unitPrices'][$key] = $this->jsQuoteEscape($item->getBasePrice());
|
88 |
}
|
89 |
|
app/code/community/Flagbit/EpoqInterface/Block/Track/Product.php
CHANGED
@@ -26,11 +26,11 @@ class Flagbit_EpoqInterface_Block_Track_Product extends Flagbit_EpoqInterface_Bl
|
|
26 |
*/
|
27 |
protected function _construct(){
|
28 |
|
29 |
-
if($this->getSession()->
|
30 |
-
&& $this->
|
31 |
-
if(in_array($this->getProduct()->
|
32 |
|
33 |
-
$this->
|
34 |
}
|
35 |
}
|
36 |
|
@@ -55,7 +55,7 @@ class Flagbit_EpoqInterface_Block_Track_Product extends Flagbit_EpoqInterface_Bl
|
|
55 |
protected function getParamsArray(){
|
56 |
|
57 |
$variables = array(
|
58 |
-
'epoq_productId' => $this->getProduct()->
|
59 |
'epoq_name' => $this->getProduct()->getName(),
|
60 |
'epoq_price' => $this->getProductPrice($this->getProduct()),
|
61 |
'epoq_productUrl' => $this->getProduct()->getProductUrl(),
|
@@ -66,7 +66,8 @@ class Flagbit_EpoqInterface_Block_Track_Product extends Flagbit_EpoqInterface_Bl
|
|
66 |
'epoq_description' => $this->getProduct()->getDescription(),
|
67 |
'epoq_inStock' => ($this->getProduct()->isSaleable() ? 'true' : 'false'),
|
68 |
'epoq_attributes' => $this->getProductAttributes(),
|
69 |
-
'epoq_locakey' => substr(Mage::getSingleton('core/locale')->getLocale(), 0, 2)
|
|
|
70 |
);
|
71 |
|
72 |
return array_merge(parent::getParamsArray(), $variables);
|
26 |
*/
|
27 |
protected function _construct(){
|
28 |
|
29 |
+
if($this->getSession()->getLastRecommendationId()
|
30 |
+
&& $this->_lastRecommendationId === null){
|
31 |
+
if(in_array($this->getProduct()->getData(Mage::helper('epoqinterface')->getIdFieldName()), (array) $this->getSession()->getLastRecommendationProducts())){
|
32 |
|
33 |
+
$this->_lastRecommendationId = $this->getSession()->getLastRecommendationId();
|
34 |
}
|
35 |
}
|
36 |
|
55 |
protected function getParamsArray(){
|
56 |
|
57 |
$variables = array(
|
58 |
+
'epoq_productId' => $this->getProduct()->getData(Mage::helper('epoqinterface')->getIdFieldName()),
|
59 |
'epoq_name' => $this->getProduct()->getName(),
|
60 |
'epoq_price' => $this->getProductPrice($this->getProduct()),
|
61 |
'epoq_productUrl' => $this->getProduct()->getProductUrl(),
|
66 |
'epoq_description' => $this->getProduct()->getDescription(),
|
67 |
'epoq_inStock' => ($this->getProduct()->isSaleable() ? 'true' : 'false'),
|
68 |
'epoq_attributes' => $this->getProductAttributes(),
|
69 |
+
'epoq_locakey' => substr(Mage::getSingleton('core/locale')->getLocale(), 0, 2),
|
70 |
+
'epoq_tag' => Mage::helper('epoqinterface')->getCookieStatus(),
|
71 |
);
|
72 |
|
73 |
return array_merge(parent::getParamsArray(), $variables);
|
app/code/community/Flagbit/EpoqInterface/Helper/Data.php
CHANGED
@@ -16,29 +16,76 @@
|
|
16 |
*/
|
17 |
class Flagbit_EpoqInterface_Helper_Data extends Mage_Core_Helper_Abstract
|
18 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
|
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
/**
|
22 |
* get current Product Id
|
|
|
23 |
*
|
24 |
* @return int
|
25 |
*/
|
26 |
-
public function getProductId()
|
27 |
{
|
28 |
$productId = null;
|
29 |
if(Mage::registry('current_product') instanceof Mage_Catalog_Model_Product
|
30 |
&& Mage::registry('current_product')->getId()){
|
31 |
-
$productId = Mage::registry('current_product')->
|
32 |
-
|
33 |
if(version_compare(Mage::getVersion(), '1.9.0', '<')
|
34 |
&& (string)Mage::getConfig()->getModuleConfig('Enterprise_PageCache')->active == 'true'){
|
35 |
$processor = Mage::getSingleton('enterprise_pagecache/processor');
|
36 |
$cacheId = $processor->getRequestCacheId() . '_current_product_id';
|
37 |
-
Mage::app()->saveCache(Mage::registry('current_product')->
|
38 |
}
|
39 |
|
40 |
}elseif((string)Mage::getConfig()->getModuleConfig('Enterprise_PageCache')->active == 'true'){
|
41 |
-
|
|
|
42 |
$cacheId = $processor->getRequestCacheId() . '_current_product_id';
|
43 |
if(Mage::app()->loadCache($cacheId)){
|
44 |
$productId = Mage::app()->loadCache($cacheId);
|
@@ -47,5 +94,30 @@ class Flagbit_EpoqInterface_Helper_Data extends Mage_Core_Helper_Abstract
|
|
47 |
|
48 |
return $productId;
|
49 |
}
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
}
|
16 |
*/
|
17 |
class Flagbit_EpoqInterface_Helper_Data extends Mage_Core_Helper_Abstract
|
18 |
{
|
19 |
+
/**
|
20 |
+
* XML Config Path to Product Identifier Setting
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
const XML_CONFIG_PATH_PRODUCT_IDENTIFIER = 'epoqinterface/config/identifier';
|
25 |
+
const XML_CONFIG_PATH_COOKIE_STATUS = 'epoqinterface/config/cookie';
|
26 |
|
27 |
+
protected $_skuToIdMapping;
|
28 |
|
29 |
+
/**
|
30 |
+
* get product sku by id faster than single lookup
|
31 |
+
*
|
32 |
+
* @param int $id
|
33 |
+
* @return string
|
34 |
+
*/
|
35 |
+
public function getProductSkuById($ids){
|
36 |
+
|
37 |
+
if($this->_skuToIdMapping == null){
|
38 |
+
|
39 |
+
$productCol = Mage::getResourceModel('catalog/product_collection');
|
40 |
+
$idsSelect = clone $productCol->getSelect();
|
41 |
+
$idsSelect->reset(Zend_Db_Select::ORDER);
|
42 |
+
$idsSelect->reset(Zend_Db_Select::LIMIT_COUNT);
|
43 |
+
$idsSelect->reset(Zend_Db_Select::LIMIT_OFFSET);
|
44 |
+
$idsSelect->reset(Zend_Db_Select::COLUMNS);
|
45 |
+
$idsSelect->from(null, array('e.'.$productCol->getEntity()->getIdFieldName(), 'e.sku'));
|
46 |
+
$idsSelect->resetJoinLeft();
|
47 |
+
|
48 |
+
$this->_skuToIdMapping = $productCol->getConnection()->fetchPairs($idsSelect, array());
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
// return single sku or array with skus
|
53 |
+
if (!is_array($ids)) {
|
54 |
+
return isset($this->_skuToIdMapping[$ids]) ? $this->_skuToIdMapping[$ids] : null;
|
55 |
+
} else {
|
56 |
+
$skuArr = array();
|
57 |
+
|
58 |
+
foreach ($ids as $id) {
|
59 |
+
$skuArr[] = isset($this->_skuToIdMapping[$id]) ? $this->_skuToIdMapping[$id] : null;
|
60 |
+
}
|
61 |
+
|
62 |
+
return $skuArr;
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
/**
|
67 |
* get current Product Id
|
68 |
+
* @param string $type indicate which type of data should used
|
69 |
*
|
70 |
* @return int
|
71 |
*/
|
72 |
+
public function getProductId($type = 'dynamic')
|
73 |
{
|
74 |
$productId = null;
|
75 |
if(Mage::registry('current_product') instanceof Mage_Catalog_Model_Product
|
76 |
&& Mage::registry('current_product')->getId()){
|
77 |
+
$productId = Mage::registry('current_product')->getData(($type!='dynamic'?$type:$this->getIdFieldName()));
|
78 |
+
|
79 |
if(version_compare(Mage::getVersion(), '1.9.0', '<')
|
80 |
&& (string)Mage::getConfig()->getModuleConfig('Enterprise_PageCache')->active == 'true'){
|
81 |
$processor = Mage::getSingleton('enterprise_pagecache/processor');
|
82 |
$cacheId = $processor->getRequestCacheId() . '_current_product_id';
|
83 |
+
Mage::app()->saveCache(Mage::registry('current_product')->getData(($type!='static'?$type:$this->getIdFieldName())), $cacheId);
|
84 |
}
|
85 |
|
86 |
}elseif((string)Mage::getConfig()->getModuleConfig('Enterprise_PageCache')->active == 'true'){
|
87 |
+
|
88 |
+
$processor = Mage::getSingleton('enterprise_pagecache/processor');
|
89 |
$cacheId = $processor->getRequestCacheId() . '_current_product_id';
|
90 |
if(Mage::app()->loadCache($cacheId)){
|
91 |
$productId = Mage::app()->loadCache($cacheId);
|
94 |
|
95 |
return $productId;
|
96 |
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* get Entity ID Field Name by Configuration or via Entity
|
100 |
+
*
|
101 |
+
* @return string
|
102 |
+
*/
|
103 |
+
public function getIdFieldName()
|
104 |
+
{
|
105 |
+
$idFieldName = Mage::getStoreConfig(self::XML_CONFIG_PATH_PRODUCT_IDENTIFIER);
|
106 |
+
if(!$idFieldName){
|
107 |
+
$idFieldName = 'entity_id';
|
108 |
+
}
|
109 |
+
return $idFieldName;
|
110 |
+
}
|
111 |
+
|
112 |
+
|
113 |
+
/**
|
114 |
+
* return cookie status
|
115 |
+
*
|
116 |
+
* @return bool
|
117 |
+
*/
|
118 |
+
public function getCookieStatus()
|
119 |
+
{
|
120 |
+
return Mage::getStoreConfig(self::XML_CONFIG_PATH_COOKIE_STATUS);
|
121 |
+
}
|
122 |
+
|
123 |
}
|
app/code/community/Flagbit/EpoqInterface/Model/Abstract.php
CHANGED
@@ -27,7 +27,8 @@ class Flagbit_EpoqInterface_Model_Abstract extends Mage_Core_Model_Abstract {
|
|
27 |
const XML_DEMO_PATH = 'epoqinterface/config/demo';
|
28 |
const CACHE_REQUEST_FAILURE_COUNTER = 'epoqinterface_rest_failure_counter';
|
29 |
const CACHE_REQUEST_FAILURE_TIME = 'epoqinterface_rest_failure_time';
|
30 |
-
|
|
|
31 |
protected $_restClient= null;
|
32 |
|
33 |
|
@@ -39,7 +40,12 @@ class Flagbit_EpoqInterface_Model_Abstract extends Mage_Core_Model_Abstract {
|
|
39 |
*/
|
40 |
protected function _doRequest(){
|
41 |
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
43 |
if($this->getIsErrorHandling()
|
44 |
&& $this->getFailureCount() >= Mage::getStoreConfig(self::XML_MAX_ATTEMPTS_PATH)
|
45 |
&& $this->getRequestFailureTime() > time()){
|
27 |
const XML_DEMO_PATH = 'epoqinterface/config/demo';
|
28 |
const CACHE_REQUEST_FAILURE_COUNTER = 'epoqinterface_rest_failure_counter';
|
29 |
const CACHE_REQUEST_FAILURE_TIME = 'epoqinterface_rest_failure_time';
|
30 |
+
const XML_AJAX_ENABLED = 'epoqinterface/config/ajax';
|
31 |
+
|
32 |
protected $_restClient= null;
|
33 |
|
34 |
|
40 |
*/
|
41 |
protected function _doRequest(){
|
42 |
|
43 |
+
// only do REST request if ajax mode is disabled.
|
44 |
+
if (Mage::getStoreConfig(self::XML_AJAX_ENABLED)) {
|
45 |
+
return null;
|
46 |
+
}
|
47 |
+
|
48 |
+
// error handling
|
49 |
if($this->getIsErrorHandling()
|
50 |
&& $this->getFailureCount() >= Mage::getStoreConfig(self::XML_MAX_ATTEMPTS_PATH)
|
51 |
&& $this->getRequestFailureTime() > time()){
|
app/code/community/Flagbit/EpoqInterface/Model/Recommendation/Abstract.php
CHANGED
@@ -52,8 +52,8 @@ class Flagbit_EpoqInterface_Model_Recommendation_Abstract extends Flagbit_EpoqIn
|
|
52 |
$this->setProductIds($productIds);
|
53 |
$this->setRecommendationId((string) $result->getIterator()->recommendationId);
|
54 |
|
55 |
-
$this->getSession()->
|
56 |
-
$this->getSession()->
|
57 |
}
|
58 |
|
59 |
/**
|
52 |
$this->setProductIds($productIds);
|
53 |
$this->setRecommendationId((string) $result->getIterator()->recommendationId);
|
54 |
|
55 |
+
$this->getSession()->setLastRecommendationId($this->getRecommendationId());
|
56 |
+
$this->getSession()->setLastRecommendationProducts($this->getProductIds());
|
57 |
}
|
58 |
|
59 |
/**
|
app/code/community/Flagbit/EpoqInterface/Model/Recommendation/Cart.php
CHANGED
@@ -29,12 +29,12 @@ class Flagbit_EpoqInterface_Model_Recommendation_Cart extends Flagbit_EpoqInterf
|
|
29 |
foreach ($items as $key => $item) {
|
30 |
if ($option = $item->getOptionByCode('simple_product')) {
|
31 |
$product = $option->getProduct();
|
32 |
-
$variables['variantOf'][$key] = $item->getProduct()->
|
33 |
} else {
|
34 |
$product = $item->getProduct();
|
35 |
}
|
36 |
|
37 |
-
$params['productId'][$key] = $product->
|
38 |
$params['quantity'][$key] = $item->getQty();
|
39 |
$params['unitPrice'][$key] = $item->getPrice();
|
40 |
}
|
29 |
foreach ($items as $key => $item) {
|
30 |
if ($option = $item->getOptionByCode('simple_product')) {
|
31 |
$product = $option->getProduct();
|
32 |
+
$variables['variantOf'][$key] = $item->getProduct()->getData(Mage::helper('epoqinterface')->getIdFieldName());
|
33 |
} else {
|
34 |
$product = $item->getProduct();
|
35 |
}
|
36 |
|
37 |
+
$params['productId'][$key] = $product->getData(Mage::helper('epoqinterface')->getIdFieldName());
|
38 |
$params['quantity'][$key] = $item->getQty();
|
39 |
$params['unitPrice'][$key] = $item->getPrice();
|
40 |
}
|
app/code/community/Flagbit/EpoqInterface/Model/Resource/Eav/Mysql4/Product/Collection.php
CHANGED
@@ -45,9 +45,9 @@ class Flagbit_EpoqInterface_Model_Resource_Eav_Mysql4_Product_Collection
|
|
45 |
*/
|
46 |
public function _loadEntities($printQuery = false, $logQuery = false)
|
47 |
{
|
48 |
-
|
49 |
-
|
50 |
-
$idFieldName = '
|
51 |
|
52 |
if (!empty($productIds)) {
|
53 |
|
@@ -111,4 +111,75 @@ class Flagbit_EpoqInterface_Model_Resource_Eav_Mysql4_Product_Collection
|
|
111 |
{
|
112 |
return $this;
|
113 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
}
|
45 |
*/
|
46 |
public function _loadEntities($printQuery = false, $logQuery = false)
|
47 |
{
|
48 |
+
$productIds = array_unique($this->_productIds);
|
49 |
+
// $idFieldName = 'entity_id';
|
50 |
+
$idFieldName = Mage::helper('epoqinterface')->getIdFieldName();
|
51 |
|
52 |
if (!empty($productIds)) {
|
53 |
|
111 |
{
|
112 |
return $this;
|
113 |
}
|
114 |
+
|
115 |
+
/* */
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Add attribute to sort order
|
119 |
+
*
|
120 |
+
* @param string $attribute
|
121 |
+
* @param string $dir
|
122 |
+
* @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
|
123 |
+
*/
|
124 |
+
public function addAttributeToSort($attribute, $dir='asc')
|
125 |
+
{
|
126 |
+
if ($attribute == 'position') {
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
|
130 |
+
return parent::addAttributeToSort($attribute, $dir);
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Add collection filters by identifiers
|
135 |
+
*
|
136 |
+
* @param mixed $productId
|
137 |
+
* @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
|
138 |
+
*/
|
139 |
+
public function addIdFilter($productId, $exclude = false)
|
140 |
+
{
|
141 |
+
if(!is_array($productId)){
|
142 |
+
$productId = array($productId);
|
143 |
+
}
|
144 |
+
|
145 |
+
$this->_productIds = $productId;
|
146 |
+
|
147 |
+
if (empty($productId)) {
|
148 |
+
$this->_setIsLoaded(true);
|
149 |
+
return $this;
|
150 |
+
}
|
151 |
+
if (is_array($productId)) {
|
152 |
+
if (!empty($productId)) {
|
153 |
+
if ($exclude) {
|
154 |
+
$condition = array('nin' => $productId);
|
155 |
+
} else {
|
156 |
+
$condition = array('in' => $productId);
|
157 |
+
}
|
158 |
+
} else {
|
159 |
+
$condition = '';
|
160 |
+
}
|
161 |
+
} else {
|
162 |
+
if ($exclude) {
|
163 |
+
$condition = array('neq' => $productId);
|
164 |
+
} else {
|
165 |
+
$condition = $productId;
|
166 |
+
}
|
167 |
+
}
|
168 |
+
$this->addFieldToFilter(Mage::helper('epoqinterface')->getIdFieldName(), $condition);
|
169 |
+
|
170 |
+
return $this;
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Set collection page size
|
175 |
+
*
|
176 |
+
* @param int $size
|
177 |
+
* @return Varien_Data_Collection
|
178 |
+
*/
|
179 |
+
public function setPageSize($size)
|
180 |
+
{
|
181 |
+
$this->_pageSize = null;
|
182 |
+
return $this;
|
183 |
+
}
|
184 |
+
|
185 |
}
|
app/code/community/Flagbit/EpoqInterface/Model/System/Config/Source/Identifier.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: Abstract.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 |
+
class Flagbit_EpoqInterface_Model_System_Config_Source_Identifier
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* get Authtypes as Option Array
|
21 |
+
*
|
22 |
+
* @return array
|
23 |
+
*/
|
24 |
+
public function toOptionArray()
|
25 |
+
{
|
26 |
+
return array(
|
27 |
+
array(
|
28 |
+
'value' => 'entity_id',
|
29 |
+
'label' => Mage::helper('epoqinterface')->__('Product ID (default)')
|
30 |
+
),
|
31 |
+
array(
|
32 |
+
'value' => 'sku',
|
33 |
+
'label' => Mage::helper('epoqinterface')->__('Product SKU')
|
34 |
+
)
|
35 |
+
);
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Flagbit/EpoqInterface/controllers/IndexController.php
CHANGED
@@ -53,13 +53,11 @@ class Flagbit_EpoqInterface_IndexController extends Mage_Core_Controller_Front_A
|
|
53 |
|
54 |
return parent::preDispatch();
|
55 |
}
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
public function productlistAction(){
|
64 |
$this->getResponse()->setHeader('Content-type', 'text/plain; charset=UTF-8');
|
65 |
//$this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8');
|
53 |
|
54 |
return parent::preDispatch();
|
55 |
}
|
56 |
+
|
57 |
+
public function indexAction(){
|
58 |
+
$this->_forward('productlist');
|
59 |
+
}
|
60 |
+
|
|
|
|
|
61 |
public function productlistAction(){
|
62 |
$this->getResponse()->setHeader('Content-type', 'text/plain; charset=UTF-8');
|
63 |
//$this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8');
|
app/code/community/Flagbit/EpoqInterface/controllers/RecommendationController.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Flagbit_EpoqInterface_RecommendationController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function listAction()
|
5 |
+
{
|
6 |
+
echo $this->getLayout()->createBlock('epoqinterface/recommendation_ajaxproduct')
|
7 |
+
->setProductIds(Mage::app()->getRequest()->getParam('pid'))
|
8 |
+
->setTemplate('epoqinterface/recommendation/product.phtml')
|
9 |
+
->toHtml();
|
10 |
+
}
|
11 |
+
|
12 |
+
/**
|
13 |
+
* list recommendations to use in email. template include inline-css to provide the layout
|
14 |
+
*/
|
15 |
+
public function maillistAction()
|
16 |
+
{
|
17 |
+
echo $this->getLayout()->createBlock('epoqinterface/recommendation_ajaxproduct')
|
18 |
+
->setProductIds(Mage::app()->getRequest()->getParam('pid'))
|
19 |
+
->setTemplate('epoqinterface/recommendation/mailproduct.phtml')
|
20 |
+
->toHtml();
|
21 |
+
}
|
22 |
+
|
23 |
+
}
|
app/code/community/Flagbit/EpoqInterface/etc/cache.xml
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<config>
|
3 |
<placeholders>
|
4 |
-
<
|
5 |
-
<block>epoqinterface/
|
6 |
<placeholder>EPOQ_RECOMMENTATION_PRODUCT</placeholder>
|
7 |
<container>Flagbit_EpoqInterface_Model_Container_Product</container>
|
8 |
<cache_lifetime>0</cache_lifetime>
|
9 |
<template>epoqinterface/recommendation/product.phtml</template>
|
10 |
-
</
|
11 |
<epoqinterface_track_product>
|
12 |
<block>epoqinterface/track_product</block>
|
13 |
<placeholder>EPOQ_TRACK_PRODUCT</placeholder>
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<config>
|
3 |
<placeholders>
|
4 |
+
<epoqinterface_recommendation_product>
|
5 |
+
<block>epoqinterface/recommendation_product</block>
|
6 |
<placeholder>EPOQ_RECOMMENTATION_PRODUCT</placeholder>
|
7 |
<container>Flagbit_EpoqInterface_Model_Container_Product</container>
|
8 |
<cache_lifetime>0</cache_lifetime>
|
9 |
<template>epoqinterface/recommendation/product.phtml</template>
|
10 |
+
</epoqinterface_recommendation_product>
|
11 |
<epoqinterface_track_product>
|
12 |
<block>epoqinterface/track_product</block>
|
13 |
<placeholder>EPOQ_TRACK_PRODUCT</placeholder>
|
app/code/community/Flagbit/EpoqInterface/etc/config.xml
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
<modules>
|
21 |
<Flagbit_EpoqInterface>
|
22 |
<active>true</active>
|
23 |
-
<version>1.
|
24 |
</Flagbit_EpoqInterface>
|
25 |
</modules>
|
26 |
|
@@ -46,7 +46,7 @@
|
|
46 |
</models>
|
47 |
<rewrite>
|
48 |
<epoqinterface>
|
49 |
-
<from><![CDATA[#^/epoqinterface
|
50 |
<to>/epoqinterface/index/productlist/</to>
|
51 |
</epoqinterface>
|
52 |
</rewrite>
|
@@ -163,6 +163,8 @@
|
|
163 |
<demo>0</demo>
|
164 |
<customer_profiles>0</customer_profiles>
|
165 |
<debug>0</debug>
|
|
|
|
|
166 |
</config>
|
167 |
<display_recommendation>
|
168 |
<user>1</user>
|
20 |
<modules>
|
21 |
<Flagbit_EpoqInterface>
|
22 |
<active>true</active>
|
23 |
+
<version>1.2.0</version>
|
24 |
</Flagbit_EpoqInterface>
|
25 |
</modules>
|
26 |
|
46 |
</models>
|
47 |
<rewrite>
|
48 |
<epoqinterface>
|
49 |
+
<from><![CDATA[#^/epoqinterface/$#]]></from>
|
50 |
<to>/epoqinterface/index/productlist/</to>
|
51 |
</epoqinterface>
|
52 |
</rewrite>
|
163 |
<demo>0</demo>
|
164 |
<customer_profiles>0</customer_profiles>
|
165 |
<debug>0</debug>
|
166 |
+
<ajax>0</ajax>
|
167 |
+
<cookie>0</cookie>
|
168 |
</config>
|
169 |
<display_recommendation>
|
170 |
<user>1</user>
|
app/code/community/Flagbit/EpoqInterface/etc/system.xml
CHANGED
@@ -52,11 +52,29 @@
|
|
52 |
<show_in_website>1</show_in_website>
|
53 |
<show_in_store>1</show_in_store>
|
54 |
</tenant_id>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
<timeout translate="label">
|
56 |
<label>Timeout</label>
|
57 |
<frontend_type>select</frontend_type>
|
58 |
<source_model>epoqinterface/system_config_source_timeout</source_model>
|
59 |
-
<sort_order>
|
60 |
<show_in_default>1</show_in_default>
|
61 |
<show_in_website>1</show_in_website>
|
62 |
<show_in_store>1</show_in_store>
|
@@ -65,7 +83,7 @@
|
|
65 |
<label>Demo mode</label>
|
66 |
<frontend_type>select</frontend_type>
|
67 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
68 |
-
<sort_order>
|
69 |
<show_in_default>1</show_in_default>
|
70 |
<show_in_website>1</show_in_website>
|
71 |
<show_in_store>1</show_in_store>
|
@@ -74,7 +92,7 @@
|
|
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>
|
78 |
<show_in_default>1</show_in_default>
|
79 |
<show_in_website>1</show_in_website>
|
80 |
<show_in_store>1</show_in_store>
|
@@ -88,6 +106,15 @@
|
|
88 |
<show_in_website>1</show_in_website>
|
89 |
<show_in_store>1</show_in_store>
|
90 |
</customer_profiles -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
</fields>
|
92 |
</config>
|
93 |
<display_recommendation translate="label">
|
@@ -125,7 +152,6 @@
|
|
125 |
<show_in_website>1</show_in_website>
|
126 |
<show_in_store>1</show_in_store>
|
127 |
</user>
|
128 |
-
|
129 |
</fields>
|
130 |
</display_recommendation>
|
131 |
<export translate="label">
|
52 |
<show_in_website>1</show_in_website>
|
53 |
<show_in_store>1</show_in_store>
|
54 |
</tenant_id>
|
55 |
+
<ajax>
|
56 |
+
<label>Using Ajax</label>
|
57 |
+
<frontend_type>select</frontend_type>
|
58 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
59 |
+
<sort_order>20</sort_order>
|
60 |
+
<show_in_default>1</show_in_default>
|
61 |
+
<show_in_website>1</show_in_website>
|
62 |
+
<show_in_store>1</show_in_store>
|
63 |
+
</ajax>
|
64 |
+
<identifier translate="label">
|
65 |
+
<label>Product Identifier</label>
|
66 |
+
<frontend_type>select</frontend_type>
|
67 |
+
<source_model>epoqinterface/system_config_source_identifier</source_model>
|
68 |
+
<sort_order>30</sort_order>
|
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 |
+
</identifier>
|
73 |
<timeout translate="label">
|
74 |
<label>Timeout</label>
|
75 |
<frontend_type>select</frontend_type>
|
76 |
<source_model>epoqinterface/system_config_source_timeout</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>
|
83 |
<label>Demo mode</label>
|
84 |
<frontend_type>select</frontend_type>
|
85 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
86 |
+
<sort_order>50</sort_order>
|
87 |
<show_in_default>1</show_in_default>
|
88 |
<show_in_website>1</show_in_website>
|
89 |
<show_in_store>1</show_in_store>
|
92 |
<label>Debug Log (var/log/epoq.log)</label>
|
93 |
<frontend_type>select</frontend_type>
|
94 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
95 |
+
<sort_order>60</sort_order>
|
96 |
<show_in_default>1</show_in_default>
|
97 |
<show_in_website>1</show_in_website>
|
98 |
<show_in_store>1</show_in_store>
|
106 |
<show_in_website>1</show_in_website>
|
107 |
<show_in_store>1</show_in_store>
|
108 |
</customer_profiles -->
|
109 |
+
<cookie translate="label">
|
110 |
+
<label>Enable cookies</label>
|
111 |
+
<frontend_type>select</frontend_type>
|
112 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
113 |
+
<sort_order>70</sort_order>
|
114 |
+
<show_in_default>1</show_in_default>
|
115 |
+
<show_in_website>1</show_in_website>
|
116 |
+
<show_in_store>1</show_in_store>
|
117 |
+
</cookie>
|
118 |
</fields>
|
119 |
</config>
|
120 |
<display_recommendation translate="label">
|
152 |
<show_in_website>1</show_in_website>
|
153 |
<show_in_store>1</show_in_store>
|
154 |
</user>
|
|
|
155 |
</fields>
|
156 |
</display_recommendation>
|
157 |
<export translate="label">
|
app/design/frontend/base/default/layout/epoqinterface.xml
CHANGED
@@ -26,9 +26,9 @@
|
|
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/
|
32 |
<!-- <action method="setRules"><rules>name(value)</rules></action> -->
|
33 |
</block>
|
34 |
</reference>
|
@@ -39,7 +39,7 @@
|
|
39 |
<reference name="content">
|
40 |
<block type="epoqinterface/track_cart" name="epoqinterface.track.cart"/>
|
41 |
<reference name="checkout.cart">
|
42 |
-
<block type="epoqinterface/
|
43 |
</reference>
|
44 |
</reference>
|
45 |
</checkout_cart_index>
|
@@ -58,7 +58,7 @@
|
|
58 |
|
59 |
<customer_account_index>
|
60 |
<reference name="customer_account_dashboard">
|
61 |
-
<block type="epoqinterface/
|
62 |
</reference>
|
63 |
</customer_account_index>
|
64 |
|
26 |
|
27 |
<catalog_product_view>
|
28 |
<reference name="content">
|
29 |
+
<block type="epoqinterface/track_product" name="epoqinterface.track.product" before="epoqinterface.recommendation.product" />
|
30 |
<reference name="product.info.additional">
|
31 |
+
<block type="epoqinterface/recommendation_product" name="epoqinterface.recommendation.product" template="epoqinterface/recommendation/product.phtml">
|
32 |
<!-- <action method="setRules"><rules>name(value)</rules></action> -->
|
33 |
</block>
|
34 |
</reference>
|
39 |
<reference name="content">
|
40 |
<block type="epoqinterface/track_cart" name="epoqinterface.track.cart"/>
|
41 |
<reference name="checkout.cart">
|
42 |
+
<block type="epoqinterface/recommendation_cart" name="epoqinterface.recommendation.cart" template="epoqinterface/recommendation/cart.phtml"/>
|
43 |
</reference>
|
44 |
</reference>
|
45 |
</checkout_cart_index>
|
58 |
|
59 |
<customer_account_index>
|
60 |
<reference name="customer_account_dashboard">
|
61 |
+
<block type="epoqinterface/recommendation_user" name="epoqinterface.recommendation.user" as="info1" template="epoqinterface/recommendation/user.phtml"/>
|
62 |
</reference>
|
63 |
</customer_account_index>
|
64 |
|
app/design/frontend/base/default/template/epoqinterface/recommendation/cart.phtml
CHANGED
@@ -27,8 +27,8 @@
|
|
27 |
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
|
28 |
<?php if($_link=$this->getIterableItem()): ?>
|
29 |
<td>
|
30 |
-
<p class="product-image"><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-
|
31 |
-
<h5><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-
|
32 |
<?php echo $this->getPriceHtml($_link, true) ?>
|
33 |
<?php echo $this->getReviewsSummaryHtml($_link) ?>
|
34 |
</td>
|
@@ -42,10 +42,10 @@
|
|
42 |
<script type="text/javascript">decorateTable('upsell-product-table')</script>
|
43 |
</div>
|
44 |
<script type="text/javascript">
|
45 |
-
$$('a.epoq-
|
46 |
-
var newParam = '
|
47 |
params = '?' + newParam;
|
48 |
-
params = elem.href.replace(new RegExp('[\?&]' + '
|
49 |
if (params === elem.href) {
|
50 |
if(elem.href.indexOf('?') == '-1'){
|
51 |
params += '?' + newParam;
|
27 |
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
|
28 |
<?php if($_link=$this->getIterableItem()): ?>
|
29 |
<td>
|
30 |
+
<p class="product-image"><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><img src="<?php echo $this->helper('catalog/image')->init($_link, 'small_image')->resize(125) ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_link->getName()) ?>" /></a></p>
|
31 |
+
<h5><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><?php echo $this->htmlEscape($_link->getName()) ?></a></h5>
|
32 |
<?php echo $this->getPriceHtml($_link, true) ?>
|
33 |
<?php echo $this->getReviewsSummaryHtml($_link) ?>
|
34 |
</td>
|
42 |
<script type="text/javascript">decorateTable('upsell-product-table')</script>
|
43 |
</div>
|
44 |
<script type="text/javascript">
|
45 |
+
$$('a.epoq-recommendation-link').each(function(elem, index){
|
46 |
+
var newParam = 'recommendation_id=<?php echo $this->getSession()->getLastRecommendationId();?>',
|
47 |
params = '?' + newParam;
|
48 |
+
params = elem.href.replace(new RegExp('[\?&]' + 'recommendation_id' + '[^&]*'), '$1' + newParam);
|
49 |
if (params === elem.href) {
|
50 |
if(elem.href.indexOf('?') == '-1'){
|
51 |
params += '?' + newParam;
|
app/design/frontend/base/default/template/epoqinterface/recommendation/checkout.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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@magentocommerce.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.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<img src="http(s)://rs1.epoq.de/inbound-servletapi/pixel.png?tenantId=TENANTID&" />
|
app/design/frontend/base/default/template/epoqinterface/recommendation/list.phtml
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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@magentocommerce.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.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
/**
|
29 |
+
* Product list template
|
30 |
+
*
|
31 |
+
* @see Mage_Catalog_Block_Product_List
|
32 |
+
*/
|
33 |
+
?>
|
34 |
+
<?php
|
35 |
+
$_productCollection=$this->getLoadedProductCollection();
|
36 |
+
$_helper = $this->helper('catalog/output');
|
37 |
+
?>
|
38 |
+
<?php if(!$_productCollection->count()): ?>
|
39 |
+
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
|
40 |
+
<?php else: ?>
|
41 |
+
<div class="category-products">
|
42 |
+
<?php // List mode ?>
|
43 |
+
<?php if($this->getMode()!='grid'): ?>
|
44 |
+
<?php $_iterator = 0; ?>
|
45 |
+
<ol class="products-list" id="products-list">
|
46 |
+
<?php foreach ($this->getProductIds() as $_productId): ?>
|
47 |
+
<?php $_product = $_productCollection->getItemById($_productId);?>
|
48 |
+
<?php if(!($_product instanceof Mage_Catalog_Model_Product)){ continue; }?>
|
49 |
+
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
|
50 |
+
<?php // Product Image ?>
|
51 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
52 |
+
<?php // Product description ?>
|
53 |
+
<div class="product-shop">
|
54 |
+
<div class="f-fix">
|
55 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
|
56 |
+
<?php if($_product->getRatingSummary()): ?>
|
57 |
+
<?php echo $this->getReviewsSummaryHtml($_product) ?>
|
58 |
+
<?php endif; ?>
|
59 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
60 |
+
<?php if($_product->isSaleable()): ?>
|
61 |
+
<p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
62 |
+
<?php else: ?>
|
63 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
64 |
+
<?php endif; ?>
|
65 |
+
<div class="desc std">
|
66 |
+
<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
|
67 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>" class="link-more"><?php echo $this->__('Learn More') ?></a>
|
68 |
+
</div>
|
69 |
+
<ul class="add-to-links">
|
70 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
71 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
72 |
+
<?php endif; ?>
|
73 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
74 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
75 |
+
<?php endif; ?>
|
76 |
+
</ul>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
</li>
|
80 |
+
<?php endforeach; ?>
|
81 |
+
</ol>
|
82 |
+
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
|
83 |
+
|
84 |
+
<?php else: ?>
|
85 |
+
|
86 |
+
<?php // Grid Mode ?>
|
87 |
+
|
88 |
+
<?php $_collectionSize = $_productCollection->count() ?>
|
89 |
+
<?php $_columnCount = $this->getColumnCount(); ?>
|
90 |
+
<?php $i=0; ?>
|
91 |
+
<?php foreach ($this->getProductIds() as $_productId): ?>
|
92 |
+
<?php $_product = $_productCollection->getItemById($_productId);?>
|
93 |
+
<?php if(!($_product instanceof Mage_Catalog_Model_Product)){ continue; }?>
|
94 |
+
|
95 |
+
<?php if ($i++%$_columnCount==0): ?>
|
96 |
+
<ul class="products-grid">
|
97 |
+
<?php endif ?>
|
98 |
+
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
|
99 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
100 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
|
101 |
+
<?php if($_product->getRatingSummary()): ?>
|
102 |
+
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
|
103 |
+
<?php endif; ?>
|
104 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
105 |
+
<div class="actions">
|
106 |
+
<?php if($_product->isSaleable()): ?>
|
107 |
+
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
108 |
+
<?php else: ?>
|
109 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
110 |
+
<?php endif; ?>
|
111 |
+
<ul class="add-to-links">
|
112 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
113 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
114 |
+
<?php endif; ?>
|
115 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
116 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
117 |
+
<?php endif; ?>
|
118 |
+
</ul>
|
119 |
+
</div>
|
120 |
+
</li>
|
121 |
+
<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
|
122 |
+
</ul>
|
123 |
+
<?php endif ?>
|
124 |
+
<?php endforeach ?>
|
125 |
+
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
|
126 |
+
<?php endif; ?>
|
127 |
+
</div>
|
128 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/epoqinterface/recommendation/mailproduct.phtml
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* *
|
3 |
+
* This script is part of the epoq Recommendation Service project *
|
4 |
+
* *
|
5 |
+
* TypoGento is free software; you can redistribute it and/or modify it *
|
6 |
+
* 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: product.phtml 487 2010-08-05 12:32:57Z weller $
|
15 |
+
* @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
|
16 |
+
*/
|
17 |
+
?>
|
18 |
+
|
19 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
20 |
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
|
21 |
+
<head>
|
22 |
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
23 |
+
<title>Epoq</title>
|
24 |
+
<style type="text/css">
|
25 |
+
* { margin: 0px; padding: 0px; }
|
26 |
+
|
27 |
+
body { font-family: Arial, Helvetica, sans-serif; }
|
28 |
+
|
29 |
+
table { border: 0 none; border-spacing: 0; empty-celss: show; font-size: 100%; }
|
30 |
+
th, td { font-weight: normal; text-align: left; vertical-align: top; }
|
31 |
+
|
32 |
+
p { margin: 0 0 10px; }
|
33 |
+
a { color: #1E7EC8; text-decoration: underline; }
|
34 |
+
img { border: 0 none; vertical-align: top; }
|
35 |
+
|
36 |
+
h4, h5 { color: #0A263E; line-height: 1.35em; margin: 0 0 5px; }
|
37 |
+
h4 { font-size: 14px; font-weight: bold; }
|
38 |
+
h5 { font-size: 12px; font-weight: bold; }
|
39 |
+
|
40 |
+
.collateral-box { width: 635px; }
|
41 |
+
|
42 |
+
.price-box { margin: 5px 0; }
|
43 |
+
.regular-price { color: #C76200; }
|
44 |
+
.regular-price .price { color: #C76200; font-size: 13px; font-weight: bold; }
|
45 |
+
|
46 |
+
.ratings { font-size: 11px; line-height: 1.25em; }
|
47 |
+
.ratings .rating-box { display: block; float: none; margin: 0 0 3px; }
|
48 |
+
.rating-box { background: url("<?php echo $this->getSkinUrl('images/bkg_rating.gif'); ?>") repeat-x scroll 0 0 transparent; font-size: 0; height: 13px; line-height: 0; overflow: hidden; text-indent: -999em; width: 69px; }
|
49 |
+
.rating-box .rating { background: url("<?php echo $this->getSkinUrl('images/bkg_rating.gif'); ?>") repeat-x scroll 0 100% transparent; float: left; height: 13px; }
|
50 |
+
.ratings .rating-links .separator { margin: 0 2px; }
|
51 |
+
|
52 |
+
</style>
|
53 |
+
</head>
|
54 |
+
<body>
|
55 |
+
<?php if(count($this->getItemCollection()->getItems())): ?>
|
56 |
+
<div class="collateral-box up-sell">
|
57 |
+
<div class="head"><h4><?php echo $this->__('epoq: You may also be interested in the following product(s)') ?></h4></div>
|
58 |
+
<table cellspacing="0" class="generic-product-grid catalog-listing" id="epoq-product-table">
|
59 |
+
<?php // $this->setColumnCount(4); // uncomment this line if you want to have another number of columns. also can be changed in layout ?>
|
60 |
+
<?php $this->resetItemsIterator() ?>
|
61 |
+
<?php for($_i=0;$_i<$this->getRowCount();$_i++): ?>
|
62 |
+
<tr>
|
63 |
+
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
|
64 |
+
<?php if($_link=$this->getIterableItem()): ?>
|
65 |
+
<td style="width: 175px;">
|
66 |
+
<p class="product-image"><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><img src="<?php echo $this->helper('catalog/image')->init($_link, 'small_image')->resize(125) ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_link->getName()) ?>" /></a></p>
|
67 |
+
<h5><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><?php echo $this->htmlEscape($_link->getName()) ?></a></h5>
|
68 |
+
<?php echo $this->getPriceHtml($_link, true) ?>
|
69 |
+
<?php #echo $this->getReviewsSummaryHtml($_link) ?>
|
70 |
+
</td>
|
71 |
+
<?php else: ?>
|
72 |
+
<td class="empty-product"> </td>
|
73 |
+
<?php endif; ?>
|
74 |
+
<?php endfor; ?>
|
75 |
+
</tr>
|
76 |
+
<?php endfor; ?>
|
77 |
+
</table>
|
78 |
+
</div>
|
79 |
+
<?php endif ?>
|
80 |
+
</body>
|
81 |
+
</html>
|
app/design/frontend/base/default/template/epoqinterface/recommendation/product.phtml
CHANGED
@@ -27,8 +27,8 @@
|
|
27 |
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
|
28 |
<?php if($_link=$this->getIterableItem()): ?>
|
29 |
<td>
|
30 |
-
<p class="product-image"><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-
|
31 |
-
<h5><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-
|
32 |
<?php echo $this->getPriceHtml($_link, true) ?>
|
33 |
<?php echo $this->getReviewsSummaryHtml($_link) ?>
|
34 |
</td>
|
@@ -42,18 +42,19 @@
|
|
42 |
<script type="text/javascript">decorateTable('upsell-product-table')</script>
|
43 |
</div>
|
44 |
<script type="text/javascript">
|
45 |
-
$$('a.epoq-
|
46 |
-
var newParam = '
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
54 |
}
|
|
|
55 |
}
|
56 |
-
elem.href = params;
|
57 |
});
|
58 |
</script>
|
59 |
<?php endif ?>
|
27 |
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
|
28 |
<?php if($_link=$this->getIterableItem()): ?>
|
29 |
<td>
|
30 |
+
<p class="product-image"><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><img src="<?php echo $this->helper('catalog/image')->init($_link, 'small_image')->resize(125) ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_link->getName()) ?>" /></a></p>
|
31 |
+
<h5><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><?php echo $this->htmlEscape($_link->getName()) ?></a></h5>
|
32 |
<?php echo $this->getPriceHtml($_link, true) ?>
|
33 |
<?php echo $this->getReviewsSummaryHtml($_link) ?>
|
34 |
</td>
|
42 |
<script type="text/javascript">decorateTable('upsell-product-table')</script>
|
43 |
</div>
|
44 |
<script type="text/javascript">
|
45 |
+
$$('a.epoq-recommendation-link').each(function(elem, index){
|
46 |
+
var newParam = 'recommendation_id=<?php echo $this->getSession()->getLastRecommendationId();?>';
|
47 |
+
if (elem.href.indexOf('recommendation_id') == '-1') {
|
48 |
+
params = elem.href.replace(new RegExp('[\?&]' + 'recommendation_id' + '[^&]*'), RegExp.$1 + newParam);
|
49 |
+
if (params === elem.href) {
|
50 |
+
if(elem.href.indexOf('?') == '-1'){
|
51 |
+
params += '?' + newParam;
|
52 |
+
}else{
|
53 |
+
params += '&' + newParam;
|
54 |
+
}
|
55 |
}
|
56 |
+
elem.href = params;
|
57 |
}
|
|
|
58 |
});
|
59 |
</script>
|
60 |
<?php endif ?>
|
app/design/frontend/base/default/template/epoqinterface/recommendation/user.phtml
CHANGED
@@ -28,8 +28,8 @@
|
|
28 |
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
|
29 |
<?php if($_link=$this->getIterableItem()): ?>
|
30 |
<td>
|
31 |
-
<p class="product-image"><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-
|
32 |
-
<h5><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-
|
33 |
<?php echo $this->getPriceHtml($_link, true) ?>
|
34 |
<?php echo $this->getReviewsSummaryHtml($_link) ?>
|
35 |
</td>
|
@@ -43,10 +43,10 @@
|
|
43 |
<script type="text/javascript">decorateTable('upsell-product-table')</script>
|
44 |
</div>
|
45 |
<script type="text/javascript">
|
46 |
-
$$('a.epoq-
|
47 |
-
var newParam = '
|
48 |
params = '?' + newParam;
|
49 |
-
params = elem.href.replace(new RegExp('[\?&]' + '
|
50 |
if (params === elem.href) {
|
51 |
if(elem.href.indexOf('?') == '-1'){
|
52 |
params += '?' + newParam;
|
28 |
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
|
29 |
<?php if($_link=$this->getIterableItem()): ?>
|
30 |
<td>
|
31 |
+
<p class="product-image"><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><img src="<?php echo $this->helper('catalog/image')->init($_link, 'small_image')->resize(125) ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_link->getName()) ?>" /></a></p>
|
32 |
+
<h5><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><?php echo $this->htmlEscape($_link->getName()) ?></a></h5>
|
33 |
<?php echo $this->getPriceHtml($_link, true) ?>
|
34 |
<?php echo $this->getReviewsSummaryHtml($_link) ?>
|
35 |
</td>
|
43 |
<script type="text/javascript">decorateTable('upsell-product-table')</script>
|
44 |
</div>
|
45 |
<script type="text/javascript">
|
46 |
+
$$('a.epoq-recommendation-link').each(function(elem, index){
|
47 |
+
var newParam = 'recommendation_id=<?php echo $this->getSession()->getLastRecommendationId();?>',
|
48 |
params = '?' + newParam;
|
49 |
+
params = elem.href.replace(new RegExp('[\?&]' + 'recommendation_id' + '[^&]*'), '$1' + newParam);
|
50 |
if (params === elem.href) {
|
51 |
if(elem.href.indexOf('?') == '-1'){
|
52 |
params += '?' + newParam;
|
app/design/frontend/default/default/layout/epoqinterface.xml
CHANGED
@@ -26,9 +26,9 @@
|
|
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/
|
32 |
<!-- <action method="setRules"><rules>name(value)</rules></action> -->
|
33 |
</block>
|
34 |
</reference>
|
@@ -39,7 +39,7 @@
|
|
39 |
<reference name="content">
|
40 |
<block type="epoqinterface/track_cart" name="epoqinterface.track.cart"/>
|
41 |
<reference name="checkout.cart">
|
42 |
-
<block type="epoqinterface/
|
43 |
</reference>
|
44 |
</reference>
|
45 |
</checkout_cart_index>
|
@@ -58,7 +58,7 @@
|
|
58 |
|
59 |
<customer_account_index>
|
60 |
<reference name="customer_account_dashboard">
|
61 |
-
<block type="epoqinterface/
|
62 |
</reference>
|
63 |
</customer_account_index>
|
64 |
|
26 |
|
27 |
<catalog_product_view>
|
28 |
<reference name="content">
|
29 |
+
<block type="epoqinterface/track_product" name="epoqinterface.track.product" before="epoqinterface.recommendation.product" />
|
30 |
<reference name="product.info.additional">
|
31 |
+
<block type="epoqinterface/recommendation_product" name="epoqinterface.recommendation.product" template="epoqinterface/recommendation/product.phtml">
|
32 |
<!-- <action method="setRules"><rules>name(value)</rules></action> -->
|
33 |
</block>
|
34 |
</reference>
|
39 |
<reference name="content">
|
40 |
<block type="epoqinterface/track_cart" name="epoqinterface.track.cart"/>
|
41 |
<reference name="checkout.cart">
|
42 |
+
<block type="epoqinterface/recommendation_cart" name="epoqinterface.recommendation.cart" template="epoqinterface/recommendation/cart.phtml"/>
|
43 |
</reference>
|
44 |
</reference>
|
45 |
</checkout_cart_index>
|
58 |
|
59 |
<customer_account_index>
|
60 |
<reference name="customer_account_dashboard">
|
61 |
+
<block type="epoqinterface/recommendation_user" name="epoqinterface.recommendation.user" as="info1" template="epoqinterface/recommendation/user.phtml"/>
|
62 |
</reference>
|
63 |
</customer_account_index>
|
64 |
|
app/design/frontend/default/default/template/epoqinterface/recommendation/cart.phtml
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* *
|
3 |
+
* This script is part of the epoq Recommendation Service project *
|
4 |
+
* *
|
5 |
+
* TypoGento is free software; you can redistribute it and/or modify it *
|
6 |
+
* 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.phtml 487 2010-08-05 12:32:57Z weller $
|
15 |
+
* @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
|
16 |
+
*/
|
17 |
+
?>
|
18 |
+
|
19 |
+
<?php if(count($this->getItemCollection()->getItems())): ?>
|
20 |
+
<div class="collateral-box up-sell">
|
21 |
+
<div class="head"><h4><?php echo $this->__('epoq: You may also be interested in the following product(s)') ?></h4></div>
|
22 |
+
<table cellspacing="0" class="generic-product-grid catalog-listing" id="upsell-product-table">
|
23 |
+
<?php // $this->setColumnCount(4); // uncomment this line if you want to have another number of columns. also can be changed in layout ?>
|
24 |
+
<?php $this->resetItemsIterator() ?>
|
25 |
+
<?php for($_i=0;$_i<$this->getRowCount();$_i++): ?>
|
26 |
+
<tr>
|
27 |
+
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
|
28 |
+
<?php if($_link=$this->getIterableItem()): ?>
|
29 |
+
<td>
|
30 |
+
<p class="product-image"><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><img src="<?php echo $this->helper('catalog/image')->init($_link, 'small_image')->resize(125) ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_link->getName()) ?>" /></a></p>
|
31 |
+
<h5><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><?php echo $this->htmlEscape($_link->getName()) ?></a></h5>
|
32 |
+
<?php echo $this->getPriceHtml($_link, true) ?>
|
33 |
+
<?php echo $this->getReviewsSummaryHtml($_link) ?>
|
34 |
+
</td>
|
35 |
+
<?php else: ?>
|
36 |
+
<td class="empty-product"> </td>
|
37 |
+
<?php endif; ?>
|
38 |
+
<?php endfor; ?>
|
39 |
+
</tr>
|
40 |
+
<?php endfor; ?>
|
41 |
+
</table>
|
42 |
+
<script type="text/javascript">decorateTable('upsell-product-table')</script>
|
43 |
+
</div>
|
44 |
+
<script type="text/javascript">
|
45 |
+
$$('a.epoq-recommendation-link').each(function(elem, index){
|
46 |
+
var newParam = 'recommendation_id=<?php echo $this->getSession()->getLastRecommendationId();?>',
|
47 |
+
params = '?' + newParam;
|
48 |
+
params = elem.href.replace(new RegExp('[\?&]' + 'recommendation_id' + '[^&]*'), '$1' + newParam);
|
49 |
+
if (params === elem.href) {
|
50 |
+
if(elem.href.indexOf('?') == '-1'){
|
51 |
+
params += '?' + newParam;
|
52 |
+
}else{
|
53 |
+
params += '&' + newParam;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
elem.href = params;
|
57 |
+
});
|
58 |
+
</script>
|
59 |
+
<?php endif ?>
|
app/design/frontend/default/default/template/epoqinterface/recommendation/list.phtml
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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@magentocommerce.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.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
/**
|
29 |
+
* Product list template
|
30 |
+
*
|
31 |
+
* @see Mage_Catalog_Block_Product_List
|
32 |
+
*/
|
33 |
+
?>
|
34 |
+
<?php
|
35 |
+
$_productCollection=$this->getLoadedProductCollection();
|
36 |
+
$_helper = $this->helper('catalog/output');
|
37 |
+
?>
|
38 |
+
<?php if(!$_productCollection->count()): ?>
|
39 |
+
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
|
40 |
+
<?php else: ?>
|
41 |
+
<div class="category-products">
|
42 |
+
<?php // List mode ?>
|
43 |
+
<?php if($this->getMode()!='grid'): ?>
|
44 |
+
<?php $_iterator = 0; ?>
|
45 |
+
<ol class="products-list" id="products-list">
|
46 |
+
<?php foreach ($_productCollection->getItems() as $_product): ?>
|
47 |
+
<?php if(!($_product instanceof Mage_Catalog_Model_Product)){ continue; }?>
|
48 |
+
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
|
49 |
+
<?php // Product Image ?>
|
50 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
51 |
+
<?php // Product description ?>
|
52 |
+
<div class="product-shop">
|
53 |
+
<div class="f-fix">
|
54 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
|
55 |
+
<?php if($_product->getRatingSummary()): ?>
|
56 |
+
<?php echo $this->getReviewsSummaryHtml($_product) ?>
|
57 |
+
<?php endif; ?>
|
58 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
59 |
+
<?php if($_product->isSaleable()): ?>
|
60 |
+
<p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
61 |
+
<?php else: ?>
|
62 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
63 |
+
<?php endif; ?>
|
64 |
+
<div class="desc std">
|
65 |
+
<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
|
66 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>" class="link-more"><?php echo $this->__('Learn More') ?></a>
|
67 |
+
</div>
|
68 |
+
<ul class="add-to-links">
|
69 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
70 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
71 |
+
<?php endif; ?>
|
72 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
73 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
74 |
+
<?php endif; ?>
|
75 |
+
</ul>
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
</li>
|
79 |
+
<?php endforeach; ?>
|
80 |
+
</ol>
|
81 |
+
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
|
82 |
+
|
83 |
+
<?php else: ?>
|
84 |
+
|
85 |
+
<?php // Grid Mode ?>
|
86 |
+
|
87 |
+
<?php $_collectionSize = $_productCollection->count() ?>
|
88 |
+
<?php $_columnCount = $this->getColumnCount(); ?>
|
89 |
+
<?php $i=0; ?>
|
90 |
+
<?php foreach ($_productCollection->getItems() as $_product): ?>
|
91 |
+
<?php if(!($_product instanceof Mage_Catalog_Model_Product)){ continue; }?>
|
92 |
+
|
93 |
+
<?php if ($i++%$_columnCount==0): ?>
|
94 |
+
<ul class="products-grid">
|
95 |
+
<?php endif ?>
|
96 |
+
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
|
97 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
98 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
|
99 |
+
<?php if($_product->getRatingSummary()): ?>
|
100 |
+
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
|
101 |
+
<?php endif; ?>
|
102 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
103 |
+
<div class="actions">
|
104 |
+
<?php if($_product->isSaleable()): ?>
|
105 |
+
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
106 |
+
<?php else: ?>
|
107 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
108 |
+
<?php endif; ?>
|
109 |
+
<ul class="add-to-links">
|
110 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
111 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
112 |
+
<?php endif; ?>
|
113 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
114 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
115 |
+
<?php endif; ?>
|
116 |
+
</ul>
|
117 |
+
</div>
|
118 |
+
</li>
|
119 |
+
<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
|
120 |
+
</ul>
|
121 |
+
<?php endif ?>
|
122 |
+
<?php endforeach ?>
|
123 |
+
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
|
124 |
+
<?php endif; ?>
|
125 |
+
</div>
|
126 |
+
<?php endif; ?>
|
app/design/frontend/default/default/template/epoqinterface/recommendation/product.phtml
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* *
|
3 |
+
* This script is part of the epoq Recommendation Service project *
|
4 |
+
* *
|
5 |
+
* TypoGento is free software; you can redistribute it and/or modify it *
|
6 |
+
* 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: product.phtml 487 2010-08-05 12:32:57Z weller $
|
15 |
+
* @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
|
16 |
+
*/
|
17 |
+
?>
|
18 |
+
|
19 |
+
<?php if(count($this->getItemCollection()->getItems())): ?>
|
20 |
+
<div class="collateral-box up-sell">
|
21 |
+
<div class="head"><h4><?php echo $this->__('epoq: You may also be interested in the following product(s)') ?></h4></div>
|
22 |
+
<table cellspacing="0" class="generic-product-grid catalog-listing" id="epoq-product-table">
|
23 |
+
<?php // $this->setColumnCount(4); // uncomment this line if you want to have another number of columns. also can be changed in layout ?>
|
24 |
+
<?php $this->resetItemsIterator() ?>
|
25 |
+
<?php for($_i=0;$_i<$this->getRowCount();$_i++): ?>
|
26 |
+
<tr>
|
27 |
+
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
|
28 |
+
<?php if($_link=$this->getIterableItem()): ?>
|
29 |
+
<td>
|
30 |
+
<p class="product-image"><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><img src="<?php echo $this->helper('catalog/image')->init($_link, 'small_image')->resize(125) ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_link->getName()) ?>" /></a></p>
|
31 |
+
<h5><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><?php echo $this->htmlEscape($_link->getName()) ?></a></h5>
|
32 |
+
<?php echo $this->getPriceHtml($_link, true) ?>
|
33 |
+
<?php echo $this->getReviewsSummaryHtml($_link) ?>
|
34 |
+
</td>
|
35 |
+
<?php else: ?>
|
36 |
+
<td class="empty-product"> </td>
|
37 |
+
<?php endif; ?>
|
38 |
+
<?php endfor; ?>
|
39 |
+
</tr>
|
40 |
+
<?php endfor; ?>
|
41 |
+
</table>
|
42 |
+
<script type="text/javascript">decorateTable('upsell-product-table')</script>
|
43 |
+
</div>
|
44 |
+
<script type="text/javascript">
|
45 |
+
$$('a.epoq-recommendation-link').each(function(elem, index){
|
46 |
+
var newParam = 'recommendation_id=<?php echo $this->getSession()->getLastRecommendationId();?>';
|
47 |
+
if (elem.href.indexOf('recommendation_id') == '-1') {
|
48 |
+
params = elem.href.replace(new RegExp('[\?&]' + 'recommendation_id' + '[^&]*'), RegExp.$1 + newParam);
|
49 |
+
if (params === elem.href) {
|
50 |
+
if(elem.href.indexOf('?') == '-1'){
|
51 |
+
params += '?' + newParam;
|
52 |
+
}else{
|
53 |
+
params += '&' + newParam;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
elem.href = params;
|
57 |
+
}
|
58 |
+
});
|
59 |
+
</script>
|
60 |
+
<?php endif ?>
|
app/design/frontend/default/default/template/epoqinterface/recommendation/user.phtml
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* *
|
3 |
+
* This script is part of the epoq Recommendation Service project *
|
4 |
+
* *
|
5 |
+
* TypoGento is free software; you can redistribute it and/or modify it *
|
6 |
+
* 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: user.phtml 487 2010-08-05 12:32:57Z weller $
|
15 |
+
* @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
|
16 |
+
*/
|
17 |
+
?>
|
18 |
+
|
19 |
+
<?php if(count($this->getItemCollection()->getItems())): ?>
|
20 |
+
|
21 |
+
<div class="account-box up-sell">
|
22 |
+
<div class="head"><h4><?php echo $this->__('epoq: You may also be interested in the following product(s)') ?></h4></div>
|
23 |
+
<table cellspacing="0" class="generic-product-grid catalog-listing" id="upsell-product-table">
|
24 |
+
<?php // $this->setColumnCount(4); // uncomment this line if you want to have another number of columns. also can be changed in layout ?>
|
25 |
+
<?php $this->resetItemsIterator() ?>
|
26 |
+
<?php for($_i=0;$_i<$this->getRowCount();$_i++): ?>
|
27 |
+
<tr>
|
28 |
+
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
|
29 |
+
<?php if($_link=$this->getIterableItem()): ?>
|
30 |
+
<td>
|
31 |
+
<p class="product-image"><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><img src="<?php echo $this->helper('catalog/image')->init($_link, 'small_image')->resize(125) ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_link->getName()) ?>" /></a></p>
|
32 |
+
<h5><a href="<?php echo $_link->getProductUrl() ?>" class="epoq-recommendation-link"><?php echo $this->htmlEscape($_link->getName()) ?></a></h5>
|
33 |
+
<?php echo $this->getPriceHtml($_link, true) ?>
|
34 |
+
<?php echo $this->getReviewsSummaryHtml($_link) ?>
|
35 |
+
</td>
|
36 |
+
<?php else: ?>
|
37 |
+
<td class="empty-product"> </td>
|
38 |
+
<?php endif; ?>
|
39 |
+
<?php endfor; ?>
|
40 |
+
</tr>
|
41 |
+
<?php endfor; ?>
|
42 |
+
</table>
|
43 |
+
<script type="text/javascript">decorateTable('upsell-product-table')</script>
|
44 |
+
</div>
|
45 |
+
<script type="text/javascript">
|
46 |
+
$$('a.epoq-recommendation-link').each(function(elem, index){
|
47 |
+
var newParam = 'recommendation_id=<?php echo $this->getSession()->getLastRecommendationId();?>',
|
48 |
+
params = '?' + newParam;
|
49 |
+
params = elem.href.replace(new RegExp('[\?&]' + 'recommendation_id' + '[^&]*'), '$1' + newParam);
|
50 |
+
if (params === elem.href) {
|
51 |
+
if(elem.href.indexOf('?') == '-1'){
|
52 |
+
params += '?' + newParam;
|
53 |
+
}else{
|
54 |
+
params += '&' + newParam;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
elem.href = params;
|
58 |
+
});
|
59 |
+
</script>
|
60 |
+
<?php endif ?>
|
app/locale/de_DE/Flagbit_EpoqInterface.csv
CHANGED
@@ -19,4 +19,8 @@
|
|
19 |
"%d Hours", "%d Stunden",
|
20 |
"Export Settings", "Export Einstellungen"
|
21 |
"Password", "Passwort"
|
22 |
-
"Up to date", "Aktuell"
|
|
|
|
|
|
|
|
19 |
"%d Hours", "%d Stunden",
|
20 |
"Export Settings", "Export Einstellungen"
|
21 |
"Password", "Passwort"
|
22 |
+
"Up to date", "Aktuell"
|
23 |
+
"Using Ajax", "Ajax benutzen"
|
24 |
+
"Product ID (default)", "Produkt-ID (Standard)"
|
25 |
+
"Product Identifier", "Produkt Identifizierung"
|
26 |
+
"Product SKU", "Produkt-SKU (Artikelnummer)"
|
js/epoqinterface/epoq_recommendations.js
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery.noConflict();
|
2 |
+
|
3 |
+
function addRecommendationsToPage(recommendationPids, recommendationId, data)
|
4 |
+
{
|
5 |
+
//customize here => http://www.IHRE_URL.com/shop/get-recommendation-htmlsrc.php?pid=4711&pid=0815&pid=1234 should deliver html code for the recommendation widget
|
6 |
+
// var recWidgetFromShopURL = "http://localhost:8080/ee-1.11.2.0/epoqinterface/recommendation/list?";
|
7 |
+
var recWidgetFromShopURL = "http://localhost:8080/magento-1.6.2.0/epoqinterface/recommendation/list?";
|
8 |
+
|
9 |
+
for(var i=0; i < recommendationPids.length; i++){
|
10 |
+
recWidgetFromShopURL+='pid[]='+recommendationPids[i]+'&';
|
11 |
+
}
|
12 |
+
|
13 |
+
//(be careful "same origin policy").
|
14 |
+
jQuery.ajax({
|
15 |
+
url: recWidgetFromShopURL,
|
16 |
+
cache: false,
|
17 |
+
success: function(html){
|
18 |
+
jQuery("#epoqWidget1").append(html); //alter here for auto tracking clicks on recommendations
|
19 |
+
/*
|
20 |
+
jQuery("#epoqWidget1 a").each( function()
|
21 |
+
{
|
22 |
+
this.href = this.href + "&eqrecqid=" + recommendationId;
|
23 |
+
} );
|
24 |
+
*/
|
25 |
+
},
|
26 |
+
reccommands: {}
|
27 |
+
});
|
28 |
+
|
29 |
+
}
|
30 |
+
|
31 |
+
epoq.go({
|
32 |
+
tenantId: epoq_tenantId,
|
33 |
+
sessionId: epoq_sessionId,
|
34 |
+
// rules: "InCategoryFilter;NotInCategoryFilter",
|
35 |
+
rules: "default;default1",
|
36 |
+
productId: epoq_productId,
|
37 |
+
demo: epoq_demoMode,
|
38 |
+
success: function (data)
|
39 |
+
{
|
40 |
+
var recommendations = data['recommendations'];
|
41 |
+
if(typeof(recommendations['domain']) != "undefined")
|
42 |
+
{
|
43 |
+
if(typeof(recommendations['domain'][0]) != "undefined") {
|
44 |
+
//isagteaser
|
45 |
+
var recommendationPids = new Array();
|
46 |
+
for(var i=0; i < recommendations['domain'][0]['items'].item.length; i++){
|
47 |
+
recommendationPids[i] = recommendations['domain'][0]['items'].item[i]['@id'];
|
48 |
+
}
|
49 |
+
var recommendationId = recommendations.domain[0].recommendationId['$'];
|
50 |
+
addRecommendationsToPage(recommendationPids, recommendationId, data);
|
51 |
+
}
|
52 |
+
|
53 |
+
if(typeof(recommendations['domain'][1]) != "undefined") {
|
54 |
+
//isagentrypage
|
55 |
+
var recommendationPids = new Array();
|
56 |
+
for(var i=0; i < recommendations['domain'][1]['items'].item.length; i++){
|
57 |
+
recommendationPids[i] = recommendations['domain'][1]['items'].item[i]['@id'];
|
58 |
+
}
|
59 |
+
var recommendationId = recommendations.domain[1].recommendationId['$'];
|
60 |
+
addRecommendationsToPage(recommendationPids, recommendationId, data);
|
61 |
+
}
|
62 |
+
|
63 |
+
|
64 |
+
}
|
65 |
+
}
|
66 |
+
});
|
package.xml
CHANGED
@@ -1,23 +1,27 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>epoqRS</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Integrates the epoq Recommendation Service for improved product consulting and cross selling functionality.</summary>
|
10 |
-
<description>epoq RS offers an intelligent, self-learning recommendation service for web shops that increase sales by up to 15% through efficient management of cross selling, increase of conversion rates and increased customer satisfaction
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
<notes>- Minor
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
21 |
<compatible/>
|
22 |
-
<dependencies
|
23 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>epoqRS</name>
|
4 |
+
<version>1.2.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Integrates the epoq Recommendation Service for improved product consulting and cross selling functionality.</summary>
|
10 |
+
<description>epoq RS offers an intelligent, self-learning recommendation service for web shops that increase sales by up to 15% through efficient management of cross selling, increase of conversion rates and increased customer satisfaction.
|
11 |
+

|
12 |
+
The quick and easy integration of epoq RS makes your Magento sell more within a few hours. You do not have to submit and update your product data and there is no need to connect to any internal systems - all available information - click stream, product data, cart information - are automatically processed for maximum quality recommendations.
|
13 |
+

|
14 |
+
Try epoq Recommendation Service - free and without obligation in our 30-day trial version.</description>
|
15 |
+
<notes>- Minor Bugfixes
|
16 |
+
- Ajax support
|
17 |
+
- Cookies
|
18 |
+
- Transmission of SKU / ProduktId
|
19 |
+
- Newsletter Template
|
20 |
+
</notes>
|
21 |
+
<authors><author><name>FlagbitFlagbit GmbH Co. KG</name><user>flagbit</user><email>magento@flagbit.de</email></author></authors>
|
22 |
+
<date>2012-07-11</date>
|
23 |
+
<time>11:14:02</time>
|
24 |
+
<contents><target name="magecommunity"><dir name="Flagbit"><dir name="EpoqInterface"><dir name="Block"><file name="Abstract.php" hash="17e13dfe4a8dfd2bd78ed76d5b5a41b4"/><dir name="Export"><file name="Productlist.php" hash="ea9ff392847cbaf7ed5f17e97d2af398"/></dir><file name="Head.php" hash="a898e39f4f86c0fcb8555c8d37e7ea2f"/><dir name="Recommendation"><file name="Abstract.php" hash="9e89b41685a41515ffd347fd58af0807"/><file name="Ajaxproduct.php" hash="558658147d6227436ff64996798e1fca"/><file name="Cart.php" hash="7b437a86fbbccda2276aa4601bddfff7"/><file name="Product.php" hash="6da47eae68476a5b29c7fc6efb3d17f8"/><file name="User.php" hash="ae2dc9c26c73ab7a1850e0eaf21fa755"/></dir><dir name="Result"><file name="List.php" hash="247ba01688e5d9f89cf21fd0d73faf1f"/></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="c7b3b8749e7838759a8858f6ae4910f8"/><file name="Order.php" hash="5280a5644c6fb62493d6853dafb887e5"/><file name="Product.php" hash="8bdef16f8d9741328cbf841401069a6c"/></dir></dir><dir name="Helper"><file name="Data.php" hash="5dc4a2feab4aa81f40efda3313daf7de"/><file name="Debug.php" hash="7ab1e3121471d87ee59f02d129f308be"/></dir><dir name="Model"><file name="Abstract.php" hash="68922066f28d44cf99a60ce164ed46d2"/><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><file name="Observer.php" hash="fa554bcc512f2c7d3b383b16ce41ebee"/><file name="Order.php" hash="ea86b408bd6a809ccd6f2b0f85b3f4d0"/><dir name="Recommendation"><file name="Abstract.php" hash="78dfd31831c1f9f8fe6ea1d52efa9df0"/><file name="Cart.php" hash="09d517aaef0bb286fb391f30d5fd0515"/><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="21e261decb48d356d051e92d9e2c9649"/></dir></dir></dir></dir><file name="Session.php" hash="413f7d31ad2d5878f20a7db7adf5d207"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Attemps.php" hash="c01ebd5c76fd4d51305ed7111326d57d"/><file name="Identifier.php" hash="9e56f688a92a5691a5934e47f42144b6"/><file name="Idletime.php" hash="957ec9d0c4af2d52add60a9765c4e573"/><file name="Timeout.php" hash="95c38625ad50dc44ba2b2d371de1db65"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="6ea3c2de180540e082f0598133355e69"/><file name="RecommendationController.php" hash="ccf91e227c725fae068383a58bf7a471"/></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="7ed329563d8914670ae1ddeb399de34d"/><file name="config.xml" hash="b9ca56e78d36de3a80929a8cb793aff6"/><file name="system.xml" hash="58e3970181649fae2039e444319c6e60"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Flagbit_EpoqInterface.xml" hash="8ada99bfdbcc7727ad36339bc11da6ec"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Flagbit_EpoqInterface.csv" hash="222d5eaedfde0639dd26f91c52dc395e"/></dir></target><target name="mageweb"><dir name="js"><dir name="epoqinterface"><file name="epoq_recommendations.js" hash="b7a0cd229fba65f358889a071ec57623"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="epoqinterface.xml" hash="05938a86a2901d5214494c48fb2294c2"/></dir><dir name="template"><dir name="epoqinterface"><dir name="recommendation"><file name="cart.phtml" hash="d508fe280f9ef8428fb2aa99a1b47baf"/><file name="checkout.phtml" hash="f659b0174326292a8230167cf1b6734f"/><file name="list.phtml" hash="c6c9c45f81993542dd182abea8c88f43"/><file name="mailproduct.phtml" hash="a81b28b9bee47f9e63a58ef87b7bb898"/><file name="product.phtml" hash="a558cf1a1dec1de784e7f05405dd83be"/><file name="user.phtml" hash="a3e884ce1f8ca6ab5ed4383e43b044d8"/></dir></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="epoqinterface.xml" hash="3505b6440076055ecdef51acaf0c0987"/></dir><dir name="template"><dir name="epoqinterface"><dir name="recommendation"><file name="cart.phtml" hash="d508fe280f9ef8428fb2aa99a1b47baf"/><file name="list.phtml" hash="92158be9c3dddca88cbd202aab666d39"/><file name="product.phtml" hash="a558cf1a1dec1de784e7f05405dd83be"/><file name="user.phtml" hash="a3e884ce1f8ca6ab5ed4383e43b044d8"/></dir></dir></dir></dir></dir></dir></target></contents>
|
25 |
<compatible/>
|
26 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
27 |
</package>
|