Checkout_Discount_Code - Version 1.0.0.1

Version Notes

nothing

Download this release

Release Info

Developer Vnecoms
Extension Checkout_Discount_Code
Version 1.0.0.1
Comparing to
See all releases


Code changes from version 1.0.0.0 to 1.0.0.1

app/code/community/VES/CheckoutDiscountCode/Block/Checkout/Onepage/Progress.php CHANGED
@@ -22,7 +22,7 @@ class VES_CheckoutDiscountCode_Block_Checkout_Onepage_Progress extends Mage_Chec
22
 
23
  $toStep = $this->getRequest()->getParam('toStep');
24
 
25
- if ($stepsRevertIndex['discountcode'] >= $stepsRevertIndex[$toStep]) {
26
  return false;
27
  }
28
 
22
 
23
  $toStep = $this->getRequest()->getParam('toStep');
24
 
25
+ if (!isset($stepsRevertIndex['discountcode']) || $stepsRevertIndex['discountcode'] >= $stepsRevertIndex[$toStep]) {
26
  return false;
27
  }
28
 
app/code/community/VES/CheckoutDiscountCode/Model/Observer.php CHANGED
@@ -11,12 +11,21 @@ class VES_CheckoutDiscountCode_Model_Observer
11
 
12
  $controller = $observer->getData('controller_action');
13
  $body = Mage::helper('core')->jsonDecode($controller->getResponse()->getBody());
14
- if($body['goto_section']=='shipping_method') $body['goto_section'] = 'discountcode';
15
- $body['update_section'] = array(
16
- 'name' => 'shipping-method',
17
- 'html' => $this->_getVendorHtml($controller)
18
- );
19
- $body['allow_sections'] = array('billing','shipping','discountcode');
 
 
 
 
 
 
 
 
 
20
  $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($body));
21
  }
22
  /**
11
 
12
  $controller = $observer->getData('controller_action');
13
  $body = Mage::helper('core')->jsonDecode($controller->getResponse()->getBody());
14
+ if($body['goto_section']=='shipping_method'){
15
+ $body['goto_section'] = 'discountcode';
16
+ $body['update_section'] = array(
17
+ 'name' => 'shipping-method',
18
+ 'html' => $this->_getVendorHtml($controller)
19
+ );
20
+ $body['allow_sections'] = array('billing','shipping','discountcode');
21
+ }elseif($body['goto_section']=='payment'){
22
+ $body['goto_section'] = 'discountcode';
23
+ $body['update_section'] = array(
24
+ 'name' => 'payment-method',
25
+ 'html' => $this->_getVendorHtml($controller)
26
+ );
27
+ $body['allow_sections'] = array('billing','discountcode');
28
+ }
29
  $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($body));
30
  }
31
  /**
app/code/community/VES/CheckoutDiscountCode/controllers/IndexController.php CHANGED
@@ -50,6 +50,22 @@ class VES_CheckoutDiscountCode_IndexController extends Mage_Core_Controller_Fron
50
  return $output;
51
  }
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  /**
54
  * Retrieve shopping cart model object
55
  *
@@ -112,12 +128,20 @@ class VES_CheckoutDiscountCode_IndexController extends Mage_Core_Controller_Fron
112
  }
113
 
114
  if(!$result['error']) {
115
- $this->getOnepage()->getQuote()->getShippingAddress()->setCollectShippingRates(true);
116
- $result['goto_section'] = 'shipping_method';
 
 
 
 
 
 
 
117
  $result['update_section'] = array(
118
  'name' => 'shipping-method',
119
  'html' => $this->_getShippingMethodsHtml()
120
  );
 
121
  }else {
122
  $result['goto_section'] = 'discountcode';
123
  }
50
  return $output;
51
  }
52
 
53
+ /**
54
+ * Get shipping method step html
55
+ *
56
+ * @return string
57
+ */
58
+ protected function _getPaymentMethodsHtml()
59
+ {
60
+ $layout = $this->getLayout();
61
+ $update = $layout->getUpdate();
62
+ $update->load('checkout_onepage_paymentmethod');
63
+ $layout->generateXml();
64
+ $layout->generateBlocks();
65
+ $output = $layout->getOutput();
66
+ return $output;
67
+ }
68
+
69
  /**
70
  * Retrieve shopping cart model object
71
  *
128
  }
129
 
130
  if(!$result['error']) {
131
+ if ($this->getOnepage()->getQuote()->isVirtual()) {
132
+ $result['goto_section'] = 'payment';
133
+ $result['update_section'] = array(
134
+ 'name' => 'payment-method',
135
+ 'html' => $this->_getPaymentMethodsHtml()
136
+ );
137
+ }else{
138
+ $this->getOnepage()->getQuote()->getShippingAddress()->setCollectShippingRates(true);
139
+ $result['goto_section'] = 'shipping_method';
140
  $result['update_section'] = array(
141
  'name' => 'shipping-method',
142
  'html' => $this->_getShippingMethodsHtml()
143
  );
144
+ }
145
  }else {
146
  $result['goto_section'] = 'discountcode';
147
  }
app/design/frontend/{default → base}/default/layout/ves_checkoutdiscountcode.xml RENAMED
File without changes
app/design/frontend/{default → base}/default/template/ves_checkoutcouponcode/checkout/onepage/discountcode.phtml RENAMED
File without changes
app/design/frontend/{default → base}/default/template/ves_checkoutcouponcode/checkout/onepage/progress.phtml RENAMED
File without changes
package.xml CHANGED
@@ -1,18 +1,39 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Checkout_Discount_Code</name>
4
- <version>1.0.0.0</version>
5
  <stability>stable</stability>
6
- <license/>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Add discount code on onepage checkout page.</summary>
10
- <description>Add discount code on onepage checkout page.</description>
11
- <notes>Release extension</notes>
12
- <authors><author><name>Vnecoms</name><user>auto-converted</user><email>hungvt@vnecoms.com</email></author></authors>
13
- <date>2013-11-16</date>
14
- <time>05:01:25</time>
15
- <contents><target name="mageetc"><dir name="modules"><file name="VES_CheckoutDiscountCode.xml" hash="56f1dc648d258e3ec7f396598075d242"/></dir></target><target name="magecommunity"><dir name="VES"><dir name="CheckoutDiscountCode"><dir name="Block"><dir name="Checkout"><dir name="Onepage"><file name="Discountcode.php" hash="2db3b92a401d23903b32c5a33d94dd47"/><file name="Progress.php" hash="6661487caed5d43af6c691ed762e9629"/></dir><file name="Cart.php" hash="86895a529d2e71e9e7ffb17a6b31723e"/><file name="Onepage.php" hash="6da14079eaef0cf239f4ff89f1593203"/></dir></dir><dir name="Helper"><file name="Data.php" hash="bc58cc96c521e3c6e399d20e4abaa781"/></dir><dir name="Model"><file name="Observer.php" hash="04ac98a23a0855d444e63e245d6e3378"/></dir><dir name="controllers"><file name="IndexController.php" hash="be0b34b8e2d35f5bfba5ab9f603cff1b"/></dir><dir name="etc"><file name="config.xml" hash="45cf2f8fc325389081553792fac9e423"/><file name="system.xml" hash="d47956717c52a534a3a5b43803f743dc"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="ves_checkoutdiscountcode.xml" hash="04532dd09586b346ff36673b068f78cf"/></dir><dir name="template"><dir name="ves_checkoutcouponcode"><dir name="checkout"><dir name="onepage"><file name="discountcode.phtml" hash="6de8add389c0ce5a5aaa2e2a39eb6274"/><file name="progress.phtml" hash="9bbb74039a66f3397394e6be89db5536"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="ves_checkoutdiscountcode"><file name="checkout.js" hash="30e287511e6f459f600254f6c8b024ff"/></dir></dir></target></contents>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  <compatible/>
17
- <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Checkout_Discount_Code</name>
4
+ <version>1.0.0.1</version>
5
  <stability>stable</stability>
6
+ <license uri=" http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Add coupon code as a step of the checkout process</summary>
10
+ <description>This is &lt;a href="http://www.vnecoms.com/"&gt;Magento Extension&lt;/a&gt; which allow to add new step after Shipping Information step of your checkout process.&#xD;
11
+ &lt;h3&gt;Installation Instructions&lt;/h3&gt;&#xD;
12
+ &lt;strong&gt;1. Disable Compilation&lt;/strong&gt;&lt;br /&gt;&#xD;
13
+ Log into the Magento Admin Panel and go to System, Tools, Compilation. Then, disable the compilation, this will let you run the compilation process again.&lt;br /&gt;&#xD;
14
+ &lt;br /&gt;&#xD;
15
+ &lt;strong&gt;2. Install the Extension Extension, via Magento Connect &lt;/strong&gt;&lt;br /&gt;&#xD;
16
+ First, get the extension key from this page&#xD;
17
+ Then, go to System, Magento Connect, Magento Connect Manager and use your admin account to login again.&#xD;
18
+ Once you are logged in, paste the extension key in the field named &amp;quot;Paste extension key to install&amp;quot;, then click Install.&#xD;
19
+ After installation, click the Proceed button and the extension will be installed automatically.&lt;br /&gt;&#xD;
20
+ &lt;br /&gt;&#xD;
21
+ &lt;strong&gt;3. Clear Cache&lt;/strong&gt;&lt;br /&gt;&#xD;
22
+ After clearing the cache, logout and then log back into the Magento Admin Panel. After this step FuturePay will be successfully installed and ready for configuration.&lt;br /&gt;&#xD;
23
+ &lt;br /&gt;&#xD;
24
+ &lt;strong&gt;&lt;u&gt;Configure Extension&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&#xD;
25
+ 1. Go to System, Configuration. Then, from the left sideboard, click Checkout Discount Code under VNECOMS section.&lt;br /&gt;&#xD;
26
+ 2. Then, expand the General section.&lt;br /&gt;&#xD;
27
+ 3. Set the Enable module field to &amp;quot;Yes&amp;quot;.&lt;br /&gt;&#xD;
28
+ &lt;br /&gt;&#xD;
29
+ Congratulations! After completing this last step, you will be able to see new step on your checkout process.&lt;br /&gt;&lt;br /&gt;&#xD;
30
+ Boot your store by using &lt;a href="http://www.vnecoms.com"&gt;Magento Extensions&lt;/a&gt;, &lt;a href="http://www.vnecoms.com"&gt;Magento Modules&lt;/a&gt;, &lt;a href="http://www.vnecoms.com"&gt;Magento Service&lt;/a&gt; By VnEcoms.&lt;br /&gt;&#xD;
31
+ </description>
32
+ <notes>nothing</notes>
33
+ <authors><author><name>VnEcoms</name><user>vnecoms</user><email>hungvt@vnecoms.com</email></author></authors>
34
+ <date>2015-08-20</date>
35
+ <time>08:13:31</time>
36
+ <contents><target name="mageetc"><dir name="modules"><file name="VES_CheckoutDiscountCode.xml" hash="56f1dc648d258e3ec7f396598075d242"/></dir></target><target name="magecommunity"><dir name="VES"><dir name="CheckoutDiscountCode"><dir name="Block"><dir name="Checkout"><file name="Cart.php" hash="86895a529d2e71e9e7ffb17a6b31723e"/><dir name="Onepage"><file name="Discountcode.php" hash="2db3b92a401d23903b32c5a33d94dd47"/><file name="Progress.php" hash="f700e93a43286814691b4eac4701cb95"/></dir><file name="Onepage.php" hash="6da14079eaef0cf239f4ff89f1593203"/></dir></dir><dir name="Helper"><file name="Data.php" hash="bc58cc96c521e3c6e399d20e4abaa781"/></dir><dir name="Model"><file name="Observer.php" hash="5d528186090075d867b0f0f404e7597c"/></dir><dir name="controllers"><file name="IndexController.php" hash="55639cfc9101929924e79a6ad92e5899"/></dir><dir name="etc"><file name="config.xml" hash="45cf2f8fc325389081553792fac9e423"/><file name="system.xml" hash="d47956717c52a534a3a5b43803f743dc"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ves_checkoutdiscountcode.xml" hash="04532dd09586b346ff36673b068f78cf"/></dir><dir name="template"><dir name="ves_checkoutcouponcode"><dir name="checkout"><dir name="onepage"><file name="discountcode.phtml" hash="6de8add389c0ce5a5aaa2e2a39eb6274"/><file name="progress.phtml" hash="9bbb74039a66f3397394e6be89db5536"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="ves_checkoutdiscountcode"><file name="checkout.js" hash="30e287511e6f459f600254f6c8b024ff"/></dir></dir></target></contents>
37
  <compatible/>
38
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
39
  </package>