IcecatLive - Version 1.1.0

Version Notes

- Improvement of product mapping
- Improvement of product description
- Added displaying icecat names on product listing/shopping cart
- Added all ICEcat data available as variables on product detail page
- Fixed issue with Yes/No indication
- Fixed image displaying on product listing/shopping cart

Download this release

Release Info

Developer IceShop
Extension IcecatLive
Version 1.1.0
Comparing to
See all releases


Code changes from version 1.0.0 to 1.1.0

app/code/local/Bintime/Icecatimport/Helper/Catalog/Image.php CHANGED
@@ -21,8 +21,8 @@ class Bintime_Icecatimport_Helper_Catalog_Image extends Mage_Catalog_Helper_Imag
21
  $imageFile = mage::getsingleton('icecatimport/import')->getLowPicUrl();
22
  }
23
  if ($attributeName == 'thumbnail' && $imageFile == null ) {
24
- $imageFile = $product->getData($attributeName);
25
-
26
  }
27
 
28
  if ($attributeName == 'small_image' && $imageFile == null) {
21
  $imageFile = mage::getsingleton('icecatimport/import')->getLowPicUrl();
22
  }
23
  if ($attributeName == 'thumbnail' && $imageFile == null ) {
24
+ // $imageFile = $product->getData($attributeName);
25
+ $imageFile = Mage::helper('icecatimport/image')->getImage($product);
26
  }
27
 
28
  if ($attributeName == 'small_image' && $imageFile == null) {
app/code/local/Bintime/Icecatimport/Helper/Image.php CHANGED
@@ -13,6 +13,9 @@ class Bintime_Icecatimport_Helper_Image extends Mage_Core_Helper_Abstract
13
  */
14
 
15
  public function getImage($_product) {
 
 
 
16
  $sku = $_product->getData(Mage::getStoreConfig('icecat_root/icecat/sku_field'));
17
 
18
  $manufacturerId = $_product->getData(Mage::getStoreConfig('icecat_root/icecat/manufacturer'));
13
  */
14
 
15
  public function getImage($_product) {
16
+
17
+ $_product = $_product->load($_product->getId());
18
+
19
  $sku = $_product->getData(Mage::getStoreConfig('icecat_root/icecat/sku_field'));
20
 
21
  $manufacturerId = $_product->getData(Mage::getStoreConfig('icecat_root/icecat/manufacturer'));
app/code/local/Bintime/Icecatimport/Helper/Output.php CHANGED
@@ -49,7 +49,7 @@ class Bintime_Icecatimport_Helper_Output extends Mage_Catalog_Helper_Output
49
  {
50
 
51
  //if we on product page then mage::registry('product' exist
52
- if ($product->getId() == $this->iceCatModel->entityId && $name = $this->iceCatModel->getProductName()) {
53
  return $name;
54
  }
55
 
@@ -75,5 +75,27 @@ class Bintime_Icecatimport_Helper_Output extends Mage_Catalog_Helper_Output
75
  else return parent::productAttribute($product, $attributeHtml, $attributeName);
76
  }
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  }
79
  ?>
49
  {
50
 
51
  //if we on product page then mage::registry('product' exist
52
+ if ($product->getId() == $this->iceCatModel->entityId && $name = $product->getData('brand_name') . ' ' . $this->iceCatModel->getProductName()) {
53
  return $name;
54
  }
55
 
75
  else return parent::productAttribute($product, $attributeHtml, $attributeName);
76
  }
77
 
78
+ public function getWarrantyInfo(){
79
+ return $this->iceCatModel->getWarrantyInfo();
80
+ }
81
+ public function getShortSummaryDescription(){
82
+ return $this->iceCatModel->getShortSummaryDescription();
83
+ }
84
+ public function getLongSummaryDescription(){
85
+ return $this->iceCatModel->getLongSummaryDescription();
86
+ }
87
+
88
+ public function getManualPDF(){
89
+ return $this->iceCatModel->getManualPDF();
90
+ }
91
+
92
+ public function getPDF(){
93
+ return $this->iceCatModel->getPDF();
94
+ }
95
+
96
+ public function getIceCatMedia(){
97
+ $media = (array)$this->iceCatModel->getIceCatMedia();
98
+ return (array_key_exists('@attributes', $media)) ? $media['@attributes'] : array();
99
+ }
100
  }
101
  ?>
app/code/local/Bintime/Icecatimport/Model/Import.php CHANGED
@@ -7,18 +7,26 @@
7
  class Bintime_Icecatimport_Model_Import extends Mage_Core_Model_Abstract {
8
 
9
  public $entityId;
10
- private $productDescriptionList = array();
11
  private $productDescription;
12
  private $fullProductDescription;
13
  private $lowPicUrl;
14
  private $highPicUrl;
15
  private $errorMessage;
16
- private $galleryPhotos = array();
17
  private $productName;
18
- private $relatedProducts = array();
19
  private $thumb;
20
  private $errorSystemMessage; //depricated
21
- private $_cacheKey = 'bintime_icecatimport_';
 
 
 
 
 
 
 
 
22
 
23
  protected function _construct()
24
  {
@@ -94,13 +102,8 @@ class Bintime_Icecatimport_Model_Import extends Mage_Core_Model_Abstract {
94
  }
95
 
96
  if ($this->checkIcecatResponse($productId, $vendorName)){
97
- // $_newProduct = Mage::getModel('catalog/product')->load($productId);
98
- //echo $_newProduct->getDescription();die;
99
- //$this->productDescription = $_newProduct->getDescription();
100
  return false;
101
  }
102
- //$_newProduct = Mage::getModel('catalog/product')->load($productId);
103
- //$_newProduct->getDescription();die();
104
 
105
  $this->loadProductDescriptionList();
106
  $this->loadOtherProductParams($productId);
@@ -211,7 +214,31 @@ class Bintime_Icecatimport_Model_Import extends Mage_Core_Model_Abstract {
211
  public function getEAN(){
212
  return $this->EAN;
213
  }
214
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  /**
216
  * Form related products Array
217
  */
@@ -263,38 +290,44 @@ class Bintime_Icecatimport_Model_Import extends Mage_Core_Model_Abstract {
263
  * Form Array of non feature-value product params
264
  */
265
  private function loadOtherProductParams($productId){
266
- $this->productDescription = (string) $this->simpleDoc->Product->ProductDescription['ShortDesc'];
267
-
268
 
269
- $this->fullProductDescription = (string)$this->simpleDoc->Product->ProductDescription['LongDesc'];
270
- $productTag = $this->simpleDoc->Product;
271
- $this->lowPicUrl = (string)$productTag["LowPic"];
272
- $this->highPicUrl = (string)$productTag["HighPic"];
273
- $this->productName = (string)$productTag["Name"];
274
- $this->productId = (string)$productTag['Prod_id'];
275
- $this->thumb = (string)$productTag['ThumbPic'];
276
- $this->vendor = (string)$productTag->Supplier['Name'];
277
- $prodEAN = $productTag->EANCode;
278
- $EANstr='';
279
- $EANarr=null;
280
- $j = 0;//counter
281
- foreach($prodEAN as $ellEAN){
282
- $EANarr[]=$ellEAN['EAN'];$j++;
283
- }
284
- //echo $j;
285
- $i = 0;
286
- $str = '';
287
- for($i=0;$i<$j;$i++){
288
- $g = $i%2;
289
- //echo '<br>'.$g;
290
- //$EANstr=implode(",",$EANarr);
291
- if($g == '0'){if($j == 1){$str .= $EANarr[$i].'<br>';} else {$str .= $EANarr[$i].', ';}
292
- }
293
- else {if($i != $j-1){$str .= $EANarr[$i].', <br>';}else {$str .= $EANarr[$i].' <br>';}}
294
- //var_dump($EANstr);die;
295
- }
296
- $this->EAN = $str;
297
- //$this->EAN = (string)$EANstr;//$productTag->EANCode['EAN'];
 
 
 
 
 
 
 
 
298
  }
299
 
300
  /**
7
  class Bintime_Icecatimport_Model_Import extends Mage_Core_Model_Abstract {
8
 
9
  public $entityId;
10
+ private $productDescriptionList = array();
11
  private $productDescription;
12
  private $fullProductDescription;
13
  private $lowPicUrl;
14
  private $highPicUrl;
15
  private $errorMessage;
16
+ private $galleryPhotos = array();
17
  private $productName;
18
+ private $relatedProducts = array();
19
  private $thumb;
20
  private $errorSystemMessage; //depricated
21
+ private $_cacheKey = 'bintime_icecatimport_';
22
+
23
+ private $_warrantyInfo = '';
24
+ private $_shortSummaryDesc = '';
25
+ private $_longSummaryDesc = '';
26
+
27
+ private $_manualPdfUrl = '';
28
+ private $_pdfUrl = '';
29
+ private $_multimedia = '';
30
 
31
  protected function _construct()
32
  {
102
  }
103
 
104
  if ($this->checkIcecatResponse($productId, $vendorName)){
 
 
 
105
  return false;
106
  }
 
 
107
 
108
  $this->loadProductDescriptionList();
109
  $this->loadOtherProductParams($productId);
214
  public function getEAN(){
215
  return $this->EAN;
216
  }
217
+
218
+ public function getWarrantyInfo(){
219
+ return $this->_warrantyInfo;
220
+ }
221
+
222
+ public function getShortSummaryDescription(){
223
+ return $this->_shortSummaryDesc;
224
+ }
225
+
226
+ public function getLongSummaryDescription(){
227
+ return $this->_longSummaryDesc;
228
+ }
229
+
230
+ public function getManualPDF(){
231
+ return $this->_manualPdfUrl;
232
+ }
233
+
234
+ public function getPDF(){
235
+ return $this->_pdfUrl;
236
+ }
237
+
238
+ public function getIceCatMedia(){
239
+ return $this->_multimedia;
240
+ }
241
+
242
  /**
243
  * Form related products Array
244
  */
290
  * Form Array of non feature-value product params
291
  */
292
  private function loadOtherProductParams($productId){
 
 
293
 
294
+ $productTag = $this->simpleDoc->Product;
295
+
296
+ $this->productDescription = (string)$productTag->ProductDescription['ShortDesc'];
297
+ $this->fullProductDescription = (string)$productTag->ProductDescription['LongDesc'];
298
+ $this->_warrantyInfo = (string)$productTag->ProductDescription['WarrantyInfo'];
299
+ $this->_shortSummaryDesc = (string)$productTag->SummaryDescription->ShortSummaryDescription;
300
+ $this->_longSummaryDesc = (string)$productTag->SummaryDescription->LongSummaryDescription;
301
+
302
+ $this->_manualPdfUrl = (string)$productTag->ProductDescription['ManualPDFURL'];
303
+ $this->_pdfUrl = (string)$productTag->ProductDescription['PDFURL'];
304
+
305
+ $this->_multimedia = $productTag->ProductMultimediaObject->MultimediaObject;
306
+
307
+ $this->lowPicUrl = (string)$productTag["LowPic"];
308
+ $this->highPicUrl = (string)$productTag["HighPic"];
309
+ $this->productName = (string)$productTag["Name"];
310
+ $this->productId = (string)$productTag['Prod_id'];
311
+ $this->thumb = (string)$productTag['ThumbPic'];
312
+ $this->vendor = (string)$productTag->Supplier['Name'];
313
+
314
+ $prodEAN = $productTag->EANCode;
315
+ $EANstr='';
316
+ $EANarr=null;
317
+ $j = 0;//counter
318
+ foreach($prodEAN as $ellEAN){
319
+ $EANarr[]=$ellEAN['EAN'];$j++;
320
+ }
321
+ $i = 0;
322
+ $str = '';
323
+ for($i=0;$i<$j;$i++){
324
+ $g = $i%2;
325
+ if($g == '0'){if($j == 1){$str .= $EANarr[$i].'<br>';} else {$str .= $EANarr[$i].', ';}
326
+ }
327
+ else {if($i != $j-1){$str .= $EANarr[$i].', <br>';}else {$str .= $EANarr[$i].' <br>';}}
328
+ }
329
+ $this->EAN = $str;
330
+
331
  }
332
 
333
  /**
app/code/local/Bintime/Icecatimport/Model/Observer.php CHANGED
@@ -96,6 +96,7 @@ class Bintime_Icecatimport_Model_Observer
96
  foreach ($supplierList as $supplier) {
97
  $supplierSymbolList = $supplier->Symbol;
98
  $supplierId = $supplier['supplier_id'];
 
99
  foreach($supplierSymbolList as $symbol) {
100
  $symbolName = (string)$symbol;
101
  $connection->insert($mappingTable."_temp", array('supplier_id' => $supplierId, 'supplier_symbol' => $symbolName));
96
  foreach ($supplierList as $supplier) {
97
  $supplierSymbolList = $supplier->Symbol;
98
  $supplierId = $supplier['supplier_id'];
99
+ $connection->insert($mappingTable."_temp", array('supplier_id' => $supplierId, 'supplier_symbol' => (string)$supplier['name']));
100
  foreach($supplierSymbolList as $symbol) {
101
  $symbolName = (string)$symbol;
102
  $connection->insert($mappingTable."_temp", array('supplier_id' => $supplierId, 'supplier_symbol' => $symbolName));
app/code/local/Bintime/Icecatimport/etc/config.xml CHANGED
@@ -139,7 +139,7 @@
139
  <crontab>
140
  <jobs>
141
  <icecatimport>
142
- <schedule><cron_expr>0 3 * * *</cron_expr></schedule>
143
  <run><model>icecatimport/observer::load</model></run>
144
  </icecatimport>
145
  </jobs>
139
  <crontab>
140
  <jobs>
141
  <icecatimport>
142
+ <schedule><cron_expr>* * * * *</cron_expr></schedule>
143
  <run><model>icecatimport/observer::load</model></run>
144
  </icecatimport>
145
  </jobs>
package.xml CHANGED
@@ -1,20 +1,23 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>IcecatLive</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v.3</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>ICEcat to Magento Open Source Connector</summary>
10
  <description>ICEcat to Magento Open Source Connector - rich content in your magento shop</description>
11
- <notes>- Optimized synchronize.&#xD;
12
- - Fixed product listing.&#xD;
13
- - Fixed caching already downloaded products info.</notes>
 
 
 
14
  <authors><author><name>IceShop</name><user>IceShop</user><email>support@iceshop.nl</email></author></authors>
15
- <date>2012-06-11</date>
16
- <time>08:38:15</time>
17
- <contents><target name="magelocal"><dir name="Bintime"><dir name="Icecatimport"><dir name="Block"><file name="Attributes.php" hash="ae93e0a964e8880e5b65fb5d08f1edf9"/><file name="Media.php" hash="a71e447a139b851da50937bccaf8bd37"/><file name="Related.php" hash="7ca2ad6520f2644ad1302c02d1cd6853"/><file name="Upsell.php" hash="624bd7b9c8708a67079efb2478a5a37d"/></dir><dir name="controllers"><file name="ImageController.php" hash="cdf4984c268346088729831b7abdf026"/></dir><dir name="etc"><file name="config.xml" hash="e7d5d2932a1320e107d5ac7af35ba29f"/><file name="system.xml" hash="5138720902ed8c530d7c91b82d0f4935"/></dir><dir name="Helper"><dir name="Catalog"><file name="Image.php" hash="7d563f9ffce9eb286839c3add7fd6c9f"/></dir><file name="Getdata.php" hash="b36ed387b06e2d2aa9860f693dda3f03"/><file name="Image.php" hash="aaaaaf9794622f80269fef4b5fc19476"/><file name="Output.php" hash="833218b04e3e7a5ef912802273515abb"/></dir><dir name="Model"><dir name="Catalog"><file name="Category.php" hash="21abeb7a7c2c85db8ce4d2f4ed203f50"/><file name="Product.php" hash="232f34dade19ddcf09d2da92e15cb682"/><file name="Search.php" hash="99c7eb706e67e01ea8167ebe88fe72d9"/></dir><dir name="System"><dir name="Config"><file name="Attributes.php" hash="23284e0d38677b4544fc87642a6bc8b5"/><file name="LanguageList.xml" hash="391ef56fab212879709780df5a7710e7"/><file name="Locales.php" hash="b8c699fa2a6f657b6d52d86e656872cc"/><file name="Subscription.php" hash="62168986f7a4eb3f10d38ac627aa6510"/></dir></dir><file name="Imagescollection.php" hash="718b575ef9472f85c323fa40f80bbd05"/><file name="Import.php" hash="e6cb92d1c5feda8a584490e188128a70"/><file name="Observer.php" hash="91a7409a4c11e4109665b5aab3f261f9"/><file name="Relatedcollection.php" hash="2ddf62c43a66c3fd70bf651d0078dbc1"/></dir><dir name="sql"><dir name="icecatimport_setup"><file name="mysql4-install-0.1.0.php" hash="a8f750e7667f8ef0dd077100c9fddf48"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="c0581c5b00420492714bd7e3cc66cb6d"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bintime_Icecatimport.xml" hash="daf681aae3e710568d210313816a9d5f"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>IcecatLive</name>
4
+ <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v.3</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>ICEcat to Magento Open Source Connector</summary>
10
  <description>ICEcat to Magento Open Source Connector - rich content in your magento shop</description>
11
+ <notes>- Improvement of product mapping&#xD;
12
+ - Improvement of product description&#xD;
13
+ - Added displaying icecat names on product listing/shopping cart&#xD;
14
+ - Added all ICEcat data available as variables on product detail page&#xD;
15
+ - Fixed issue with Yes/No indication&#xD;
16
+ - Fixed image displaying on product listing/shopping cart</notes>
17
  <authors><author><name>IceShop</name><user>IceShop</user><email>support@iceshop.nl</email></author></authors>
18
+ <date>2012-08-21</date>
19
+ <time>16:02:42</time>
20
+ <contents><target name="magelocal"><dir name="Bintime"><dir name="Icecatimport"><dir name="Block"><file name="Attributes.php" hash="ae93e0a964e8880e5b65fb5d08f1edf9"/><file name="Media.php" hash="a71e447a139b851da50937bccaf8bd37"/><file name="Related.php" hash="7ca2ad6520f2644ad1302c02d1cd6853"/><file name="Upsell.php" hash="624bd7b9c8708a67079efb2478a5a37d"/></dir><dir name="controllers"><file name="ImageController.php" hash="cdf4984c268346088729831b7abdf026"/></dir><dir name="etc"><file name="config.xml" hash="13d5b3c94451f13119c90a8added2374"/><file name="system.xml" hash="5138720902ed8c530d7c91b82d0f4935"/></dir><dir name="Helper"><dir name="Catalog"><file name="Image.php" hash="d300efd5dc51ad649023aab95d6b5fd7"/></dir><file name="Getdata.php" hash="b36ed387b06e2d2aa9860f693dda3f03"/><file name="Image.php" hash="000f0665c72b96ac03ca07dc3046a202"/><file name="Output.php" hash="21f46a7252ddfab8ae7d44384d205da2"/></dir><dir name="Model"><dir name="Catalog"><file name="Category.php" hash="21abeb7a7c2c85db8ce4d2f4ed203f50"/><file name="Product.php" hash="232f34dade19ddcf09d2da92e15cb682"/><file name="Search.php" hash="99c7eb706e67e01ea8167ebe88fe72d9"/></dir><dir name="System"><dir name="Config"><file name="Attributes.php" hash="23284e0d38677b4544fc87642a6bc8b5"/><file name="LanguageList.xml" hash="391ef56fab212879709780df5a7710e7"/><file name="Locales.php" hash="b8c699fa2a6f657b6d52d86e656872cc"/><file name="Subscription.php" hash="62168986f7a4eb3f10d38ac627aa6510"/></dir></dir><file name="Imagescollection.php" hash="718b575ef9472f85c323fa40f80bbd05"/><file name="Import.php" hash="2e243371496d5ddff593591a619aa348"/><file name="Observer.php" hash="b97aaab8b60091bb481ad25b28126896"/><file name="Relatedcollection.php" hash="2ddf62c43a66c3fd70bf651d0078dbc1"/></dir><dir name="sql"><dir name="icecatimport_setup"><file name="mysql4-install-0.1.0.php" hash="a8f750e7667f8ef0dd077100c9fddf48"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="c0581c5b00420492714bd7e3cc66cb6d"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bintime_Icecatimport.xml" hash="daf681aae3e710568d210313816a9d5f"/></dir></target></contents>
21
  <compatible/>
22
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
23
  </package>