Version Notes
Integration of econda Cross Sell export.
Download this release
Release Info
Developer | ecdev |
Extension | Econda_Recommendationexp |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Econda/Recommendationexp/Helper/Data.php +26 -0
- app/code/community/Econda/Recommendationexp/Helper/Recommendation.php +206 -0
- app/code/community/Econda/Recommendationexp/Model/System/Config/Source/Export.php +30 -0
- app/code/community/Econda/Recommendationexp/Model/System/Config/Source/Product.php +30 -0
- app/code/community/Econda/Recommendationexp/Model/System/Config/Source/Remote.php +30 -0
- app/code/community/Econda/Recommendationexp/controllers/IndexController.php +102 -0
- app/code/community/Econda/Recommendationexp/etc/config.xml +108 -0
- app/code/community/Econda/Recommendationexp/etc/system.xml +94 -0
- app/etc/modules/Econda_Recommendationexp.xml +33 -0
- package.xml +21 -0
app/code/community/Econda/Recommendationexp/Helper/Data.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Econda
|
16 |
+
* @package Econda_Recommendation
|
17 |
+
* @copyright Copyright (c) 2012 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Receive translation values for tracking
|
23 |
+
*/
|
24 |
+
class Econda_Recommendationexp_Helper_Data extends Mage_Core_Block_Template
|
25 |
+
{
|
26 |
+
}
|
app/code/community/Econda/Recommendationexp/Helper/Recommendation.php
ADDED
@@ -0,0 +1,206 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Econda
|
16 |
+
* @package Econda_Recommendationexp
|
17 |
+
* @copyright Copyright (c) 2014 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
* @author Edgar Gaiser <info@econda.de>
|
20 |
+
*/
|
21 |
+
|
22 |
+
class Econda_Recommendationexp_Helper_Recommendation
|
23 |
+
{
|
24 |
+
|
25 |
+
public function __construct()
|
26 |
+
{
|
27 |
+
}
|
28 |
+
|
29 |
+
public function getProducts($store)
|
30 |
+
{
|
31 |
+
$storeId = $store;
|
32 |
+
$products = Mage::getModel('catalog/product')->getCollection();
|
33 |
+
$products->addAttributeToSelect('*');
|
34 |
+
$products->addStoreFilter($storeId);
|
35 |
+
$products->addAttributeToFilter('status', 1);
|
36 |
+
return $products;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function getProductCsv($product, $store)
|
40 |
+
{
|
41 |
+
$separator = "|";
|
42 |
+
$csv = "";
|
43 |
+
$csv .= trim($this->getProductId($product, $store)).$separator;
|
44 |
+
$csv .= trim($this->getProductName($product)).$separator;
|
45 |
+
$csv .= trim($this->getProductDescription($product)).$separator;
|
46 |
+
$csv .= trim($product->getProductUrl()).$separator;
|
47 |
+
$csv .= trim($this->getProductImage($product)).$separator;
|
48 |
+
$csv .= trim($this->getProductPrice($product)).$separator;
|
49 |
+
$csv .= trim($this->getProductPriceOld($product)).$separator;
|
50 |
+
$csv .= trim($this->getProductNew($product)).$separator;
|
51 |
+
$csv .= trim($this->getProductQty($product)).$separator;
|
52 |
+
$csv .= trim($product->getSKU()).$separator;
|
53 |
+
$csv .= trim($this->getProductBrand($product)).$separator;
|
54 |
+
$csv .= trim($this->getProductCategoriesCsv($product));
|
55 |
+
return $csv;
|
56 |
+
}
|
57 |
+
|
58 |
+
public function getCategoriesCsv($store)
|
59 |
+
{
|
60 |
+
$storeId = $store;
|
61 |
+
$collection = Mage::getModel('catalog/category')->getCollection()->setStoreId($storeId);
|
62 |
+
$catIds = $collection->getAllIds();
|
63 |
+
$separator = "|";
|
64 |
+
$cat = Mage::getModel('catalog/category');
|
65 |
+
$csv = "";
|
66 |
+
|
67 |
+
foreach ($catIds as $catId) {
|
68 |
+
$category = $cat->load($catId);
|
69 |
+
if($category->getLevel() != 0) {
|
70 |
+
$catPath = explode('/',$category->getPath());
|
71 |
+
$catParent = $catPath[sizeof($catPath)-2];
|
72 |
+
$csv .= $category->getId().$separator;
|
73 |
+
if($category->getLevel() == 1) {
|
74 |
+
$csv .= "".$separator;
|
75 |
+
}
|
76 |
+
else {
|
77 |
+
$csv .= $catParent.$separator;
|
78 |
+
}
|
79 |
+
$csv .= trim($category->getName())."\n";
|
80 |
+
}
|
81 |
+
}
|
82 |
+
return $csv;
|
83 |
+
}
|
84 |
+
|
85 |
+
public function getProductCategoriesCsv($product)
|
86 |
+
{
|
87 |
+
$separator = "^^";
|
88 |
+
$catIds = $product->getCategoryIds();
|
89 |
+
$csv = "";
|
90 |
+
foreach ($catIds as $catId) {
|
91 |
+
$csv .= $separator.$catId;
|
92 |
+
}
|
93 |
+
return substr($csv, 2);
|
94 |
+
}
|
95 |
+
|
96 |
+
public function getProductName($product)
|
97 |
+
{
|
98 |
+
$product_name = $product->getName();
|
99 |
+
$product_name = str_replace("\n", "", strip_tags($product_name));
|
100 |
+
$product_name = str_replace("\r", "", strip_tags($product_name));
|
101 |
+
$product_name = str_replace("\t", " ", strip_tags($product_name));
|
102 |
+
return $product_name;
|
103 |
+
}
|
104 |
+
|
105 |
+
public function getProductId($product, $store)
|
106 |
+
{
|
107 |
+
$idType = Mage::getStoreConfig('recommendationexp/recommendationexp_settings/recommendationexp_productid', $store);
|
108 |
+
if($idType == '1') {
|
109 |
+
$product_id = $product->getSku();
|
110 |
+
}
|
111 |
+
else {
|
112 |
+
$product_id = $product->getId();
|
113 |
+
}
|
114 |
+
return $product_id;
|
115 |
+
}
|
116 |
+
|
117 |
+
public function getProductImage($product)
|
118 |
+
{
|
119 |
+
return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . "catalog/product" . $product->getImage();
|
120 |
+
}
|
121 |
+
|
122 |
+
public function getProductPrice($product)
|
123 |
+
{
|
124 |
+
$taxHelper = Mage::helper('tax');
|
125 |
+
|
126 |
+
if ( $product->getSpecialPrice() && (date("Y-m-d G:i:s") > $product->getSpecialFromDate() || !$product->getSpecialFromDate()) && (date("Y-m-d G:i:s") < $product->getSpecialToDate() || !$product->getSpecialToDate())){
|
127 |
+
$price = $product->getSpecialPrice();
|
128 |
+
}
|
129 |
+
else {
|
130 |
+
$price = $product->getPrice();
|
131 |
+
}
|
132 |
+
$priceTax = $taxHelper->getPrice($product, $price, true);
|
133 |
+
return $priceTax;
|
134 |
+
}
|
135 |
+
|
136 |
+
public function getProductPriceOld($product)
|
137 |
+
{
|
138 |
+
$taxHelper = Mage::helper('tax');
|
139 |
+
$price = $product->getPrice();
|
140 |
+
$priceTax = $taxHelper->getPrice($product, $price, true);
|
141 |
+
return $priceTax;
|
142 |
+
}
|
143 |
+
|
144 |
+
public function getProductNew($product)
|
145 |
+
{
|
146 |
+
$now = date("Y-m-d");
|
147 |
+
$newsFrom = substr($product->getData('news_from_date'),0,10);
|
148 |
+
$newsTo = substr($product->getData('news_to_date'),0,10);
|
149 |
+
if($now >= $newsFrom && $now <= $newsTo) {
|
150 |
+
return '1';
|
151 |
+
}
|
152 |
+
return '0';
|
153 |
+
}
|
154 |
+
|
155 |
+
public function getProductBrand($product)
|
156 |
+
{
|
157 |
+
if ($product->getResource()->getAttribute('manufacturer')) {
|
158 |
+
$manufacturer = $product->getResource()->getAttribute('manufacturer')->getFrontend()->getValue($product);
|
159 |
+
if (strtolower($manufacturer) == "no") {
|
160 |
+
$manufacturer = "";
|
161 |
+
return $manufacturer;
|
162 |
+
}
|
163 |
+
else {
|
164 |
+
return $manufacturer;
|
165 |
+
}
|
166 |
+
}
|
167 |
+
else {
|
168 |
+
return $manufacturer = "";
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
+
public function getProductDescription($product)
|
173 |
+
{
|
174 |
+
$description = strip_tags($product->getData('short_description'));
|
175 |
+
$description = preg_replace("/\r|\n/s", "", $description);
|
176 |
+
return substr($description, 0, 100);
|
177 |
+
}
|
178 |
+
|
179 |
+
public function getProductQty($product)
|
180 |
+
{
|
181 |
+
$qty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
|
182 |
+
return (int)$qty;
|
183 |
+
}
|
184 |
+
|
185 |
+
public function getStoreList()
|
186 |
+
{
|
187 |
+
$separator = "|";
|
188 |
+
$csv = "";
|
189 |
+
$allStores = Mage::app()->getStores();
|
190 |
+
foreach ($allStores as $eachStoreId => $val)
|
191 |
+
{
|
192 |
+
$storeCode = Mage::app()->getStore($eachStoreId)->getCode();
|
193 |
+
$storeName = Mage::app()->getStore($eachStoreId)->getName();
|
194 |
+
$storeId = Mage::app()->getStore($eachStoreId)->getId();
|
195 |
+
$storeActiv = Mage::app()->getStore($eachStoreId)->getIsActive();
|
196 |
+
$storeUrl = Mage::app()->getStore($eachStoreId)->getHomeUrl();
|
197 |
+
$csv .= $storeId.$separator;
|
198 |
+
$csv .= $storeName.$separator;
|
199 |
+
$csv .= $storeCode.$separator;
|
200 |
+
$csv .= $storeActiv.$separator;
|
201 |
+
$csv .= $storeUrl.$separator;
|
202 |
+
$csv .= "\n";
|
203 |
+
}
|
204 |
+
return $csv;
|
205 |
+
}
|
206 |
+
}
|
app/code/community/Econda/Recommendationexp/Model/System/Config/Source/Export.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Econda
|
16 |
+
* @package Econda_Recommendationexp
|
17 |
+
* @copyright Copyright (c) 2014 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class Econda_Recommendationexp_Model_System_Config_Source_Export
|
22 |
+
{
|
23 |
+
public function toOptionArray()
|
24 |
+
{
|
25 |
+
return array(
|
26 |
+
array('value'=>'0', 'label'=>Mage::helper('catalog/data')->__('No')),
|
27 |
+
array('value'=>'1', 'label'=>Mage::helper('catalog/data')->__('Yes'))
|
28 |
+
);
|
29 |
+
}
|
30 |
+
}
|
app/code/community/Econda/Recommendationexp/Model/System/Config/Source/Product.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Econda
|
16 |
+
* @package Econda_Recommendationexp
|
17 |
+
* @copyright Copyright (c) 2014 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class Econda_Recommendationexp_Model_System_Config_Source_Product
|
22 |
+
{
|
23 |
+
public function toOptionArray()
|
24 |
+
{
|
25 |
+
return array(
|
26 |
+
array('value'=>'0', 'label'=>'Magento Product ID'),
|
27 |
+
array('value'=>'1', 'label'=>'SKU')
|
28 |
+
);
|
29 |
+
}
|
30 |
+
}
|
app/code/community/Econda/Recommendationexp/Model/System/Config/Source/Remote.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Econda
|
16 |
+
* @package Econda_Recommendationexp
|
17 |
+
* @copyright Copyright (c) 2014 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
class Econda_Recommendationexp_Model_System_Config_Source_Remote
|
22 |
+
{
|
23 |
+
public function toOptionArray()
|
24 |
+
{
|
25 |
+
return array(
|
26 |
+
array('value'=>'', 'label'=>'')
|
27 |
+
);
|
28 |
+
}
|
29 |
+
|
30 |
+
}
|
app/code/community/Econda/Recommendationexp/controllers/IndexController.php
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @package Econda_Recommendationexp
|
16 |
+
* @copyright Copyright (c) 2014 econda GmbH (http://www.econda.de)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
* @author Edgar Gaiser <info@econda.de>
|
19 |
+
*/
|
20 |
+
|
21 |
+
class Econda_Recommendationexp_IndexController extends Mage_Core_Controller_Front_Action
|
22 |
+
{
|
23 |
+
public function preDispatch()
|
24 |
+
{
|
25 |
+
parent::preDispatch();
|
26 |
+
}
|
27 |
+
|
28 |
+
public function indexAction()
|
29 |
+
{
|
30 |
+
if(!isset($_GET['store']) && !isset($_GET['type'])) {
|
31 |
+
die;
|
32 |
+
}
|
33 |
+
|
34 |
+
$storeId = $_GET['store'];
|
35 |
+
$eEnabled = Mage::getStoreConfig('recommendationexp/recommendationexp_settings/recommendationexp_export', $storeId);
|
36 |
+
$remote = Mage::getStoreConfig('recommendationexp/recommendationexp_settings/recommendationexp_remote', $storeId);
|
37 |
+
|
38 |
+
if(trim($remote) != "") {
|
39 |
+
$remoteAdress = $_SERVER['REMOTE_ADDR'] == $remote ? true : false;
|
40 |
+
}
|
41 |
+
else {
|
42 |
+
$remoteAdress = true;
|
43 |
+
}
|
44 |
+
if($eEnabled != '1' || !$remoteAdress) {
|
45 |
+
die;
|
46 |
+
}
|
47 |
+
if($_GET['type'] != '1' && $_GET['type'] != '2' && $_GET['type'] != '0') {
|
48 |
+
die;
|
49 |
+
}
|
50 |
+
|
51 |
+
$actStore = null;
|
52 |
+
$stores = Mage::app()->getStores();
|
53 |
+
foreach ($stores as $store => $val)
|
54 |
+
{
|
55 |
+
$storeIdShop = Mage::app()->getStore($store)->getId();
|
56 |
+
if($storeIdShop == $storeId) {
|
57 |
+
$actstore = $storeId;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
if($actstore == null) {
|
61 |
+
die;
|
62 |
+
}
|
63 |
+
$cross = Mage::helper('recommendationexp/recommendation');
|
64 |
+
$csv = "";
|
65 |
+
|
66 |
+
// Products
|
67 |
+
if($_GET['type'] == '1') {
|
68 |
+
$filename = "products.csv";
|
69 |
+
$csv .= "ID|Name|Description|ProductURL|ImageURL|Price|OldPrice|New|Stock|SKU|Brand|ProductCategory\n";
|
70 |
+
$products = $cross->getProducts($actstore);
|
71 |
+
foreach ($products as $product) {
|
72 |
+
$csv .= $cross->getProductCsv($product, $actstore)."\n";
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
// Categories
|
77 |
+
else if($_GET['type'] == '2') {
|
78 |
+
$filename = "categories.csv";
|
79 |
+
$csv .= "ID|ParentID|Name\n";
|
80 |
+
$csv .= $cross->getCategoriesCsv($actstore);
|
81 |
+
}
|
82 |
+
|
83 |
+
// Get Store list
|
84 |
+
else if($_GET['type'] == '0') {
|
85 |
+
$filename = "stores.csv";
|
86 |
+
$csv .= "ID|Name|Code|isActive|homeUrl\n";
|
87 |
+
$csv .= $cross->getStoreList();
|
88 |
+
}
|
89 |
+
else {
|
90 |
+
die;
|
91 |
+
}
|
92 |
+
|
93 |
+
$csv = trim($csv);
|
94 |
+
|
95 |
+
header("Content-Type: text/csv");
|
96 |
+
header("Content-Disposition: attachment; filename=$filename");
|
97 |
+
header("Content-Description: csv File");
|
98 |
+
header("Pragma: no-cache");
|
99 |
+
header("Expires: 0");
|
100 |
+
echo $csv;
|
101 |
+
}
|
102 |
+
}
|
app/code/community/Econda/Recommendationexp/etc/config.xml
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category Econda
|
17 |
+
* @package Econda_Recommendationexp
|
18 |
+
* @copyright Copyright (c) 2014 econda GmbH (http://www.econda.de)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
<config>
|
23 |
+
<modules>
|
24 |
+
<Econda_Recommendationexp>
|
25 |
+
<version>1.0.1</version>
|
26 |
+
</Econda_Recommendationexp>
|
27 |
+
</modules>
|
28 |
+
<frontend>
|
29 |
+
<routers>
|
30 |
+
<recommendationexp>
|
31 |
+
<use>standard</use>
|
32 |
+
<args>
|
33 |
+
<module>Econda_Recommendationexp</module>
|
34 |
+
<frontName>recommendationexp</frontName>
|
35 |
+
</args>
|
36 |
+
</recommendationexp>
|
37 |
+
</routers>
|
38 |
+
</frontend>
|
39 |
+
<admin>
|
40 |
+
<routers>
|
41 |
+
<recommendationexp>
|
42 |
+
<use>admin</use>
|
43 |
+
<args>
|
44 |
+
<module>Econda_Recommendationexp</module>
|
45 |
+
<frontName>recommendationexp</frontName>
|
46 |
+
</args>
|
47 |
+
</recommendationexp>
|
48 |
+
</routers>
|
49 |
+
</admin>
|
50 |
+
<adminhtml>
|
51 |
+
<acl>
|
52 |
+
<resources>
|
53 |
+
<admin>
|
54 |
+
<children>
|
55 |
+
<system>
|
56 |
+
<children>
|
57 |
+
<config>
|
58 |
+
<children>
|
59 |
+
<recommendationexp module="recommendationexp">
|
60 |
+
<title>Recommendation Section</title>
|
61 |
+
</recommendationexp>
|
62 |
+
</children>
|
63 |
+
</config>
|
64 |
+
</children>
|
65 |
+
</system>
|
66 |
+
</children>
|
67 |
+
</admin>
|
68 |
+
</resources>
|
69 |
+
</acl>
|
70 |
+
</adminhtml>
|
71 |
+
<global>
|
72 |
+
<resources>
|
73 |
+
<recommendationexp_setup>
|
74 |
+
<setup>
|
75 |
+
<module>Econda_Recommendationexp</module>
|
76 |
+
</setup>
|
77 |
+
<connection>
|
78 |
+
<use>core_setup</use>
|
79 |
+
</connection>
|
80 |
+
</recommendationexp_setup>
|
81 |
+
<recommendationexp_write>
|
82 |
+
<connection>
|
83 |
+
<use>core_write</use>
|
84 |
+
</connection>
|
85 |
+
</recommendationexp_write>
|
86 |
+
<recommendationexp_read>
|
87 |
+
<connection>
|
88 |
+
<use>core_read</use>
|
89 |
+
</connection>
|
90 |
+
</recommendationexp_read>
|
91 |
+
</resources>
|
92 |
+
<blocks>
|
93 |
+
<recommendationexp>
|
94 |
+
<class>Econda_Recommendationexp_Block</class>
|
95 |
+
</recommendationexp>
|
96 |
+
</blocks>
|
97 |
+
<helpers>
|
98 |
+
<recommendationexp>
|
99 |
+
<class>Econda_Recommendationexp_Helper</class>
|
100 |
+
</recommendationexp>
|
101 |
+
</helpers>
|
102 |
+
<models>
|
103 |
+
<recommendationexp>
|
104 |
+
<class>Econda_Recommendationexp_Model</class>
|
105 |
+
</recommendationexp>
|
106 |
+
</models>
|
107 |
+
</global>
|
108 |
+
</config>
|
app/code/community/Econda/Recommendationexp/etc/system.xml
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category Econda
|
17 |
+
* @package Econda_Recommendationexp
|
18 |
+
* @copyright Copyright (c) 2014 econda GmbH (http://www.econda.de)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
<config>
|
23 |
+
<sections>
|
24 |
+
<recommendationexp module="recommendationexp">
|
25 |
+
<label>econda Cross Sell Export</label>
|
26 |
+
<tab>sales</tab>
|
27 |
+
<frontend_type>text</frontend_type>
|
28 |
+
<sort_order>336</sort_order>
|
29 |
+
<show_in_default>1</show_in_default>
|
30 |
+
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_store>1</show_in_store>
|
32 |
+
<groups>
|
33 |
+
<info translate="label">
|
34 |
+
<label>Info</label>
|
35 |
+
<sort_order>10</sort_order>
|
36 |
+
<frontend_type>text</frontend_type>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>1</show_in_store>
|
40 |
+
<comment><![CDATA[
|
41 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight:bold;">Intelligente Kaufanreize - mehr als Recommendations</p>
|
42 |
+
econda Cross Sell vereint Recommendation-Engine, Online-Abverkaufstool und Re-Marketing Suite. Damit geht econda deutlich über bloße Produktempfehlungstools hinaus und setzt neue Maßstäbe in der Kundenkommunikation für Online-Shops.
|
43 |
+
<p> </p>
|
44 |
+
<button style="" class="scalable" type="button" onclick="window.open('http://www.econda.de/cross-sell/preisanfrage/')"><span>Jetzt unverbindliches Angebot anfordern!</span></button>
|
45 |
+
<script type="text/javascript">
|
46 |
+
document.observe('dom:loaded', function(){
|
47 |
+
$('recommendation_info').style.display='block';
|
48 |
+
});
|
49 |
+
</script>
|
50 |
+
]]></comment>
|
51 |
+
</info>
|
52 |
+
<recommendationexp_settings translate="label">
|
53 |
+
<label>Settings</label>
|
54 |
+
<sort_order>11</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
<fields>
|
59 |
+
<recommendationexp_export>
|
60 |
+
<label>Enable Product Export</label>
|
61 |
+
<comment>Enable product export via HTTP.</comment>
|
62 |
+
<frontend_type>select</frontend_type>
|
63 |
+
<source_model>recommendationexp/system_config_source_export</source_model>
|
64 |
+
<sort_order>1</sort_order>
|
65 |
+
<show_in_default>1</show_in_default>
|
66 |
+
<show_in_website>1</show_in_website>
|
67 |
+
<show_in_store>1</show_in_store>
|
68 |
+
</recommendationexp_export>
|
69 |
+
<recommendationexp_productid>
|
70 |
+
<label>Product ID</label>
|
71 |
+
<comment>Use the Magento Item ID or SKU for Export</comment>
|
72 |
+
<frontend_type>select</frontend_type>
|
73 |
+
<source_model>recommendationexp/system_config_source_product</source_model>
|
74 |
+
<sort_order>2</sort_order>
|
75 |
+
<show_in_default>1</show_in_default>
|
76 |
+
<show_in_website>1</show_in_website>
|
77 |
+
<show_in_store>1</show_in_store>
|
78 |
+
</recommendationexp_productid>
|
79 |
+
<recommendationexp_remote>
|
80 |
+
<label>Limit access (Optional)</label>
|
81 |
+
<comment>Limit access to a specified econda IP. You can receive this information from your econda support.</comment>
|
82 |
+
<frontend_type>text</frontend_type>
|
83 |
+
<source_model>recommendationexp/system_config_source_remote</source_model>
|
84 |
+
<sort_order>3</sort_order>
|
85 |
+
<show_in_default>1</show_in_default>
|
86 |
+
<show_in_website>1</show_in_website>
|
87 |
+
<show_in_store>1</show_in_store>
|
88 |
+
</recommendationexp_remote>
|
89 |
+
</fields>
|
90 |
+
</recommendationexp_settings>
|
91 |
+
</groups>
|
92 |
+
</recommendationexp>
|
93 |
+
</sections>
|
94 |
+
</config>
|
app/etc/modules/Econda_Recommendationexp.xml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category Econda
|
17 |
+
* @package Econda_Recommendationexp
|
18 |
+
* @copyright Copyright (c) 2014 econda GmbH (http://www.econda.de)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
<config>
|
23 |
+
<modules>
|
24 |
+
<Econda_Recommendationexp>
|
25 |
+
<active>true</active>
|
26 |
+
<codePool>community</codePool>
|
27 |
+
<depends>
|
28 |
+
<Mage_Cms />
|
29 |
+
</depends>
|
30 |
+
</Econda_Recommendationexp>
|
31 |
+
</modules>
|
32 |
+
</config>
|
33 |
+
|
package.xml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Econda_Recommendationexp</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>The extension simplifies the data exchange between your Magento shop system and econda Cross Sell rec engine.</summary>
|
10 |
+
<description>Magento Cross Sell Extension
|
11 |
+
Increase sales with the intelligent econda Cross Sell recommendation engine for your Magento shop
|
12 |
+
econda Cross Sell provides self-learning buying recommendations for your customers
|
13 |
+
The extension simplifies the data exchange between your Magento shop system and econda Cross Sell</description>
|
14 |
+
<notes>Integration of econda Cross Sell export.</notes>
|
15 |
+
<authors><author><name>ecdev</name><user>ecmagento</user><email>reinecke@econda.de</email></author></authors>
|
16 |
+
<date>2014-02-10</date>
|
17 |
+
<time>13:43:30</time>
|
18 |
+
<contents><target name="magecommunity"><dir name="Econda"><dir name="Recommendationexp"><dir name="Helper"><file name="Data.php" hash="6d522c4a00fd86e8582236403bc835f2"/><file name="Recommendation.php" hash="93f0f348e4d81a9d0e98d9fa4c79afb8"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Export.php" hash="259b1765ee8b77ca24587e9fc56370d2"/><file name="Product.php" hash="0b19cd327a9d7d8f027e3b501aca550a"/><file name="Remote.php" hash="0b4a560e4c9a12fbc35f625cb1d20cb8"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="be604b415f58e8f1f4dddc0055f712d3"/></dir><dir name="etc"><file name="config.xml" hash="418948bfb239cf284b209773e04489b7"/><file name="system.xml" hash="ae5e10e9d2dafd0a32db845f4aad7c0f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Econda_Recommendationexp.xml" hash="0178abedf9c60081bf8edad9824eff66"/></dir></target></contents>
|
19 |
+
<compatible/>
|
20 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
21 |
+
</package>
|