Mashon_Sync - Version 1.4.2

Version Notes

developed on magento 1.5.1.0;
added fixes including:

- pointing creator to creator.dabbleapp.com
- fixing bug when creating objects from arrays on add to cart
- improved error logging a bit

Download this release

Release Info

Developer brandonWargo
Extension Mashon_Sync
Version 1.4.2
Comparing to
See all releases


Code changes from version 1.4.1 to 1.4.2

app/code/community/Mashon/Sync/Helper/Data.php CHANGED
@@ -155,7 +155,7 @@ class Mashon_Sync_Helper_Data extends Mage_Core_Helper_Abstract
155
  </block>
156
  <block type="core/text" name="mystuff.js">
157
  <action method="setText">
158
- <text><![CDATA[<script type="text/javascript" src="http://www.dabbleapp.com/loaders/instantiation.js?width=500&height=593&designedId='.$data->{'_id'}.'&new=true&productChangeCallback=changeTheProduct&frameborder=1"></script>]]></text>
159
  </action>
160
  </block>
161
  </reference>
@@ -259,7 +259,6 @@ class Mashon_Sync_Helper_Data extends Mage_Core_Helper_Abstract
259
  $cartId = $params['cartId'];
260
  $hash = md5($cartId.'th9megenatas');
261
 
262
- //http://localhost/scripts/processItems.php?cartId=4e9399c3e4b0c585927817f3&dataCallbackUrl=http://www.dabbleapp.com/magento/getCartItems&callback=jsonp1318295986466
263
  $data = json_decode(file_get_contents($params['dataCallbackUrl'].'?id='.$cartId.'&hash='.$hash), true);
264
  foreach($data as $productData) {
265
  $productsData[] = $this->_array_to_object($productData);
@@ -445,7 +444,7 @@ class Mashon_Sync_Helper_Data extends Mage_Core_Helper_Abstract
445
  </block>
446
  <block type="core/text" name="mystuff.js">
447
  <action method="setText">
448
- <text><![CDATA[<script type="text/javascript" src="http://www.dabbleapp.com/loaders/instantiation.js?width=500&height=593&designedId='.$data->{'_id'}.'&new=true&productChangeCallback=changeTheProduct&frameborder=1"></script>]]></text>
449
  </action>
450
  </block>
451
  </reference>
@@ -692,7 +691,7 @@ class Mashon_Sync_Helper_Data extends Mage_Core_Helper_Abstract
692
  */
693
  protected function _array_to_object($array = array()) {
694
  if (!empty($array)) {
695
- $data = false;
696
  foreach ($array as $akey => $aval) {
697
  $data -> {$akey} = $aval;
698
  }
155
  </block>
156
  <block type="core/text" name="mystuff.js">
157
  <action method="setText">
158
+ <text><![CDATA[<script type="text/javascript" src="http://creator.dabbleapp.com/loaders/instantiation.js?width=500&height=593&designedId='.$data->{'_id'}.'&new=true&productChangeCallback=changeTheProduct&frameborder=1"></script>]]></text>
159
  </action>
160
  </block>
161
  </reference>
259
  $cartId = $params['cartId'];
260
  $hash = md5($cartId.'th9megenatas');
261
 
 
262
  $data = json_decode(file_get_contents($params['dataCallbackUrl'].'?id='.$cartId.'&hash='.$hash), true);
263
  foreach($data as $productData) {
264
  $productsData[] = $this->_array_to_object($productData);
444
  </block>
445
  <block type="core/text" name="mystuff.js">
446
  <action method="setText">
447
+ <text><![CDATA[<script type="text/javascript" src="http://creator.dabbleapp.com/loaders/instantiation.js?width=500&height=593&designedId='.$data->{'_id'}.'&new=true&productChangeCallback=changeTheProduct&frameborder=1"></script>]]></text>
448
  </action>
449
  </block>
450
  </reference>
691
  */
692
  protected function _array_to_object($array = array()) {
693
  if (!empty($array)) {
694
+ $data = new stdClass();
695
  foreach ($array as $akey => $aval) {
696
  $data -> {$akey} = $aval;
697
  }
app/code/community/Mashon/Sync/controllers/CartController.php CHANGED
@@ -48,9 +48,11 @@ class Mashon_Sync_CartController extends Mage_Core_Controller_Front_Action
48
  //$this->getResponse()->setBody($response);
49
  return;
50
  } catch (Mage_Core_Exception $e) {
 
51
  $response = $e->getMessage();
52
  } catch (Exception $e) {
53
- $response = 'Error: System error during request';
 
54
  }
55
 
56
  $this->getResponse()->setBody($response);
48
  //$this->getResponse()->setBody($response);
49
  return;
50
  } catch (Mage_Core_Exception $e) {
51
+ Mage::logException($e);
52
  $response = $e->getMessage();
53
  } catch (Exception $e) {
54
+ Mage::logException($e);
55
+ $response = $e->getMessage();
56
  }
57
 
58
  $this->getResponse()->setBody($response);
app/design/frontend/default/default/template/catalog/product/view/dabble-media.phtml CHANGED
@@ -35,7 +35,7 @@
35
  $_helper = $this->helper('catalog/output');
36
  ?>
37
  <?php if($_product->getProducttype() == 'configured'): ?>
38
- <script type="text/javascript"src="http://localhost:8080/loaders/instantiation.js?width=500&height=593&templateId=<?php echo $_product->getTemplateid(); ?>&new=true&productChangeCallback=changeTheProduct&frameborder=1"></script>
39
  <?php else: ?>
40
  <?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?>
41
  <p class="product-image product-image-zoom">
@@ -79,4 +79,4 @@
79
  </ul>
80
  </div>
81
  <?php endif; ?>
82
- <?php endif; ?>
35
  $_helper = $this->helper('catalog/output');
36
  ?>
37
  <?php if($_product->getProducttype() == 'configured'): ?>
38
+ <script type="text/javascript"src="http://creator.dabbleapp.com/loaders/instantiation.js?width=500&height=593&templateId=<?php echo $_product->getTemplateid(); ?>&new=true&productChangeCallback=changeTheProduct&frameborder=1"></script>
39
  <?php else: ?>
40
  <?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?>
41
  <p class="product-image product-image-zoom">
79
  </ul>
80
  </div>
81
  <?php endif; ?>
82
+ <?php endif; ?>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mashon_Sync</name>
4
- <version>1.4.1</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>
@@ -9,13 +9,15 @@
9
  <summary>For integrating Dabble into your Magento 1.5.1.0 shop</summary>
10
  <description>Mashon_Sync allows the Magento shop owner to easily integrate Dabble into their Magento version 1.5.1.0 shop. This extension allows you to sync your Dabble Templates and Designed Products into Magento.</description>
11
  <notes>developed on magento 1.5.1.0;&#xD;
 
12
  &#xD;
13
- -customized cart page to show the Dabble product thumbnail&#xD;
14
- -fixed Mage logException() error</notes>
 
15
  <authors><author><name>brandonWargo</name><user>brandonWargo</user><email>brandon.wargo@mashon.com</email></author></authors>
16
- <date>2012-06-15</date>
17
- <time>00:47:18</time>
18
- <contents><target name="magecommunity"><dir name="Mashon"><dir name="Sync"><dir name="Block"><file name="Sync.php" hash="d880873f5863ac7d2e627edad0289266"/></dir><dir name="Helper"><file name="Data.php" hash="33a96e626344668ec6f29feb16c3a599"/></dir><dir name="controllers"><file name="CartController.php" hash="56a3e95f9fe636a1c77567effa2dae0f"/><file name="OrderController.php" hash="5a834a5d4980b05f8684e7d10739e20a"/><file name="ProductController.php" hash="1558404804f2174b04d7163059522bf0"/></dir><dir name="etc"><file name="config.xml" hash="04f32bf3558fbd20d508df4fd06b2b21"/></dir><dir name="sql"><dir name="mashon_setup"><file name="mysql4-install-1.0.php" hash="8ffe4d77aa3131392caa80e891afe3f9"/><file name="mysql4-upgrade-1.0-1.1.php" hash="46e3030b6acf2a66aaa843924a8af710"/><file name="mysql4-upgrade-1.3.4-1.4.php" hash="bb8f8b6247d5fdd4ccc4b43334a2dca5"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mashon_All.xml" hash="2929381275448f2ea1409a08703b6349"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="dabble"><dir name="template"><dir name="catalog"><dir name="product"><dir name="view"><file name="createyourown.phtml" hash="0e79cd3ec104ca8dde52f2b60122d0c2"/></dir><file name="view.phtml" hash="1883d9ac26da40bfbba351448d0997cc"/></dir></dir><dir name="checkout"><dir name="cart"><dir name="item"><file name="default.phtml" hash="7cb8b98411059ecd0651cc116fa973e3"/></dir></dir></dir></dir></dir><dir name="default"><dir name="template"><dir name="catalog"><dir name="product"><dir name="view"><file name="dabble-media.phtml" hash="03ff38ec5e72fd0f781020a993606053"/><file name="dabble-options.phtml" hash="c3565ab4bf3827231862617b1eab3c2b"/><dir name="options"><file name="dabble-wrapper.phtml" hash="2394c7f5b059b76848607535e5cb2925"/><dir name="wrapper"><file name="createyourown.phtml" hash="0e79cd3ec104ca8dde52f2b60122d0c2"/><file name="dabble-bottom.phtml" hash="2fca682fc852b7293b6e640ff3e523b5"/></dir></dir></dir></dir></dir><dir name="checkout"><dir name="cart"><dir name="item"><file name="default.phtml" hash="c315fb734b15f219a11cb5a1814fea88"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="dabble-styles.css" hash="f99b83b8fc9c194f64ae528b530e02ec"/></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mashon_Sync</name>
4
+ <version>1.4.2</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>
9
  <summary>For integrating Dabble into your Magento 1.5.1.0 shop</summary>
10
  <description>Mashon_Sync allows the Magento shop owner to easily integrate Dabble into their Magento version 1.5.1.0 shop. This extension allows you to sync your Dabble Templates and Designed Products into Magento.</description>
11
  <notes>developed on magento 1.5.1.0;&#xD;
12
+ added fixes including:&#xD;
13
  &#xD;
14
+ - pointing creator to creator.dabbleapp.com&#xD;
15
+ - fixing bug when creating objects from arrays on add to cart&#xD;
16
+ - improved error logging a bit</notes>
17
  <authors><author><name>brandonWargo</name><user>brandonWargo</user><email>brandon.wargo@mashon.com</email></author></authors>
18
+ <date>2012-08-24</date>
19
+ <time>21:24:54</time>
20
+ <contents><target name="magecommunity"><dir name="Mashon"><dir name="Sync"><dir name="Block"><file name="Sync.php" hash="d880873f5863ac7d2e627edad0289266"/></dir><dir name="Helper"><file name="Data.php" hash="9e4ac106b89f57820f6cbce4a1c3c125"/></dir><dir name="controllers"><file name="CartController.php" hash="646e6d845951cb09810759cf6268073a"/><file name="OrderController.php" hash="5a834a5d4980b05f8684e7d10739e20a"/><file name="ProductController.php" hash="1558404804f2174b04d7163059522bf0"/></dir><dir name="etc"><file name="config.xml" hash="04f32bf3558fbd20d508df4fd06b2b21"/></dir><dir name="sql"><dir name="mashon_setup"><file name="mysql4-install-1.0.php" hash="8ffe4d77aa3131392caa80e891afe3f9"/><file name="mysql4-upgrade-1.0-1.1.php" hash="46e3030b6acf2a66aaa843924a8af710"/><file name="mysql4-upgrade-1.3.4-1.4.php" hash="bb8f8b6247d5fdd4ccc4b43334a2dca5"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mashon_All.xml" hash="2929381275448f2ea1409a08703b6349"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="dabble"><dir name="template"><dir name="catalog"><dir name="product"><dir name="view"><file name="createyourown.phtml" hash="0e79cd3ec104ca8dde52f2b60122d0c2"/></dir><file name="view.phtml" hash="1883d9ac26da40bfbba351448d0997cc"/></dir></dir><dir name="checkout"><dir name="cart"><dir name="item"><file name="default.phtml" hash="7cb8b98411059ecd0651cc116fa973e3"/></dir></dir></dir></dir></dir><dir name="default"><dir name="template"><dir name="catalog"><dir name="product"><dir name="view"><file name="dabble-media.phtml" hash="401466171a9444b452eb66c8ea6aa777"/><file name="dabble-options.phtml" hash="c3565ab4bf3827231862617b1eab3c2b"/><dir name="options"><file name="dabble-wrapper.phtml" hash="2394c7f5b059b76848607535e5cb2925"/><dir name="wrapper"><file name="createyourown.phtml" hash="0e79cd3ec104ca8dde52f2b60122d0c2"/><file name="dabble-bottom.phtml" hash="2fca682fc852b7293b6e640ff3e523b5"/></dir></dir></dir></dir></dir><dir name="checkout"><dir name="cart"><dir name="item"><file name="default.phtml" hash="c315fb734b15f219a11cb5a1814fea88"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="dabble-styles.css" hash="f99b83b8fc9c194f64ae528b530e02ec"/></dir></dir></dir></dir></target></contents>
21
  <compatible/>
22
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
23
  </package>