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 +1 -1
- app/code/community/VES/CheckoutDiscountCode/Model/Observer.php +15 -6
- app/code/community/VES/CheckoutDiscountCode/controllers/IndexController.php +26 -2
- app/design/frontend/{default → base}/default/layout/ves_checkoutdiscountcode.xml +0 -0
- app/design/frontend/{default → base}/default/template/ves_checkoutcouponcode/checkout/onepage/discountcode.phtml +0 -0
- app/design/frontend/{default → base}/default/template/ves_checkoutcouponcode/checkout/onepage/progress.phtml +0 -0
- package.xml +31 -10
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')
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
-
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.
|
| 5 |
<stability>stable</stability>
|
| 6 |
-
<license
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
-
<summary>Add
|
| 10 |
-
<description>
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 <a href="http://www.vnecoms.com/">Magento Extension</a> which allow to add new step after Shipping Information step of your checkout process.
|
| 11 |
+
<h3>Installation Instructions</h3>
|
| 12 |
+
<strong>1. Disable Compilation</strong><br />
|
| 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.<br />
|
| 14 |
+
<br />
|
| 15 |
+
<strong>2. Install the Extension Extension, via Magento Connect </strong><br />
|
| 16 |
+
First, get the extension key from this page
|
| 17 |
+
Then, go to System, Magento Connect, Magento Connect Manager and use your admin account to login again.
|
| 18 |
+
Once you are logged in, paste the extension key in the field named &quot;Paste extension key to install&quot;, then click Install.
|
| 19 |
+
After installation, click the Proceed button and the extension will be installed automatically.<br />
|
| 20 |
+
<br />
|
| 21 |
+
<strong>3. Clear Cache</strong><br />
|
| 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.<br />
|
| 23 |
+
<br />
|
| 24 |
+
<strong><u>Configure Extension</u></strong><br />
|
| 25 |
+
1. Go to System, Configuration. Then, from the left sideboard, click Checkout Discount Code under VNECOMS section.<br />
|
| 26 |
+
2. Then, expand the General section.<br />
|
| 27 |
+
3. Set the Enable module field to &quot;Yes&quot;.<br />
|
| 28 |
+
<br />
|
| 29 |
+
Congratulations! After completing this last step, you will be able to see new step on your checkout process.<br /><br />
|
| 30 |
+
Boot your store by using <a href="http://www.vnecoms.com">Magento Extensions</a>, <a href="http://www.vnecoms.com">Magento Modules</a>, <a href="http://www.vnecoms.com">Magento Service</a> By VnEcoms.<br />
|
| 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>
|
