Feed_Manager_Version_1_1_2 - Version 2.0.7

Version Notes

Stable version

Download this release

Release Info

Developer Rinkart Osei Asibey
Extension Feed_Manager_Version_1_1_2
Version 2.0.7
Comparing to
See all releases


Code changes from version 2.0.5 to 2.0.7

Files changed (3) hide show
  1. magento_feedmanager.php +0 -106
  2. package.xml +10 -10
  3. productapi.php +22 -16
magento_feedmanager.php DELETED
@@ -1,106 +0,0 @@
1
- <?php
2
-
3
- set_time_limit(300);
4
- ini_set('memory_limit', '-1');
5
-
6
- include_once 'app/Mage.php';
7
- umask(0);
8
- Mage::app();
9
-
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
- $visibility = array(
16
- Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
17
- Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG
18
- );
19
- $products->addAttributeToFilter('visibility', $visibility);
20
-
21
-
22
- $collection = Mage::getModel('catalog/product')->getCollection();
23
- $collection->addAttributeToSelect('manufacturer');
24
- $collection->addFieldToFilter(array(
25
- array('attribute' => 'manufacturer', 'eq' =>$designer_id),
26
- ));
27
-
28
- $products->load();
29
-
30
- $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
31
-
32
- //echo "Total Count =: ".count($products);
33
- //echo "<pre>";
34
- //print_r($products);
35
- //
36
-
37
-
38
-
39
- $output = '<?xml version="1.0" encoding="utf-8"?>
40
- <products>';
41
-
42
- if (count($products)):
43
-
44
- foreach ($products as $id => $product):
45
-
46
- $url = $product->getProductUrl();
47
- $url = str_replace('/magento_feedmanager.php','',$url);
48
- $url = trim ($url);
49
- $output .= '
50
- <product>
51
- <id>'. $product['entity_id'].'</id>
52
- <name><![CDATA['. $product['name'] .']]></name>
53
- <sku>'. $product['sku'] .'</sku>
54
- <description><![CDATA['. $product['description'] .']]></description>
55
- <shortdescription><![CDATA['. $product['short_description'] .']]></shortdescription>
56
- <price><![CDATA['. $product['price'] .']]></price>
57
- <minimalprice>'. $product['minimal_price'] .'</minimalprice>
58
-
59
- <weight><![CDATA['. $product['weight'] .']]></weight>
60
- <categories><![CDATA['. $product['categories'] .']]></categories>
61
- <color><![CDATA['. $product['color'] .']]></color>
62
- <condition><![CDATA['. $product['condition'] .']]></condition>
63
- <availability><![CDATA['. $product['availability'] .']]></availability>
64
- <shipping><![CDATA['. $product['shipping'] .']]></shipping>
65
- <url><![CDATA['. $url.']]></url>
66
- <meta><![CDATA['. $product['meta_keyword'] .']]></meta>
67
- <metadescription><![CDATA['. $product['meta_description'] .']]></metadescription>
68
- <manufacturer><![CDATA['. $product['manufacturer'] .']]></manufacturer>
69
- <brand><![CDATA['. $product['brand'] .']]></brand>
70
- <upc><![CDATA['. $product['upc'] .']]></upc>
71
- <mpn><![CDATA['. $product['mpn'] .']]></mpn>
72
- <image><![CDATA['. $baseUrl ."media/catalog/product". $product['image'] .']]></image>';
73
-
74
- if (isset($attributes[$product['entity_id']])) {
75
- $output .= '
76
- <attributes>';
77
-
78
- foreach ($attributes[$product['entity_id']] as $attribute => $values)
79
- $output .= '
80
- <attribute>
81
- <name>'. $attribute .'</name>
82
- <values>'. join(', ', $values) . '</values>
83
- </attribute>';
84
-
85
- $output .= '
86
- </attributes>';
87
- }
88
-
89
- $output .= '
90
- </product>';
91
-
92
- endforeach;
93
- endif;
94
-
95
-
96
-
97
-
98
-
99
-
100
- header ("Content-Type: text/xml; charset=ISO-8859-1");
101
- print $output .= '
102
- </products>';
103
-
104
-
105
-
106
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Feed_Manager_Version_1_1_2</name>
4
- <version>2.0.5</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-11-16</date>
14
- <time>12:30:58</time>
15
- <contents><target name="mageweb"><dir name="."><file name="magento_feedmanager.php" hash="91f54af6158e076af9852573a55962e0"/><file name="productapi.php" hash="056f6191466b7af6d175ffe7268725d9"/></dir></target></contents>
16
  <compatible/>
17
- <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Feed_Manager_Version_1_1_2</name>
4
+ <version>2.0.7</version>
5
  <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">Extension license name (OSL v3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>This extension creates xml files to retailtower for further distribution to price engines.</summary>
10
+ <description>This extension creates xml files to retailtower for further distribution to price engines.</description>
11
+ <notes>Stable version</notes>
12
+ <authors><author><name>rinkart</name><user>rinkarto</user><email>rinkarto2000@gmail.com</email></author></authors>
13
+ <date>2012-07-05</date>
14
+ <time>11:15:38</time>
15
+ <contents><target name="mageweb"><dir><dir><file name="productapi.php" hash="96392969c21b2c3cf628065478154771"/></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
productapi.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- set_time_limit(300);
3
  ini_set('memory_limit', '-1');
4
  include_once 'app/Mage.php';
5
  umask(0);
@@ -21,18 +21,12 @@ Mage::app();
21
  $collection->addFieldToFilter(array(
22
  array('attribute' => 'manufacturer', 'eq' =>$designer_id),
23
  ));
24
-
25
-
26
-
27
  $products->load();
28
 
29
  $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
30
-
31
- //echo "Total Count =: ".count($products);
32
- //echo "<pre>";
33
- //print_r($products);
34
 
35
- $collection = Mage::getResourceModel('catalog/product_collection');
36
 
37
 
38
 
@@ -63,17 +57,24 @@ if (count($collection)){
63
  if ($key == 'thumbnail'){
64
  $value = $baseUrl."media/catalog/product".$value;
65
  }
66
- if ($key == 'manufacturer'){
67
  $value = $product->getAttributeText('manufacturer');
68
  }
 
69
  if ($key == 'brand'){
70
  $value = $product->getAttributeText('manufacturer');
 
 
 
 
 
 
71
  }
72
 
73
- //$search = array('&','<','>','"','\'','-','—',"'",'(',')','™','®','©');
74
- //$replace = array('&#38;','&lt;','&gt;','&quot;','&apos;','&#45;','&#x2015;','&#39;','&#40;','&#41;','&trade','&#174;','&copy');
75
- //$value = str_replace($search,$replace,$value);
76
- /* $value = str_replace('&','',$value);
77
  $value = str_replace('</br>','',$value);
78
  $value = str_replace('<br/>','',$value);
79
  $value = str_replace('>','',$value);
@@ -86,7 +87,10 @@ if (count($collection)){
86
 
87
  $key = str_replace('"','',$key);
88
  //my code end
89
-
 
 
 
90
  $output .= '<'.$key.'>'.$value.'</'.$key.'>';
91
 
92
  }
@@ -119,7 +123,9 @@ $output .= '<categories>';
119
  $output .= '
120
  </products>';
121
  }//endif;
122
- header ("Content-Type: text/xml; charset=ISO-8859-1");
 
 
123
  print $output;
124
 
125
 
1
  <?php
2
+ set_time_limit(1600);
3
  ini_set('memory_limit', '-1');
4
  include_once 'app/Mage.php';
5
  umask(0);
21
  $collection->addFieldToFilter(array(
22
  array('attribute' => 'manufacturer', 'eq' =>$designer_id),
23
  ));
24
+
 
 
25
  $products->load();
26
 
27
  $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
 
 
 
 
28
 
29
+ $collection = Mage::getResourceModel('catalog/product_collection');
30
 
31
 
32
 
57
  if ($key == 'thumbnail'){
58
  $value = $baseUrl."media/catalog/product".$value;
59
  }
60
+ /*if ($key == 'manufacturer'){
61
  $value = $product->getAttributeText('manufacturer');
62
  }
63
+
64
  if ($key == 'brand'){
65
  $value = $product->getAttributeText('manufacturer');
66
+ }*/
67
+ if ($key == 'manufacturer'){
68
+ $value = $product->getResource()->getAttribute('manufacturer')->getFrontend()->getValue($product);
69
+ }
70
+ if ($key == 'brand'){
71
+ $value = $product->getResource()->getAttribute('brand')->getFrontend()->getValue($product);
72
  }
73
 
74
+ /*$search = array('&','<','>','"','\'','-','—',"'",'(',')','™','®','©');
75
+ $replace = array('&#38;','&lt;','&gt;','&quot;','&apos;','&#45;','&#x2015;','&#39;','&#40;','&#41;','&trade','&#174;','&copy');
76
+ $value = str_replace($search,$replace,$value);
77
+ $value = str_replace('&','',$value);
78
  $value = str_replace('</br>','',$value);
79
  $value = str_replace('<br/>','',$value);
80
  $value = str_replace('>','',$value);
87
 
88
  $key = str_replace('"','',$key);
89
  //my code end
90
+ /*$search = array('ñ');
91
+ $replace = array('hjaja');
92
+ $value = str_replace($search,$replace,$value);
93
+ */
94
  $output .= '<'.$key.'>'.$value.'</'.$key.'>';
95
 
96
  }
123
  $output .= '
124
  </products>';
125
  }//endif;
126
+ //header ("Content-Type: text/xml; charset=ISO-8859-1");
127
+
128
+ header ("Content-Type: text/xml; charset=UTF-8");
129
  print $output;
130
 
131