Bubbleyes_BubblitPlugin - Version 1.2.0

Version Notes

- bug fixing

Download this release

Release Info

Developer Terje Lindstad
Extension Bubbleyes_BubblitPlugin
Version 1.2.0
Comparing to
See all releases


Code changes from version 1.1.0 to 1.2.0

app/code/community/Bubbleyes/BubblitPlugin/Helper/Data.php CHANGED
@@ -2,6 +2,7 @@
2
  class Bubbleyes_BubblitPlugin_Helper_Data extends Mage_Core_Helper_Abstract
3
  {
4
  static $APIAddress = "http://api.bubbleyes.com/client/";
 
5
  static $ProductsPortionSize = 25;
6
 
7
  public static function getProductPortionSize() {
@@ -71,5 +72,19 @@
71
 
72
  return (array)json_decode($response, true);
73
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  }
75
  ?>
2
  class Bubbleyes_BubblitPlugin_Helper_Data extends Mage_Core_Helper_Abstract
3
  {
4
  static $APIAddress = "http://api.bubbleyes.com/client/";
5
+ static $Version = 'magento 1.2.0';
6
  static $ProductsPortionSize = 25;
7
 
8
  public static function getProductPortionSize() {
72
 
73
  return (array)json_decode($response, true);
74
  }
75
+
76
+ public static function LoggerForException($ex) {
77
+ try {
78
+ self::CallAPI('logException', array(
79
+ 'ExceptionMessage' => $ex-> getMessage(),
80
+ 'ExceptionStackTrace' => $ex -> getTraceAsString(),
81
+ 'Platform' => self::$Version
82
+ ));
83
+ }
84
+ catch (Exception $logEx) { }
85
+
86
+ return null;
87
+ }
88
+
89
  }
90
  ?>
app/code/community/Bubbleyes/BubblitPlugin/Model/Observer.php CHANGED
@@ -24,6 +24,12 @@ class Bubbleyes_BubblitPlugin_Model_Observer
24
  $productCategory = $categories -> getFirstItem() -> getName();
25
  }
26
 
 
 
 
 
 
 
27
  $productData = array(
28
  'SKU' => $product->sku,
29
  'Name' => $product->name,
@@ -33,14 +39,16 @@ class Bubbleyes_BubblitPlugin_Model_Observer
33
  'Price' => number_format($product->price, 2, '.', ''),
34
  'DiscountedPrice' => $product-> special_price == null ? null : number_format($product-> special_price, 2, '.', ''),
35
  'IsActive' => ($product -> status) == 1 ? "true" : "false",
36
- 'Image' => $product -> getImage() != 'no_selection' ? $product -> getImageUrl() : null,
37
  'Category' => $productCategory
38
  );
39
 
40
  $this->_helper->CallAPI('createOrEditProduct', array('Product' => $productData));
41
  }
42
  }
43
- catch (Exception $ex) { }
 
 
44
  }
45
 
46
  public function HandleProductDelete(Varien_Event_Observer $observer)
@@ -53,7 +61,9 @@ class Bubbleyes_BubblitPlugin_Model_Observer
53
 
54
  $this->_helper->CallAPI('deleteProduct', array('Product' => $productData));
55
  }
56
- catch (Exception $ex) { }
 
 
57
  }
58
 
59
  public function HandleSettingsChanged(Varien_Event_Observer $observer)
@@ -71,8 +81,12 @@ class Bubbleyes_BubblitPlugin_Model_Observer
71
 
72
  if($itt == $this->_helper->getProductPortionSize())
73
  {
74
- $this->_helper->CallAPI('importProducts', array('ProductsXML' => self::BuildProductsXML($productsPortion)));
75
-
 
 
 
 
76
  $itt = 0;
77
  $productsPortion = array();
78
  }
@@ -83,7 +97,9 @@ class Bubbleyes_BubblitPlugin_Model_Observer
83
  $this->_helper->CallAPI('importProducts', array('ProductsXML' => self::BuildProductsXML($productsPortion)));
84
  }
85
  }
86
- catch (Exception $ex) { }
 
 
87
  }
88
 
89
  public static function BuildProductsXML($products) {
@@ -115,7 +131,13 @@ class Bubbleyes_BubblitPlugin_Model_Observer
115
  $productXML -> addChild("category", htmlspecialchars($categories -> getFirstItem() -> getName(), ENT_QUOTES));
116
  }
117
 
118
- $productXML -> addChild("image", htmlspecialchars($product -> getImage() != 'no_selection' ? $product -> getImageUrl() : null, ENT_QUOTES));
 
 
 
 
 
 
119
  }
120
 
121
  return $productsXML->asXML();
24
  $productCategory = $categories -> getFirstItem() -> getName();
25
  }
26
 
27
+ $productImage = null;
28
+ try{
29
+ $productImage = $product -> getImage() != 'no_selection' ? $product -> getImageUrl() : null;
30
+ }
31
+ catch(Exception $exImage) { }
32
+
33
  $productData = array(
34
  'SKU' => $product->sku,
35
  'Name' => $product->name,
39
  'Price' => number_format($product->price, 2, '.', ''),
40
  'DiscountedPrice' => $product-> special_price == null ? null : number_format($product-> special_price, 2, '.', ''),
41
  'IsActive' => ($product -> status) == 1 ? "true" : "false",
42
+ 'Image' => $productImage,
43
  'Category' => $productCategory
44
  );
45
 
46
  $this->_helper->CallAPI('createOrEditProduct', array('Product' => $productData));
47
  }
48
  }
49
+ catch (Exception $ex) {
50
+ $this->_helper->LoggerForException($ex);
51
+ }
52
  }
53
 
54
  public function HandleProductDelete(Varien_Event_Observer $observer)
61
 
62
  $this->_helper->CallAPI('deleteProduct', array('Product' => $productData));
63
  }
64
+ catch (Exception $ex) {
65
+ $this->_helper->LoggerForException($ex);
66
+ }
67
  }
68
 
69
  public function HandleSettingsChanged(Varien_Event_Observer $observer)
81
 
82
  if($itt == $this->_helper->getProductPortionSize())
83
  {
84
+ try {
85
+ $this->_helper->CallAPI('importProducts', array('ProductsXML' => self::BuildProductsXML($productsPortion)));
86
+ }
87
+ catch (Exception $exPortion) {
88
+ $this->_helper->LoggerForException($exPortion);
89
+ }
90
  $itt = 0;
91
  $productsPortion = array();
92
  }
97
  $this->_helper->CallAPI('importProducts', array('ProductsXML' => self::BuildProductsXML($productsPortion)));
98
  }
99
  }
100
+ catch (Exception $ex) {
101
+ $this->_helper->LoggerForException($ex);
102
+ }
103
  }
104
 
105
  public static function BuildProductsXML($products) {
131
  $productXML -> addChild("category", htmlspecialchars($categories -> getFirstItem() -> getName(), ENT_QUOTES));
132
  }
133
 
134
+ $productImage = null;
135
+ try{
136
+ $productImage = $product -> getImage() != 'no_selection' ? $product -> getImageUrl() : null;
137
+ }
138
+ catch(Exception $exImage) { }
139
+
140
+ $productXML -> addChild("image", htmlspecialchars($productImage, ENT_QUOTES));
141
  }
142
 
143
  return $productsXML->asXML();
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bubbleyes_BubblitPlugin</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/bsd-license.php">BSDL</license>
7
  <channel>community</channel>
@@ -9,11 +9,11 @@
9
  <summary>Connect customers and web stores&#xD;
10
  in a unique and dynamic way: Bubbl!</summary>
11
  <description>It's simple. End-consumers from all over the world surf the Internet, finding products which interest them- but the prices are slightly higher than they are willing to pay. With a simple click, these products are stored in a single convenient collection.</description>
12
- <notes>- Compatibility with PHP5.3 and below</notes>
13
  <authors><author><name>Terje Lindstad</name><user>tlindstad</user><email>terjelindstad@bubbleyes.com</email></author></authors>
14
- <date>2015-01-22</date>
15
- <time>14:52:06</time>
16
- <contents><target name="magecommunity"><dir><dir name="Bubbleyes"><dir name="BubblitPlugin"><dir name="Block"><file name="Button.php" hash="5b9ee082aa8542c2204b1ad86cec1272"/></dir><dir name="Helper"><file name="Data.php" hash="638a8f76ead78a1f84f99b5adc26b2b4"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Bubbllayout.php" hash="ea03544f51545df9803dc3fb0d69ce30"/><dir name="Helpinfo"><file name="Comment.php" hash="eaa644af07bf619a06805184e1daffbd"/></dir></dir></dir><file name="Observer.php" hash="81840c62dcf864639a9f980cf7a65249"/></dir><dir name="etc"><file name="config.xml" hash="042fd5e76f03266d2f22e4e7025d06b1"/><file name="system.xml" hash="3b8dde9a695682f52559ee57df8258c2"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Bubbleyes_BubblitPlugin.xml" hash="0691ad097f8ca937d80ad4936607fea5"/></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="Bubbleyes_BubblitPlugin.xml" hash="2b172171473b55f2c4596f1eacee7e63"/></dir><dir name="template"><dir name="BubblitPlugin"><file name="button.phtml" hash="18199c13f81a042985363824986156c0"/></dir></dir></dir></dir><dir name="Bubbleyes"><dir name="default"><dir name="etc"><file name="theme.xml" hash="5c4fce4eb634014e556a22cec2a76d20"/></dir><dir name="layout"><file name="local.xml" hash="01c78642851f6e17d1057882f893d3c1"/></dir><dir name="template"><dir name="catalog"><dir name="product"><dir name="view"><file name="sharing.phtml" hash="5be2544566332d003f3bb16579a96498"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>4.5.0</min><max>10.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bubbleyes_BubblitPlugin</name>
4
+ <version>1.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/bsd-license.php">BSDL</license>
7
  <channel>community</channel>
9
  <summary>Connect customers and web stores&#xD;
10
  in a unique and dynamic way: Bubbl!</summary>
11
  <description>It's simple. End-consumers from all over the world surf the Internet, finding products which interest them- but the prices are slightly higher than they are willing to pay. With a simple click, these products are stored in a single convenient collection.</description>
12
+ <notes>- bug fixing</notes>
13
  <authors><author><name>Terje Lindstad</name><user>tlindstad</user><email>terjelindstad@bubbleyes.com</email></author></authors>
14
+ <date>2015-01-27</date>
15
+ <time>14:53:23</time>
16
+ <contents><target name="magecommunity"><dir><dir name="Bubbleyes"><dir name="BubblitPlugin"><dir name="Block"><file name="Button.php" hash="5b9ee082aa8542c2204b1ad86cec1272"/></dir><dir name="Helper"><file name="Data.php" hash="699da5a9c83a9628995decaca9761289"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Bubbllayout.php" hash="ea03544f51545df9803dc3fb0d69ce30"/><dir name="Helpinfo"><file name="Comment.php" hash="eaa644af07bf619a06805184e1daffbd"/></dir></dir></dir><file name="Observer.php" hash="0ec26f8a691ee12ae10a375479598681"/></dir><dir name="etc"><file name="config.xml" hash="042fd5e76f03266d2f22e4e7025d06b1"/><file name="system.xml" hash="3b8dde9a695682f52559ee57df8258c2"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Bubbleyes_BubblitPlugin.xml" hash="0691ad097f8ca937d80ad4936607fea5"/></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="Bubbleyes_BubblitPlugin.xml" hash="2b172171473b55f2c4596f1eacee7e63"/></dir><dir name="template"><dir name="BubblitPlugin"><file name="button.phtml" hash="18199c13f81a042985363824986156c0"/></dir></dir></dir></dir><dir name="Bubbleyes"><dir name="default"><dir name="etc"><file name="theme.xml" hash="5c4fce4eb634014e556a22cec2a76d20"/></dir><dir name="layout"><file name="local.xml" hash="01c78642851f6e17d1057882f893d3c1"/></dir><dir name="template"><dir name="catalog"><dir name="product"><dir name="view"><file name="sharing.phtml" hash="5be2544566332d003f3bb16579a96498"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>4.5.0</min><max>10.0.0</max></php></required></dependencies>
19
  </package>