BikeExchange_DE - Version 1.0.3

Version Notes

Guessing more attribute codes
Output attribute codes
Output guessed attributes with data and text

Download this release

Release Info

Developer Hagen Schwaß
Extension BikeExchange_DE
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

app/code/community/Bikeexchange/Produktexport/Model/Catalog/Product/Api.php CHANGED
@@ -2,12 +2,33 @@
2
  class Bikeexchange_Produktexport_Model_Catalog_Product_Api extends Mage_Catalog_Model_Api_Resource
3
  {
4
 
5
- protected $possiblebarcodefields = array('barcode', 'ean', 'upc', 'gtin', 'gtin-14', 'gtin-13', 'gtin-12', 'gtin-8', 'ucc-13', 'ucc-12', 'ucc-8', 'ean-8', 'ean-13', 'cip');
6
- protected $possiblebrandfields = array('brand', 'marke', 'hersteller', 'manufacturer');
7
- protected $possiblecolorfields = array('color', 'farbe', 'colour');
8
- protected $possiblesizefields = array('size', 'größe', 'groesse');
9
- protected $possiblegenderfields = array('gender', 'sex', 'geschlecht', 'gendered');
10
- protected $possibleyearfields = array('year', 'jahr', 'modelljahr', 'modelyear', 'produktjahr');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
  public function availabilityFeed($store = null)
13
  {
@@ -39,22 +60,6 @@ class Bikeexchange_Produktexport_Model_Catalog_Product_Api extends Mage_Catalog_
39
  {
40
  $item['barcode'] = $product->getData($attribute->getAttributeCode());
41
  }
42
- else if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblebrandfields) && !empty($product->getData($attribute->getAttributeCode())))
43
- {
44
- $item['brand'] = $product->getData($attribute->getAttributeCode());
45
- }
46
- else if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblecolorfields) && !empty($product->getData($attribute->getAttributeCode())))
47
- {
48
- $item['color'] = $product->getData($attribute->getAttributeCode());
49
- }
50
- else if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblesizefields) && !empty($product->getData($attribute->getAttributeCode())))
51
- {
52
- $item['size'] = $product->getData($attribute->getAttributeCode());
53
- }
54
- else if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblegenderfields) && !empty($product->getData($attribute->getAttributeCode())))
55
- {
56
- $item['gender'] = $product->getData($attribute->getAttributeCode());
57
- }
58
  }
59
  $result[] = $item;
60
  }
@@ -95,31 +100,74 @@ class Bikeexchange_Produktexport_Model_Catalog_Product_Api extends Mage_Catalog_
95
  'image_url' => Mage::helper('catalog/product')->getImageUrl($product),
96
  'images' => $product->getMediaGalleryImages()
97
  );
 
98
  foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute)
99
  {
100
- if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblebarcodefields) && !empty($product->getData($attribute->getAttributeCode())))
 
101
  {
102
- $item['barcode'] = $product->getAttributeText($attribute->getAttributeCode());
 
 
 
 
 
 
103
  }
104
- else if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblebrandfields) && !empty($product->getData($attribute->getAttributeCode())))
105
  {
106
- $item['brand'] = $product->getAttributeText($attribute->getAttributeCode());
 
 
 
 
 
 
 
107
  }
108
- else if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblecolorfields) && !empty($product->getData($attribute->getAttributeCode())))
109
  {
110
- $item['color'] = $product->getAttributeText($attribute->getAttributeCode());
 
 
 
 
 
 
 
111
  }
112
- else if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblesizefields) && !empty($product->getData($attribute->getAttributeCode())))
113
  {
114
- $item['size'] = $product->getAttributeText($attribute->getAttributeCode());
 
 
 
 
 
 
 
115
  }
116
- else if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblegenderfields) && !empty($product->getData($attribute->getAttributeCode())))
117
  {
118
- $item['gender'] = $product->getAttributeText($attribute->getAttributeCode());
 
 
 
 
 
 
 
119
  }
120
- else if (in_array(strtolower($attribute->getAttributeCode()), $this->possibleyearfields) && !empty($product->getData($attribute->getAttributeCode())))
121
  {
122
- $item['year'] = $product->getAttributeText($attribute->getAttributeCode());
 
 
 
 
 
 
 
123
  }
124
  }
125
  $result[] = $item;
2
  class Bikeexchange_Produktexport_Model_Catalog_Product_Api extends Mage_Catalog_Model_Api_Resource
3
  {
4
 
5
+ protected $possiblebarcodefields = array('barcode', 'ean', 'upc', 'gtin', 'gtin-14', 'gtin14', 'gtin_14',
6
+ 'gtin-13', 'gtin13', 'gtin_13', 'gtin-12', 'gtin12', 'gtin_12', 'gtin-8', 'gtin8', 'gtin_8',
7
+ 'ucc-13', 'ucc13', 'ucc_13', 'ucc-12', 'ucc12', 'ucc_12', 'ucc-8', 'ucc8', 'ucc_8',
8
+ 'ean-8', 'ean8', 'ean_8', 'ean-13', 'ean13', 'ean_13', 'cip');
9
+
10
+ protected $possiblebrandfields = array('brand', 'marke', 'hersteller', 'herst', 'manufacturer', 'manufac');
11
+
12
+ protected $possiblecolorfields = array('color', 'farbe', 'farbton', 'farb_ton', 'farb-ton', 'colour', 'col');
13
+
14
+ protected $possiblesizefields = array('size', 'größe', 'groesse', 'groeße', 'groese', 'grösse', 'gröse');
15
+
16
+ protected $possiblegenderfields = array('gender', 'sex', 'geschlecht',
17
+ 'morf', 'form', 'f_m', 'm_f', 'f-m', 'm-f', 'f/m', 'm/f', 'm_or_f', 'f_or_m', 'm-or-f', 'f-or-m',
18
+ 'moderf', 'foderm', 'm_oder_f', 'f_oder_m', 'm-oder-f', 'f-oder-m',
19
+ 'morw', 'worm', 'w_m', 'm_w', 'w-m', 'm-w', 'w/m', 'm/w', 'm_or_w', 'w_or_m', 'm-or-w', 'w-or-m',
20
+ 'moderw', 'woderm', 'm_oder_w', 'w_oder_m', 'm-oder-w', 'w-oder-m',
21
+ 'malefemale', 'femalemale', 'male/female', 'female/male', 'male_female', 'male-female', 'male-female', 'female-male',
22
+ 'maleorfemale', 'femaleormale', 'male_or_female', 'female_or_male', 'male-or-female', 'female-or-male');
23
+
24
+ protected $possibleyearfields = array('year', 'jahr', 'modelljahr', 'modell_jahr', 'modell-jahr', 'modelyear', 'model_year', 'model-year',
25
+ 'produktjahr', 'produkt_jahr', 'produkt-jahr', 'produktyear', 'produkt_year', 'produkt-year',
26
+ 'productjahr', 'product_jahr', 'product-jahr', 'productyear', 'product_year', 'product-year',
27
+ 'modeljahr', 'model_jahr', 'model-jahr', 'modellyear', 'modell_year', 'modell-year',
28
+ 'baujahr', 'serienjahr', 'serien_jahr', 'serien-jahr', 'serienyear', 'serien_year', 'serien-year',
29
+ 'serie', 'series', 'seriesyear', 'series_year', 'series-year', 'seriesjahr', 'series_jahr', 'series-jahr',
30
+ 'season', 'seasonyear', 'season_year', 'season-year', 'seasonjahr', 'season_jahr', 'season-jahr',
31
+ 'saison', 'saisonyear', 'saison_year', 'saison-year', 'saisonjahr', 'saison_jahr', 'saison-jahr');
32
 
33
  public function availabilityFeed($store = null)
34
  {
60
  {
61
  $item['barcode'] = $product->getData($attribute->getAttributeCode());
62
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  }
64
  $result[] = $item;
65
  }
100
  'image_url' => Mage::helper('catalog/product')->getImageUrl($product),
101
  'images' => $product->getMediaGalleryImages()
102
  );
103
+ $item['attributes'] = '';
104
  foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute)
105
  {
106
+ $item['attributes'] .= $attribute->getAttributeCode().';';
107
+ if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblebarcodefields))
108
  {
109
+ if (!empty($product->getData($attribute->getAttributeCode())))
110
+ {
111
+ $item['barcode'] = $product->getData($attribute->getAttributeCode());
112
+ }
113
+ else {
114
+ $item['barcode'] = 'empty';
115
+ }
116
  }
117
+ else if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblebrandfields))
118
  {
119
+ if (!empty($product->getData($attribute->getAttributeCode())))
120
+ {
121
+ $item['brand'] = $product->getData($attribute->getAttributeCode())
122
+ .'-'.$product->getAttributeText($attribute->getAttributeCode());
123
+ }
124
+ else {
125
+ $item['brand'] = 'empty';
126
+ }
127
  }
128
+ else if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblecolorfields))
129
  {
130
+ if (!empty($product->getData($attribute->getAttributeCode())))
131
+ {
132
+ $item['color'] = $product->getData($attribute->getAttributeCode())
133
+ .'-'.$product->getAttributeText($attribute->getAttributeCode());
134
+ }
135
+ else {
136
+ $item['color'] = 'empty';
137
+ }
138
  }
139
+ else if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblesizefields))
140
  {
141
+ if (!empty($product->getData($attribute->getAttributeCode())))
142
+ {
143
+ $item['size'] = $product->getData($attribute->getAttributeCode())
144
+ .'-'.$product->getAttributeText($attribute->getAttributeCode());
145
+ }
146
+ else {
147
+ $item['size'] = 'empty';
148
+ }
149
  }
150
+ else if (in_array(strtolower($attribute->getAttributeCode()), $this->possiblegenderfields))
151
  {
152
+ if (!empty($product->getData($attribute->getAttributeCode())))
153
+ {
154
+ $item['gender'] = $product->getData($attribute->getAttributeCode())
155
+ .'-'.$product->getAttributeText($attribute->getAttributeCode());
156
+ }
157
+ else {
158
+ $item['gender'] = 'empty';
159
+ }
160
  }
161
+ else if (in_array(strtolower($attribute->getAttributeCode()), $this->possibleyearfields))
162
  {
163
+ if (!empty($product->getData($attribute->getAttributeCode())))
164
+ {
165
+ $item['year'] = $product->getData($attribute->getAttributeCode())
166
+ .'-'.$product->getAttributeText($attribute->getAttributeCode());
167
+ }
168
+ else {
169
+ $item['year'] = 'empty';
170
+ }
171
  }
172
  }
173
  $result[] = $item;
app/code/community/Bikeexchange/Produktexport/etc/config.xml CHANGED
@@ -1,7 +1,7 @@
1
  <config>
2
  <modules>
3
  <Bikeexchange_Produktexport>
4
- <version>1.0.2</version>
5
  </Bikeexchange_Produktexport>
6
  </modules>
7
  <global>
1
  <config>
2
  <modules>
3
  <Bikeexchange_Produktexport>
4
+ <version>1.0.3</version>
5
  </Bikeexchange_Produktexport>
6
  </modules>
7
  <global>
app/code/community/Bikeexchange/Produktexport/etc/wsi.xml CHANGED
@@ -65,6 +65,7 @@
65
  <xsd:element name="is_in_stock" type="xsd:string" minOccurs="0" />
66
  <xsd:element name="image_url" type="xsd:string" minOccurs="0" />
67
  <xsd:element name="images" type="typens:catalogProductImageEntityArray" minOccurs="0" />
 
68
  </xsd:sequence>
69
  </xsd:complexType>
70
  <xsd:element name="bikeexchangeAvailabilityRequestParam">
65
  <xsd:element name="is_in_stock" type="xsd:string" minOccurs="0" />
66
  <xsd:element name="image_url" type="xsd:string" minOccurs="0" />
67
  <xsd:element name="images" type="typens:catalogProductImageEntityArray" minOccurs="0" />
68
+ <xsd:element name="attributes" type="xsd:string" minOccurs="0" />
69
  </xsd:sequence>
70
  </xsd:complexType>
71
  <xsd:element name="bikeexchangeAvailabilityRequestParam">
package.xml CHANGED
@@ -1,18 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>BikeExchange_DE</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Automating a BikeExchange DE account from the Magento Shop's admin panel.</summary>
10
  <description>In order to automate a BikeExchange account two SOAP v2 functions are added. One provides stock and price information for frequent usage. The other provides product data for creating adverts on the marketplace.</description>
11
- <notes>Increased maximum supported php version.</notes>
 
 
12
  <authors><author><name>Hagen Schwa&#xDF;</name><user>hagens</user><email>bikeexchange@hagenschwass.name</email></author></authors>
13
- <date>2017-03-20</date>
14
- <time>10:47:01</time>
15
- <contents><target name="mageetc"><dir name="modules"><file name="Bikeexchange_Produktexport.xml" hash="fea0bff88a09bd200e810f7b6b38a888"/></dir></target><target name="magecommunity"><dir name="Bikeexchange"><dir name="Produktexport"><dir name="Helper"><file name="Data.php" hash="6a59185f3a1ecbe68cb845b6525f997d"/></dir><dir name="Model"><dir name="Catalog"><dir name="Product"><dir name="Api"><file name="V2.php" hash="8af7de3830297ee52215de8271de4efe"/></dir><file name="Api.php" hash="c045b16d7fca72a020f4c54cf04a30ce"/></dir></dir></dir><dir name="etc"><file name="api.xml" hash="e82ea342aeadaf59d0e96cc3424ab1ae"/><file name="config.xml" hash="20d4682f63bee739363c71938b759c4c"/><file name="wsi.xml" hash="a42fe0c0091a18e3ca36039c604afcfe"/></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.4.0</min><max>5.6.9</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.9.3.2</max></package></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>BikeExchange_DE</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Automating a BikeExchange DE account from the Magento Shop's admin panel.</summary>
10
  <description>In order to automate a BikeExchange account two SOAP v2 functions are added. One provides stock and price information for frequent usage. The other provides product data for creating adverts on the marketplace.</description>
11
+ <notes>Guessing more attribute codes&#xD;
12
+ Output attribute codes&#xD;
13
+ Output guessed attributes with data and text</notes>
14
  <authors><author><name>Hagen Schwa&#xDF;</name><user>hagens</user><email>bikeexchange@hagenschwass.name</email></author></authors>
15
+ <date>2017-05-02</date>
16
+ <time>10:51:32</time>
17
+ <contents><target name="mageetc"><dir name="modules"><file name="Bikeexchange_Produktexport.xml" hash="fea0bff88a09bd200e810f7b6b38a888"/></dir></target><target name="magecommunity"><dir name="Bikeexchange"><dir name="Produktexport"><dir name="Helper"><file name="Data.php" hash="6a59185f3a1ecbe68cb845b6525f997d"/></dir><dir name="Model"><dir name="Catalog"><dir name="Product"><dir name="Api"><file name="V2.php" hash="8af7de3830297ee52215de8271de4efe"/></dir><file name="Api.php" hash="8e19350a96a3f71ed436355e7df6b208"/></dir></dir></dir><dir name="etc"><file name="api.xml" hash="e82ea342aeadaf59d0e96cc3424ab1ae"/><file name="config.xml" hash="5d5486f95403e178c1b782dbb9ac3f7f"/><file name="wsi.xml" hash="a960379e332c30c4a086596bb9d2dc07"/></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.4.0</min><max>5.6.9</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.9.3.2</max></package></required></dependencies>
20
  </package>