Print_Science_Designer_Web_to_Print - Version 1.0.9

Version Notes

Print_Science_Designer_Web_to_Print

Download this release

Release Info

Developer John Weissberg
Extension Print_Science_Designer_Web_to_Print
Version 1.0.9
Comparing to
See all releases


Code changes from version 1.0.8 to 1.0.9

app/code/local/PrintScience/Personalization/Block/Checkout/Cart/Item/Renderer.php CHANGED
@@ -48,6 +48,22 @@ class PrintScience_Personalization_Block_Checkout_Cart_Item_Renderer extends Mag
48
  if (!$apiSessionKey) {
49
  return false;
50
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  $url = Mage::getUrl('personalization/index/resumeShoppingCart', array(
52
  'api_session_key' => $apiSessionKey,
53
  'product' => $productId
48
  if (!$apiSessionKey) {
49
  return false;
50
  }
51
+ $item = $this->getItem();
52
+ // get simple product of configurable
53
+ if($item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE){
54
+ $quoteItemId = $this->getItem()->getId();
55
+ $mQuote = $this->getItem()->getQuote();
56
+ $aChildQuoteItem = Mage::getModel("sales/quote_item")
57
+ ->getCollection()
58
+ ->setQuote($mQuote)
59
+ ->addFieldToFilter("parent_item_id", $quoteItemId)->getFirstItem();
60
+ if($aChildQuoteItem){
61
+ if($aChildQuoteItem->getId()){
62
+ $productId = $aChildQuoteItem->getProductId();
63
+ }
64
+ }
65
+ }
66
+
67
  $url = Mage::getUrl('personalization/index/resumeShoppingCart', array(
68
  'api_session_key' => $apiSessionKey,
69
  'product' => $productId
app/code/local/PrintScience/Personalization/Model/Observer.php CHANGED
@@ -71,6 +71,7 @@ class PrintScience_Personalization_Model_Observer
71
  } elseif ($productTypeId == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
72
  $attributes = $request->getParam('super_attribute');
73
  $product = $product->getTypeInstance()->getProductByAttributes($attributes);
 
74
  if ((!$product) || (!$product->getPersonalizationEnabled())) {
75
  return false;
76
  }
@@ -102,7 +103,6 @@ class PrintScience_Personalization_Model_Observer
102
  $successUrl = Mage::getUrl('personalization/index/success', $returnUrlParams);
103
  $failUrl = Mage::getUrl('personalization/index/fail', $returnUrlParams);
104
  $cancelUrl = Mage::getUrl('personalization/index/cancel', $returnUrlParams);
105
-
106
  // begin personalization
107
  $apiGateway = Mage::getModel('printscience_personalization/apiGateway');
108
  $apiResponse = $apiGateway->beginPersonalization($templateId, $successUrl, $failUrl, $cancelUrl);
@@ -162,7 +162,8 @@ class PrintScience_Personalization_Model_Observer
162
  $sessionKey = $request->getParam('personalization_session_key');
163
 
164
  $quoteItem = $observer->getEvent()->getData('quote_item');
165
- if ((!$quoteItem->getProduct()->getPersonalizationEnabled()) || (!$sessionKey)) {
 
166
  return false;
167
  }
168
 
71
  } elseif ($productTypeId == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
72
  $attributes = $request->getParam('super_attribute');
73
  $product = $product->getTypeInstance()->getProductByAttributes($attributes);
74
+ $product = Mage::getModel('catalog/product')->load($product->getId());
75
  if ((!$product) || (!$product->getPersonalizationEnabled())) {
76
  return false;
77
  }
103
  $successUrl = Mage::getUrl('personalization/index/success', $returnUrlParams);
104
  $failUrl = Mage::getUrl('personalization/index/fail', $returnUrlParams);
105
  $cancelUrl = Mage::getUrl('personalization/index/cancel', $returnUrlParams);
 
106
  // begin personalization
107
  $apiGateway = Mage::getModel('printscience_personalization/apiGateway');
108
  $apiResponse = $apiGateway->beginPersonalization($templateId, $successUrl, $failUrl, $cancelUrl);
162
  $sessionKey = $request->getParam('personalization_session_key');
163
 
164
  $quoteItem = $observer->getEvent()->getData('quote_item');
165
+ $productItem = Mage::getModel('catalog/product')->load($quoteItem->getProduct()->getId());
166
+ if ((!$productItem->getPersonalizationEnabled()) || (!$sessionKey)) {
167
  return false;
168
  }
169
 
app/code/local/PrintScience/Personalization/controllers/IndexController.php CHANGED
@@ -200,7 +200,7 @@ class PrintScience_Personalization_IndexController extends Mage_Core_Controller_
200
 
201
  $apiResponse = $apiGateway->getPreview($apiSessionKey);
202
  if ($apiResponse->getFaultCode()) {
203
- $session->addError($this->__('Personalization was not completed.'));
204
  $this->_redirectUrl($errorUrl);
205
  return false;
206
  }
200
 
201
  $apiResponse = $apiGateway->getPreview($apiSessionKey);
202
  if ($apiResponse->getFaultCode()) {
203
+ $session->addError($this->__('Personalization was not completed.'));
204
  $this->_redirectUrl($errorUrl);
205
  return false;
206
  }
app/code/local/PrintScience/Personalization/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <PrintScience_Personalization>
5
- <version>1.0.8</version>
6
  </PrintScience_Personalization>
7
  </modules>
8
  <frontend>
2
  <config>
3
  <modules>
4
  <PrintScience_Personalization>
5
+ <version>1.0.9</version>
6
  </PrintScience_Personalization>
7
  </modules>
8
  <frontend>
app/code/local/PrintScience/Personalization/etc/system.xml CHANGED
@@ -36,6 +36,15 @@
36
  <show_in_website>0</show_in_website>
37
  <show_in_store>0</show_in_store>
38
  </api_url>
 
 
 
 
 
 
 
 
 
39
  </fields>
40
  </personalization>
41
  </groups>
36
  <show_in_website>0</show_in_website>
37
  <show_in_store>0</show_in_store>
38
  </api_url>
39
+ <api_image_url transalte="label">
40
+ <label>API Image URL</label>
41
+ <frontend_type>text</frontend_type>
42
+ <backend_model>printscience_personalization/system_config_backend_apiUrl</backend_model>
43
+ <sort_order>4</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>0</show_in_website>
46
+ <show_in_store>0</show_in_store>
47
+ </api_image_url>
48
  </fields>
49
  </personalization>
50
  </groups>
app/code/local/PrintScience/Personalization/sql/printscience_personalization_setup/mysql4-upgrade-1.0.8-1.0.9.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->updateAttribute('catalog_product', 'personalization_template_id', 'apply_to', implode(',',array('simple','configurable')));
5
+ $installer->updateAttribute('catalog_product', 'personalization_enabled', 'apply_to', implode(',',array('simple','configurable')));
6
+ $installer->endSetup();
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Print_Science_Designer_Web_to_Print</name>
4
- <version>1.0.8</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Print_Science_Designer_Web_to_Print</description>
11
  <notes>Print_Science_Designer_Web_to_Print</notes>
12
  <authors><author><name>John Weissberg</name><user>johnwwweissberg</user><email>jw@print-science.com</email></author></authors>
13
- <date>2012-05-24</date>
14
- <time>11:04:53</time>
15
- <contents><target name="magelocal"><dir name="PrintScience"><dir name="Personalization"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Items"><file name="Renderer.php" hash="e9a0dcb549311ea6f4e3992bbc9a4b5c"/></dir></dir></dir></dir></dir><dir name="Checkout"><dir name="Cart"><dir name="Item"><file name="Renderer.php" hash="b412c0fa9e85b5de92519a2ef1505c56"/></dir></dir></dir></dir><dir name="Helper"><file name="Order.php" hash="ba50cbfb5f647cbca2deae91153db9b7"/><file name="Output.php" hash="850a4a708a2dd67a5f3f71ee93087740"/><file name="Quote.php" hash="d14fbe62e2a96e4aede13082c16dda30"/><file name="Session.php" hash="0236f26208780df75ca780d40edbe351"/></dir><dir name="Model"><dir name="ApiGateway"><dir name="Response"><file name="Abstract.php" hash="66667fce4c92782faf1d1a92f4c3e339"/><file name="Begin.php" hash="451d64c86ef6aa542ae7cf5949b1b627"/><file name="GetPreview.php" hash="bbf2885274837015a49787f7685a2bd6"/></dir></dir><file name="ApiGateway.php" hash="9a3477755c09d271ca5deabae66efed8"/><file name="Observer.php" hash="591094bcccd0baed05321668dc275a20"/><dir name="Override"><dir name="Checkout"><file name="Cart.php" hash="ccece0a4e9fffd6d4b7f1b1a8a97dbd3"/></dir><dir name="Sales"><file name="Quote.php" hash="58083e79ec32db5ea22e0fa61f3a4bd7"/></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="0b1f152cf26c58a92efe4165dc9b3803"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="ApiUrl.php" hash="34eb488ef178104966397f425625534d"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="99a61366b957002731bb6948c2956839"/></dir><dir name="etc"><file name="config.xml" hash="3c128022e5d9d572d238a4ebc3eb21c3"/><file name="system.xml" hash="9808dd3a40e7a7c24e210b5d95f78507"/></dir><dir name="sql"><dir name="printscience_personalization_setup"><file name="mysql4-install-1.0.3.php" hash="7895f0369177cb6dab9911d7820647b4"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="d952675034fdd05650ef978dccbc05fd"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="printscience_personalization.xml" hash="02bbc420d579eceee5b83b3fb41a73af"/></dir><dir name="template"><dir name="printscience_personalization"><dir name="sales"><dir name="order"><dir name="view"><dir name="items"><dir name="renderer"><file name="default.phtml" hash="5b6bcdd9bd94afda867429707dd786d3"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="printscience_personalization.xml" hash="8aaf99ddb5b8f918413fc861ff7c6036"/></dir><dir name="template"><dir name="printscience_personalization"><dir name="catalog"><dir name="product"><file name="list.phtml" hash="ed9facdc48754e923c89b206003abe8a"/><dir name="view"><file name="addtocart.phtml" hash="c46ece2a25fa12658938f3f2be6a6790"/><file name="media.phtml" hash="c1350af91c896b3a621a4ddc9bb9e219"/></dir></dir></dir><dir name="checkout"><dir name="cart"><dir name="item"><file name="default.phtml" hash="100d84ebfa362f73af66a6e12fa3cb83"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="PrintScience_Personalization.xml" hash="5f5c39c5b01e828137125d057d04a655"/></dir></target><target name="magelib"><dir name="xmlrpc"><file name="xmlrpc.inc" hash="55ecb2a9f7fc20d53a7b4da9d885e26b"/></dir></target><target name="mage"><dir name="js"><dir name="printscience_personalization"><file name="gallery.css" hash="eccacd49a35d68ef25bc1bf8e292fe98"/><file name="gallery.js" hash="d1ce93b3cf8ef950fef1097636f3205e"/><dir name="jquery"><dir name="fancybox"><file name="blank.gif" hash="325472601571f31e1bf00674c368d335"/><file name="fancy_close.png" hash="6e2879a324a76e9972ebc98201aae1d8"/><file name="fancy_loading.png" hash="b1d54c240cf06e7f41e372d56919b738"/><file name="fancy_nav_left.png" hash="3f3e406102152cd8236383568a40ba35"/><file name="fancy_nav_right.png" hash="216e4bde5bddeeaa60dc3d692890a68e"/><file name="fancy_shadow_e.png" hash="fd4f491080d29fade5080877f1ba4c8b"/><file name="fancy_shadow_n.png" hash="18cde16379b2ceadef714d9b346d09ec"/><file name="fancy_shadow_ne.png" hash="63adf788acf193d4e4f3642d7d793125"/><file name="fancy_shadow_nw.png" hash="c820c878aedb7a7f9ebd7135a58e7c65"/><file name="fancy_shadow_s.png" hash="9b9e5c888028aaef40fe5b6a363f1e29"/><file name="fancy_shadow_se.png" hash="a8afd5a008884380ee712d177105268f"/><file name="fancy_shadow_sw.png" hash="f81cc0fee5581d76ad3cebe47e7e791b"/><file name="fancy_shadow_w.png" hash="59b0e63eb059e58d932cfd53da4d87e6"/><file name="fancy_title_left.png" hash="1582ac2d3bef6a6445bf02ceca2741cd"/><file name="fancy_title_main.png" hash="38dad6c1ed4bdc81c0bec721b2deb8c2"/><file name="fancy_title_over.png" hash="b886fd165d4b7ac77d41fb52d87ffc60"/><file name="fancy_title_right.png" hash="6cbe0c935511e7f9a2555ccb6a7324c4"/><file name="fancybox-x.png" hash="168696d8a694214090ef90e029cdf393"/><file name="fancybox-y.png" hash="36a58859beb9a6b19322a37466b9f78e"/><file name="fancybox.png" hash="11e57e492ee0311540967cc7a1e6e3e2"/><file name="jquery.easing-1.3.pack.js" hash="def257dbb0ab805c4996fd8abb1a6b49"/><file name="jquery.fancybox-1.3.4.css" hash="4638ce99ef00cf62bfb22d230f9924b8"/><file name="jquery.fancybox-1.3.4.pack.js" hash="8bc36a08c46719377528d962966ce37c"/><file name="jquery.mousewheel-3.0.4.pack.js" hash="3b0a821567b463e70bcc1e90ed2bc9b6"/></dir><file name="jquery-1.4.2.min.js" hash="b80a2154ce061c8242031d9a4892c5a6"/><dir name="jquery.cycle"><file name="jquery.cycle.lite.min.js" hash="0c4a7571c05a6ada90b93e826e7f9f6e"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="PrintScience_Personalization.csv" hash="fc8365124f21bddca4dfac3d3dbf5b7f"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Print_Science_Designer_Web_to_Print</name>
4
+ <version>1.0.9</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
10
  <description>Print_Science_Designer_Web_to_Print</description>
11
  <notes>Print_Science_Designer_Web_to_Print</notes>
12
  <authors><author><name>John Weissberg</name><user>johnwwweissberg</user><email>jw@print-science.com</email></author></authors>
13
+ <date>2013-03-18</date>
14
+ <time>00:22:46</time>
15
+ <contents><target name="magelocal"><dir name="PrintScience"><dir name="Personalization"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Items"><file name="Renderer.php" hash="e9a0dcb549311ea6f4e3992bbc9a4b5c"/></dir></dir></dir></dir></dir><dir name="Checkout"><dir name="Cart"><dir name="Item"><file name="Renderer.php" hash="df8e92bcf833f62324a47cb0af298e1c"/></dir></dir></dir></dir><dir name="Helper"><file name="Order.php" hash="ba50cbfb5f647cbca2deae91153db9b7"/><file name="Output.php" hash="850a4a708a2dd67a5f3f71ee93087740"/><file name="Quote.php" hash="d14fbe62e2a96e4aede13082c16dda30"/><file name="Session.php" hash="0236f26208780df75ca780d40edbe351"/></dir><dir name="Model"><dir name="ApiGateway"><dir name="Response"><file name="Abstract.php" hash="66667fce4c92782faf1d1a92f4c3e339"/><file name="Begin.php" hash="451d64c86ef6aa542ae7cf5949b1b627"/><file name="GetPreview.php" hash="bbf2885274837015a49787f7685a2bd6"/></dir></dir><file name="ApiGateway.php" hash="9a3477755c09d271ca5deabae66efed8"/><file name="Observer.php" hash="eb7b131c876983ff28cbaee0c0022794"/><dir name="Override"><dir name="Checkout"><file name="Cart.php" hash="ccece0a4e9fffd6d4b7f1b1a8a97dbd3"/></dir><dir name="Sales"><file name="Quote.php" hash="58083e79ec32db5ea22e0fa61f3a4bd7"/></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="0b1f152cf26c58a92efe4165dc9b3803"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="ApiUrl.php" hash="34eb488ef178104966397f425625534d"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="e72c45efac84a7dbeb5a36a025dd06df"/></dir><dir name="etc"><file name="config.xml" hash="e13b76487db5d8a4b0634f00aa971f45"/><file name="system.xml" hash="24a7d96787c8594a824b71cc2bc60da9"/></dir><dir name="sql"><dir name="printscience_personalization_setup"><file name="mysql4-install-1.0.3.php" hash="7895f0369177cb6dab9911d7820647b4"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="d952675034fdd05650ef978dccbc05fd"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="2e7cd11df78d3742d95f5264a2f34f07"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="PrintScience_Personalization.xml" hash="5f5c39c5b01e828137125d057d04a655"/></dir></target><target name="magelib"><dir name="xmlrpc"><file name="xmlrpc.inc" hash="55ecb2a9f7fc20d53a7b4da9d885e26b"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="PrintScience_Personalization.csv" hash="fc8365124f21bddca4dfac3d3dbf5b7f"/></dir></dir></target><target name="mage"><dir name="js"><dir name="printscience_personalization"><file name="gallery.css" hash="eccacd49a35d68ef25bc1bf8e292fe98"/><file name="gallery.js" hash="d1ce93b3cf8ef950fef1097636f3205e"/><dir name="jquery"><dir name="fancybox"><file name="blank.gif" hash="325472601571f31e1bf00674c368d335"/><file name="fancy_close.png" hash="6e2879a324a76e9972ebc98201aae1d8"/><file name="fancy_loading.png" hash="b1d54c240cf06e7f41e372d56919b738"/><file name="fancy_nav_left.png" hash="3f3e406102152cd8236383568a40ba35"/><file name="fancy_nav_right.png" hash="216e4bde5bddeeaa60dc3d692890a68e"/><file name="fancy_shadow_e.png" hash="fd4f491080d29fade5080877f1ba4c8b"/><file name="fancy_shadow_n.png" hash="18cde16379b2ceadef714d9b346d09ec"/><file name="fancy_shadow_ne.png" hash="63adf788acf193d4e4f3642d7d793125"/><file name="fancy_shadow_nw.png" hash="c820c878aedb7a7f9ebd7135a58e7c65"/><file name="fancy_shadow_s.png" hash="9b9e5c888028aaef40fe5b6a363f1e29"/><file name="fancy_shadow_se.png" hash="a8afd5a008884380ee712d177105268f"/><file name="fancy_shadow_sw.png" hash="f81cc0fee5581d76ad3cebe47e7e791b"/><file name="fancy_shadow_w.png" hash="59b0e63eb059e58d932cfd53da4d87e6"/><file name="fancy_title_left.png" hash="1582ac2d3bef6a6445bf02ceca2741cd"/><file name="fancy_title_main.png" hash="38dad6c1ed4bdc81c0bec721b2deb8c2"/><file name="fancy_title_over.png" hash="b886fd165d4b7ac77d41fb52d87ffc60"/><file name="fancy_title_right.png" hash="6cbe0c935511e7f9a2555ccb6a7324c4"/><file name="fancybox-x.png" hash="168696d8a694214090ef90e029cdf393"/><file name="fancybox-y.png" hash="36a58859beb9a6b19322a37466b9f78e"/><file name="fancybox.png" hash="11e57e492ee0311540967cc7a1e6e3e2"/><file name="jquery.easing-1.3.pack.js" hash="def257dbb0ab805c4996fd8abb1a6b49"/><file name="jquery.fancybox-1.3.4.css" hash="4638ce99ef00cf62bfb22d230f9924b8"/><file name="jquery.fancybox-1.3.4.pack.js" hash="8bc36a08c46719377528d962966ce37c"/><file name="jquery.mousewheel-3.0.4.pack.js" hash="3b0a821567b463e70bcc1e90ed2bc9b6"/></dir><file name="jquery-1.4.2.min.js" hash="b80a2154ce061c8242031d9a4892c5a6"/><dir name="jquery.cycle"><file name="jquery.cycle.lite.min.js" hash="0c4a7571c05a6ada90b93e826e7f9f6e"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="printscience_personalization.xml" hash="02bbc420d579eceee5b83b3fb41a73af"/></dir><dir name="template"><dir name="printscience_personalization"><dir name="sales"><dir name="order"><dir name="view"><dir name="items"><dir name="renderer"><file name="default.phtml" hash="5b6bcdd9bd94afda867429707dd786d3"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="printscience_personalization.xml" hash="8aaf99ddb5b8f918413fc861ff7c6036"/></dir><dir name="template"><dir name="printscience_personalization"><dir name="catalog"><dir name="product"><file name="list.phtml" hash="ed9facdc48754e923c89b206003abe8a"/><dir name="view"><file name="addtocart.phtml" hash="c46ece2a25fa12658938f3f2be6a6790"/><file name="media.phtml" hash="c1350af91c896b3a621a4ddc9bb9e219"/></dir></dir></dir><dir name="checkout"><dir name="cart"><dir name="item"><file name="default.phtml" hash="100d84ebfa362f73af66a6e12fa3cb83"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>