Mashon_Sync - Version 1.4.3

Version Notes

developed on magento 1.5.1.0;
added fixes including:

- Fix sort order for custom options

Download this release

Release Info

Developer brandonWargo
Extension Mashon_Sync
Version 1.4.3
Comparing to
See all releases


Code changes from version 1.4.2 to 1.4.3

app/code/community/Mashon/Sync/Helper/Data.php CHANGED
@@ -128,7 +128,7 @@ class Mashon_Sync_Helper_Data extends Mage_Core_Helper_Abstract
128
 
129
  $product->setName($data->{'alias'});
130
  $product->setDescription($data->{'description'});
131
- $product->setShortDescription($data->{'shortDescription'});
132
  $product->setPrice($data->{'MSRP'});
133
  $product->setWeight($data->{'weight'});
134
  $product->setSku($data->{'clientSku'});
@@ -137,30 +137,63 @@ class Mashon_Sync_Helper_Data extends Mage_Core_Helper_Abstract
137
  $product->setProducttype('designed');
138
  if($data->{'editable'} == 'true'){
139
  $product->setEditable(1);
140
- $product->setCustomLayoutUpdate('<reference name="head">
141
- <block type="core/text" name="googleJQuery.js">
142
- <action method="setText">
143
- <text><![CDATA[<meta http-equiv="X-UA-Compatible" content="chrome=1"/> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script><script type="text/javascript"> jQuery.noConflict();</script><script type="text/javascript">function changeTheProduct(productdata) {
144
- //do whatever you want with the productdata
145
- console.log("product changed")
146
- console.log(productdata)
147
- //console.log(productdata.description)
148
- document.getElementById("product-name").innerHTML = "<h1>"+productdata.alias+"</h1>"
149
- //document.getElementById("short-description").innerHTML = productdata.shortDescription
150
- document.getElementById("description").innerHTML = productdata.description
151
- document.getElementById("product-price").innerHTML = "MSRP:<span class=\'price\'>$"+productdata.MSRP+"</span>"
152
- document.getElementById("product-sku").innerHTML = "<h2> SKU:"+productdata.internalSku+"</h2>"
153
- } </script>]]></text>
154
- </action>
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>
162
-
163
- <reference name="product.info">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
 
165
  <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/dabble-media.phtml"/>
166
  <reference name="product.info.options.wrapper">
@@ -172,32 +205,9 @@ class Mashon_Sync_Helper_Data extends Mage_Core_Helper_Abstract
172
  </reference>
173
  </reference>');
174
 
175
- }
176
- else{
177
- $product->setEditable(0);
178
  }
179
  }
180
- else {
181
- $product->setProducttype('configured');
182
- $product->setCustomLayoutUpdate('<reference name="head"><block type="core/text" name="googleJQuery.js">
183
- <action method="setText">
184
- <text><![CDATA[<meta http-equiv="X-UA-Compatible" content="chrome=1"/></script>]]></text>
185
- </action>
186
- </block>
187
- <action method="addCss"><stylesheet>css/dabble-styles.css</stylesheet></action>
188
- </reference> <reference name="product.info">
189
-
190
- <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/dabble-media.phtml"/>
191
- <reference name="product.info.options.wrapper">
192
- <action method="setTemplate"><template>catalog/product/view/options/dabble-wrapper.phtml</template></action>
193
- <reference name="product.info.options"><action method="setTemplate"><template>catalog/product/view/dabble-options.phtml</template></action></reference>
194
- </reference>
195
- <reference name="product.info.options.wrapper.bottom">
196
- <action method="setTemplate"><template>catalog/product/view/options/wrapper/dabble-bottom.phtml</template></action>
197
- </reference>
198
- </reference>');
199
- }
200
- $product->setPageLayout('one_column');
201
 
202
  Mage::dispatchEvent('catalog_product_prepare_save',array('product' => $product, 'request' => null));
203
  $product->save();
@@ -485,8 +495,10 @@ class Mashon_Sync_Helper_Data extends Mage_Core_Helper_Abstract
485
  <action method="setTemplate"><template>catalog/product/view/options/wrapper/dabble-bottom.phtml</template></action>
486
  </reference>
487
  </reference>');
 
 
488
  }
489
- $product->setPageLayout('one_column');
490
 
491
 
492
  $product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
@@ -662,7 +674,7 @@ class Mashon_Sync_Helper_Data extends Mage_Core_Helper_Abstract
662
  default:
663
  $title = trim($v);
664
  $custom_options[count($custom_options) - 1]['values'][] = array(
665
- 'is_delete' => 0 , 'title' => $titleopt , 'price_type' => 'fixed' , 'price' => intval($price) , 'sku' => '' , 'sort_order' => '');
666
  break;
667
  }
668
  }
@@ -834,4 +846,4 @@ class Mashon_Sync_Helper_Data extends Mage_Core_Helper_Abstract
834
 
835
  return $xml;
836
  }
837
- }
128
 
129
  $product->setName($data->{'alias'});
130
  $product->setDescription($data->{'description'});
131
+ //$product->setShortDescription($data->{'shortDescription'}); (DBL-2196)
132
  $product->setPrice($data->{'MSRP'});
133
  $product->setWeight($data->{'weight'});
134
  $product->setSku($data->{'clientSku'});
137
  $product->setProducttype('designed');
138
  if($data->{'editable'} == 'true'){
139
  $product->setEditable(1);
140
+
141
+ // Only update custom layout when is empty (DBL-2196)
142
+ if(!$product->getCustomLayoutUpdate()) {
143
+
144
+ $product->setCustomLayoutUpdate('<reference name="head">
145
+ <block type="core/text" name="googleJQuery.js">
146
+ <action method="setText">
147
+ <text><![CDATA[<meta http-equiv="X-UA-Compatible" content="chrome=1"/> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script><script type="text/javascript"> jQuery.noConflict();</script><script type="text/javascript">function changeTheProduct(productdata) {
148
+ //do whatever you want with the productdata
149
+ console.log("product changed")
150
+ console.log(productdata)
151
+ //console.log(productdata.description)
152
+ document.getElementById("product-name").innerHTML = "<h1>"+productdata.alias+"</h1>"
153
+ //document.getElementById("short-description").innerHTML = productdata.shortDescription
154
+ document.getElementById("description").innerHTML = productdata.description
155
+ document.getElementById("product-price").innerHTML = "MSRP:<span class=\'price\'>$"+productdata.MSRP+"</span>"
156
+ document.getElementById("product-sku").innerHTML = "<h2> SKU:"+productdata.internalSku+"</h2>"
157
+ } </script>]]></text>
158
+ </action>
159
+ </block>
160
+ <block type="core/text" name="mystuff.js">
161
+ <action method="setText">
162
+ <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>
163
+ </action>
164
+ </block>
165
+ </reference>
166
+
167
+ <reference name="product.info">
168
+
169
+ <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/dabble-media.phtml"/>
170
+ <reference name="product.info.options.wrapper">
171
+ <action method="setTemplate"><template>catalog/product/view/options/dabble-wrapper.phtml</template></action>
172
+ <reference name="product.info.options"><action method="setTemplate"><template>catalog/product/view/dabble-options.phtml</template></action></reference>
173
+ </reference>
174
+ <reference name="product.info.options.wrapper.bottom">
175
+ <action method="setTemplate"><template>catalog/product/view/options/wrapper/dabble-bottom.phtml</template></action>
176
+ </reference>
177
+ </reference>');
178
+ }
179
+
180
+ }
181
+ else{
182
+ $product->setEditable(0);
183
+ }
184
+ }
185
+ else {
186
+ $product->setProducttype('configured');
187
+
188
+ // Only update custom layout when is empty (DBL-2196)
189
+ if(!$product->getCustomLayoutUpdate()) {
190
+ $product->setCustomLayoutUpdate('<reference name="head"><block type="core/text" name="googleJQuery.js">
191
+ <action method="setText">
192
+ <text><![CDATA[<meta http-equiv="X-UA-Compatible" content="chrome=1"/></script>]]></text>
193
+ </action>
194
+ </block>
195
+ <action method="addCss"><stylesheet>css/dabble-styles.css</stylesheet></action>
196
+ </reference> <reference name="product.info">
197
 
198
  <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/dabble-media.phtml"/>
199
  <reference name="product.info.options.wrapper">
205
  </reference>
206
  </reference>');
207
 
208
+ $product->setPageLayout('one_column');
 
 
209
  }
210
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
 
212
  Mage::dispatchEvent('catalog_product_prepare_save',array('product' => $product, 'request' => null));
213
  $product->save();
495
  <action method="setTemplate"><template>catalog/product/view/options/wrapper/dabble-bottom.phtml</template></action>
496
  </reference>
497
  </reference>');
498
+
499
+ $product->setPageLayout('one_column');
500
  }
501
+
502
 
503
 
504
  $product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
674
  default:
675
  $title = trim($v);
676
  $custom_options[count($custom_options) - 1]['values'][] = array(
677
+ 'is_delete' => 0 , 'title' => $titleopt , 'price_type' => 'fixed' , 'price' => intval($price) , 'sku' => '' , 'sort_order' => $sort_order++);
678
  break;
679
  }
680
  }
846
 
847
  return $xml;
848
  }
849
+ }
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://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">
35
  $_helper = $this->helper('catalog/output');
36
  ?>
37
  <?php if($_product->getProducttype() == 'configured'): ?>
38
+ <script type="text/javascript"src="http://stage.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">
package.xml CHANGED
@@ -1,7 +1,7 @@
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>
@@ -11,13 +11,11 @@
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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mashon_Sync</name>
4
+ <version>1.4.3</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>
11
  <notes>developed on magento 1.5.1.0;&#xD;
12
  added fixes including:&#xD;
13
  &#xD;
14
+ - Fix sort order for custom options</notes>
 
 
15
  <authors><author><name>brandonWargo</name><user>brandonWargo</user><email>brandon.wargo@mashon.com</email></author></authors>
16
+ <date>2013-02-21</date>
17
+ <time>01:08:15</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="5164d75d1ff39b2e1dab6db62237269f"/></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="957ee1c9ba1df455dc5ddc661c4ecd9e"/><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>