Version Notes
this is a beta version
Download this release
Release Info
Developer | Magento Core Team |
Extension | Feed_Manager_Version_1_1_2 |
Version | 1.1.6 |
Comparing to | |
See all releases |
Code changes from version 1.1.99 to 1.1.6
- Readme.txt +0 -24
- magento_feedmanager.php +19 -1
- package.xml +8 -12
- productapi.php +112 -0
Readme.txt
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
|
2 |
-
Description:
|
3 |
-
--------------
|
4 |
-
Feedmanager enables you submit your products to shopping comparison engines.
|
5 |
-
Seamless integration with Magento and shopping comparison engines to provide a solution to list your store on shopping engines.
|
6 |
-
|
7 |
-
Works with magento 1.4x - 1.5x
|
8 |
-
|
9 |
-
|
10 |
-
Installation instructions:
|
11 |
-
---------------------------
|
12 |
-
1. Attached to this readme file is a script named magento_feedmanager.php
|
13 |
-
|
14 |
-
2. Install FeedManager from magento-connect - http://www.magentocommerce.com/magento-connect/rinkarto/extension/6771/feed_manager_version_1_1_2/
|
15 |
-
or extract the contents of the zipped file and upload magento_feedmanager.php file directly to your root folder on your store
|
16 |
-
eg. www.mystore.com/magento_feedmanager.php
|
17 |
-
|
18 |
-
3. Go to http://wwww.retailtower.com/register.php and register with us. We will contact you within 24hrs with your login details
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
Support:
|
23 |
-
---------
|
24 |
-
Visit support.retailtower.com or email: magentosupport@retailtower.com
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
magento_feedmanager.php
CHANGED
@@ -10,6 +10,8 @@ Mage::app();
|
|
10 |
|
11 |
$products = Mage::getModel('catalog/product')->getCollection();
|
12 |
$products->addAttributeToSelect('*');
|
|
|
|
|
13 |
$products->load();
|
14 |
|
15 |
$baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
@@ -17,6 +19,9 @@ Mage::app();
|
|
17 |
//echo "Total Count =: ".count($products);
|
18 |
//echo "<pre>";
|
19 |
//print_r($products);
|
|
|
|
|
|
|
20 |
|
21 |
$output = '<?xml version="1.0" encoding="utf-8"?>
|
22 |
<products>';
|
@@ -24,6 +29,7 @@ Mage::app();
|
|
24 |
if (count($products)):
|
25 |
|
26 |
foreach ($products as $id => $product):
|
|
|
27 |
$url = $product->getProductUrl();
|
28 |
$url = str_replace('/magento_feedmanager.php','',$url);
|
29 |
$url = trim ($url);
|
@@ -38,6 +44,11 @@ if (count($products)):
|
|
38 |
<minimalprice>'. $product['minimal_price'] .'</minimalprice>
|
39 |
|
40 |
<weight><![CDATA['. $product['weight'] .']]></weight>
|
|
|
|
|
|
|
|
|
|
|
41 |
<url><![CDATA['. $url.']]></url>
|
42 |
<meta><![CDATA['. $product['meta_keyword'] .']]></meta>
|
43 |
<metadescription><![CDATA['. $product['meta_description'] .']]></metadescription>
|
@@ -66,10 +77,17 @@ if (count($products)):
|
|
66 |
</product>';
|
67 |
|
68 |
endforeach;
|
69 |
-
|
70 |
endif;
|
71 |
|
|
|
|
|
|
|
|
|
|
|
72 |
header ("Content-Type: text/xml; charset=ISO-8859-1");
|
73 |
print $output .= '
|
74 |
</products>';
|
|
|
|
|
|
|
75 |
?>
|
10 |
|
11 |
$products = Mage::getModel('catalog/product')->getCollection();
|
12 |
$products->addAttributeToSelect('*');
|
13 |
+
$products->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED));
|
14 |
+
|
15 |
$products->load();
|
16 |
|
17 |
$baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
19 |
//echo "Total Count =: ".count($products);
|
20 |
//echo "<pre>";
|
21 |
//print_r($products);
|
22 |
+
//
|
23 |
+
|
24 |
+
|
25 |
|
26 |
$output = '<?xml version="1.0" encoding="utf-8"?>
|
27 |
<products>';
|
29 |
if (count($products)):
|
30 |
|
31 |
foreach ($products as $id => $product):
|
32 |
+
|
33 |
$url = $product->getProductUrl();
|
34 |
$url = str_replace('/magento_feedmanager.php','',$url);
|
35 |
$url = trim ($url);
|
44 |
<minimalprice>'. $product['minimal_price'] .'</minimalprice>
|
45 |
|
46 |
<weight><![CDATA['. $product['weight'] .']]></weight>
|
47 |
+
<categories><![CDATA['. $product['categories'] .']]></categories>
|
48 |
+
<color><![CDATA['. $product['color'] .']]></color>
|
49 |
+
<condition><![CDATA['. $product['condition'] .']]></condition>
|
50 |
+
<availability><![CDATA['. $product['availability'] .']]></availability>
|
51 |
+
<shipping><![CDATA['. $product['shipping'] .']]></shipping>
|
52 |
<url><![CDATA['. $url.']]></url>
|
53 |
<meta><![CDATA['. $product['meta_keyword'] .']]></meta>
|
54 |
<metadescription><![CDATA['. $product['meta_description'] .']]></metadescription>
|
77 |
</product>';
|
78 |
|
79 |
endforeach;
|
|
|
80 |
endif;
|
81 |
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
header ("Content-Type: text/xml; charset=ISO-8859-1");
|
88 |
print $output .= '
|
89 |
</products>';
|
90 |
+
|
91 |
+
|
92 |
+
|
93 |
?>
|
package.xml
CHANGED
@@ -1,22 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Feed_Manager_Version_1_1_2</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
<
|
16 |
-
<authors><author><name>admin</name><user>auto-converted</user><email>rinkart@retailtower.com</email></author></authors>
|
17 |
-
<date>2011-06-29</date>
|
18 |
-
<time>17:19:00</time>
|
19 |
-
<contents><target name="mageweb"><dir name="."><file name="magento_feedmanager.php" hash="b661b7a2ee0b8287d468679f41e9915e"/><file name="Readme.txt" hash="b39da4dfd2a7756d5baad50b2073fad7"/></dir></target></contents>
|
20 |
<compatible/>
|
21 |
<dependencies/>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Feed_Manager_Version_1_1_2</name>
|
4 |
+
<version>1.1.6</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>RetailTower is a FREE online solution that enables merchants to list their products on shopping comparison engines and create Facebook fanpage stores.</summary>
|
10 |
+
<description>RetailTower is a FREE online solution that enables merchants to list their products on shopping comparison engines and create Facebook fanpage stores.</description>
|
11 |
+
<notes>this is a beta version</notes>
|
12 |
+
<authors><author><name>Rinkart Asibey</name><user>auto-converted</user><email>rinkart@retailtower.com</email></author></authors>
|
13 |
+
<date>2011-10-27</date>
|
14 |
+
<time>22:18:50</time>
|
15 |
+
<contents><target name="mageweb"><dir name="."><file name="magento_feedmanager.php" hash="2cf109ef06669d877b4f3920a3f12f37"/><file name="productapi.php" hash="f922280bc5b720c760f8515b7c410706"/></dir></target></contents>
|
|
|
|
|
|
|
|
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
productapi.php
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
set_time_limit(300);
|
3 |
+
ini_set('memory_limit', '-1');
|
4 |
+
include_once 'app/Mage.php';
|
5 |
+
umask(0);
|
6 |
+
Mage::app();
|
7 |
+
|
8 |
+
|
9 |
+
$products = Mage::getModel('catalog/product')->getCollection();
|
10 |
+
$products->addAttributeToSelect('*');
|
11 |
+
$products->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED));
|
12 |
+
$products->load();
|
13 |
+
|
14 |
+
$baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
15 |
+
|
16 |
+
//echo "Total Count =: ".count($products);
|
17 |
+
//echo "<pre>";
|
18 |
+
//print_r($products);
|
19 |
+
|
20 |
+
$collection = Mage::getResourceModel('catalog/product_collection');
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
$output = '<?xml version="1.0" encoding="utf-8"?>
|
25 |
+
<products>';
|
26 |
+
if (count($collection)){
|
27 |
+
//echo "<pre>";
|
28 |
+
foreach ($products as $product){
|
29 |
+
//var_dump($product->getdata());die;
|
30 |
+
$output .= '<product>';
|
31 |
+
foreach ($product->getdata() as $key=>$value) {
|
32 |
+
if ($key!=='stock_item') {
|
33 |
+
//my code start
|
34 |
+
|
35 |
+
$url = $product->getProductUrl();
|
36 |
+
if (($key == 'url_path') || ($key =='url_key')){
|
37 |
+
$value = $url;
|
38 |
+
$value = str_replace('/productapi.php','',$value);
|
39 |
+
$value = trim ($value);
|
40 |
+
}
|
41 |
+
|
42 |
+
if ($key == 'image'){
|
43 |
+
$value = $baseUrl."media/catalog/product".$value;
|
44 |
+
//$value = str_replace('/productapi.php','',$value);
|
45 |
+
//$value = trim ($value);
|
46 |
+
}
|
47 |
+
|
48 |
+
if ($key == 'manufacturer'){
|
49 |
+
//$value = $baseUrl."media/catalog/product".$value;
|
50 |
+
$value = Mage::getModel('catalog/product')->load(PRODUCT_ID);
|
51 |
+
$value = $value->getAttributeText('manufacturer');
|
52 |
+
//$value = "kofi";
|
53 |
+
//$value = str_replace('/productapi.php','',$value);
|
54 |
+
//$value = trim ($value);
|
55 |
+
}
|
56 |
+
|
57 |
+
//$search = array('&','<','>','"','\'','-','—',"'",'(',')','™','®','©');
|
58 |
+
//$replace = array('&','<','>','"',''','-','―',''','(',')','&trade','®','©');
|
59 |
+
//$value = str_replace($search,$replace,$value);
|
60 |
+
/* $value = str_replace('&','',$value);
|
61 |
+
$value = str_replace('</br>','',$value);
|
62 |
+
$value = str_replace('<br/>','',$value);
|
63 |
+
$value = str_replace('>','',$value);
|
64 |
+
$value = str_replace('<','',$value);*/
|
65 |
+
$value = "<![CDATA[$value]]>";
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
$key = str_replace('"','',$key);
|
72 |
+
//my code end
|
73 |
+
|
74 |
+
$output .= '<'.$key.'>'.$value.'</'.$key.'>';
|
75 |
+
|
76 |
+
}
|
77 |
+
|
78 |
+
|
79 |
+
}
|
80 |
+
$categories = $product->getCategoryIds();
|
81 |
+
$output .= '<categories>';
|
82 |
+
foreach($categories as $k => $_category_id):
|
83 |
+
$_category = Mage::getModel('catalog/category')->load($_category_id);
|
84 |
+
$cat_name = $_category->getName();
|
85 |
+
$cat_url = $_category->getUrl();
|
86 |
+
|
87 |
+
$cat_name = "<![CDATA[$cat_name]]>";
|
88 |
+
$cat_url = "<![CDATA[$cat_url]]>";
|
89 |
+
|
90 |
+
$output .= '<category>';
|
91 |
+
$output .= '<name>'.$cat_name.'</name>';
|
92 |
+
$output .= '<url>'.$cat_url.'</url>';
|
93 |
+
$output .= '</category>';
|
94 |
+
endforeach;
|
95 |
+
$output .= '</categories>';
|
96 |
+
$output .= '</product>';
|
97 |
+
$url = $product->getProductUrl();
|
98 |
+
//$url = str_replace('/productapi.php','',$url);
|
99 |
+
// $url = trim ($url);
|
100 |
+
|
101 |
+
|
102 |
+
}//endforeach;
|
103 |
+
$output .= '
|
104 |
+
</products>';
|
105 |
+
}//endif;
|
106 |
+
header ("Content-Type: text/xml; charset=ISO-8859-1");
|
107 |
+
print $output;
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
|
112 |
+
?>
|