Version Notes
Stable version 1.1.0 of "Customize Checkout Steps" extension.
Download this release
Release Info
Developer | Rajneesh Vyas |
Extension | 26e794300ae96a620bdec2bed0b7cc14 |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.1.0
- app/code/local/Sunarc/Skipcheckout/Helper/Data.php +27 -20
- app/code/local/Sunarc/Skipcheckout/Helper/Order.php +43 -34
- app/code/local/Sunarc/Skipcheckout/Helper/Url.php +49 -22
- app/code/local/Sunarc/Skipcheckout/Model/Observer.php +125 -114
- app/code/local/Sunarc/Skipcheckout/Model/System/Config/Source/Login/Step.php +20 -11
- app/code/local/Sunarc/Skipcheckout/Model/System/Config/Source/Payment/Enabledmethods.php +31 -22
- app/code/local/Sunarc/Skipcheckout/Model/System/Config/Source/Shipping/Enabledmethods.php +30 -21
- app/code/local/Sunarc/Skipcheckout/controllers/Adminhtml/SkipcheckoutController.php +15 -2
- app/code/local/Sunarc/Skipcheckout/controllers/OnepageController.php +316 -300
- app/code/local/Sunarc/Skipcheckout/etc/config.xml +1 -1
- app/code/local/Sunarc/Skipcheckout/sql/skipcheckout_setup/install-1.0.0.php +0 -5
- app/code/local/Sunarc/Skipcheckout/sql/skipcheckout_setup/install-1.1.0.php +13 -0
- app/design/frontend/base/default/template/sunarc/skipcheckout/onepage.phtml +11 -0
- package.xml +10 -11
app/code/local/Sunarc/Skipcheckout/Helper/Data.php
CHANGED
@@ -1,4 +1,13 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class Sunarc_Skipcheckout_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
{
|
4 |
const LOGIN_STEP_DEFAULT = 0;
|
@@ -53,7 +62,8 @@ class Sunarc_Skipcheckout_Helper_Data extends Mage_Core_Helper_Abstract
|
|
53 |
} // end
|
54 |
public function getCustomerGroupsEnabled()
|
55 |
{
|
56 |
-
$value =
|
|
|
57 |
return $value;
|
58 |
} // end
|
59 |
public function getShippingCustomerGroups()
|
@@ -61,7 +71,8 @@ class Sunarc_Skipcheckout_Helper_Data extends Mage_Core_Helper_Abstract
|
|
61 |
if ($this->getCustomerGroupsEnabled() == 0) {
|
62 |
return array();
|
63 |
} // end
|
64 |
-
$value =
|
|
|
65 |
$value = explode(',', $value);
|
66 |
return $value;
|
67 |
} // end
|
@@ -70,7 +81,8 @@ class Sunarc_Skipcheckout_Helper_Data extends Mage_Core_Helper_Abstract
|
|
70 |
if ($this->getCustomerGroupsEnabled() == 0) {
|
71 |
return array();
|
72 |
} // end
|
73 |
-
$value =
|
|
|
74 |
$value = explode(',', $value);
|
75 |
return $value;
|
76 |
} // end
|
@@ -88,8 +100,6 @@ class Sunarc_Skipcheckout_Helper_Data extends Mage_Core_Helper_Abstract
|
|
88 |
$groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
|
89 |
return $groupId;
|
90 |
//Get customer Group name
|
91 |
-
//$group = Mage::getModel('customer/group')->load($groupId);
|
92 |
-
//return $group->getCode();
|
93 |
} // end
|
94 |
return false;
|
95 |
} // end
|
@@ -100,14 +110,14 @@ class Sunarc_Skipcheckout_Helper_Data extends Mage_Core_Helper_Abstract
|
|
100 |
public function skipPaymentMethod()
|
101 |
{
|
102 |
$code = $this->getPaymentMethod();
|
103 |
-
$
|
104 |
-
$
|
105 |
switch ($code) {
|
106 |
case "noskip":
|
107 |
$return = false;
|
108 |
break;
|
109 |
default:
|
110 |
-
$return = $this->skipThisSection($
|
111 |
break;
|
112 |
} // end sw
|
113 |
return $return;
|
@@ -119,32 +129,29 @@ class Sunarc_Skipcheckout_Helper_Data extends Mage_Core_Helper_Abstract
|
|
119 |
public function skipShippingMethod()
|
120 |
{
|
121 |
$code = $this->getShippingMethod();
|
122 |
-
$
|
123 |
-
$
|
124 |
switch ($code) {
|
125 |
case "noskip":
|
126 |
$return = false;
|
127 |
break;
|
128 |
default:
|
129 |
-
$return = $this->skipThisSection($
|
130 |
break;
|
131 |
-
}
|
|
|
132 |
return $return;
|
133 |
} // end fun
|
134 |
/**
|
135 |
* Returns true if we should skip this section
|
136 |
*
|
137 |
-
* @param int $
|
138 |
-
* @param array $
|
139 |
*/
|
140 |
-
private function skipThisSection($
|
141 |
{
|
142 |
-
// var_dump($current_group);
|
143 |
-
// var_dump($noskip_groups);
|
144 |
-
// var_dump(is_array($noskip_groups));
|
145 |
-
// var_dump(array_search($current_group, $noskip_groups));
|
146 |
// if we find the current users groupid in the "dont skip" array, tell checkout not to skip this section
|
147 |
-
if ($
|
148 |
return false;
|
149 |
} // end
|
150 |
return true;
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*
|
5 |
+
* @category Sunarc
|
6 |
+
* @package Customize Checkout Steps-magento
|
7 |
+
* @author Sunarc Team <info@sunarctechnologies.com>
|
8 |
+
* @copyright Sunarc (http://sunarctechnologies.com/)
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
class Sunarc_Skipcheckout_Helper_Data extends Mage_Core_Helper_Abstract
|
12 |
{
|
13 |
const LOGIN_STEP_DEFAULT = 0;
|
62 |
} // end
|
63 |
public function getCustomerGroupsEnabled()
|
64 |
{
|
65 |
+
$value =
|
66 |
+
Mage::getStoreConfig('sunarc_skipcheckout_settings/skipcheckout_customergroups/customergroups_enabled');
|
67 |
return $value;
|
68 |
} // end
|
69 |
public function getShippingCustomerGroups()
|
71 |
if ($this->getCustomerGroupsEnabled() == 0) {
|
72 |
return array();
|
73 |
} // end
|
74 |
+
$value =
|
75 |
+
Mage::getStoreConfig('sunarc_skipcheckout_settings/skipcheckout_customergroups/shipping_noskip_customergroups');
|
76 |
$value = explode(',', $value);
|
77 |
return $value;
|
78 |
} // end
|
81 |
if ($this->getCustomerGroupsEnabled() == 0) {
|
82 |
return array();
|
83 |
} // end
|
84 |
+
$value =
|
85 |
+
Mage::getStoreConfig('sunarc_skipcheckout_settings/skipcheckout_customergroups/payment_noskip_customergroups');
|
86 |
$value = explode(',', $value);
|
87 |
return $value;
|
88 |
} // end
|
100 |
$groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
|
101 |
return $groupId;
|
102 |
//Get customer Group name
|
|
|
|
|
103 |
} // end
|
104 |
return false;
|
105 |
} // end
|
110 |
public function skipPaymentMethod()
|
111 |
{
|
112 |
$code = $this->getPaymentMethod();
|
113 |
+
$noskipGroups = $this->getPaymentCustomerGroups();
|
114 |
+
$currentGroup = $this->getCurrentCustomersGroup();
|
115 |
switch ($code) {
|
116 |
case "noskip":
|
117 |
$return = false;
|
118 |
break;
|
119 |
default:
|
120 |
+
$return = $this->skipThisSection($currentGroup, $noskipGroups);
|
121 |
break;
|
122 |
} // end sw
|
123 |
return $return;
|
129 |
public function skipShippingMethod()
|
130 |
{
|
131 |
$code = $this->getShippingMethod();
|
132 |
+
$noskipGroups = $this->getShippingCustomerGroups();
|
133 |
+
$currentGroup = $this->getCurrentCustomersGroup();
|
134 |
switch ($code) {
|
135 |
case "noskip":
|
136 |
$return = false;
|
137 |
break;
|
138 |
default:
|
139 |
+
$return = $this->skipThisSection($currentGroup, $noskipGroups);
|
140 |
break;
|
141 |
+
}
|
142 |
+
|
143 |
return $return;
|
144 |
} // end fun
|
145 |
/**
|
146 |
* Returns true if we should skip this section
|
147 |
*
|
148 |
+
* @param int $currentGroup customers group id
|
149 |
+
* @param array $noskipGroups array of groupid's
|
150 |
*/
|
151 |
+
private function skipThisSection($currentGroup, $noskipGroups)
|
152 |
{
|
|
|
|
|
|
|
|
|
153 |
// if we find the current users groupid in the "dont skip" array, tell checkout not to skip this section
|
154 |
+
if ($currentGroup !== false && is_array($noskipGroups) && array_search($currentGroup, $noskipGroups) > -1) {
|
155 |
return false;
|
156 |
} // end
|
157 |
return true;
|
app/code/local/Sunarc/Skipcheckout/Helper/Order.php
CHANGED
@@ -1,34 +1,43 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
$
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
$order
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*
|
5 |
+
* @category Sunarc
|
6 |
+
* @package Customize Checkout Steps-magento
|
7 |
+
* @author Sunarc Team <info@sunarctechnologies.com>
|
8 |
+
* @copyright Sunarc (http://sunarctechnologies.com/)
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
class Sunarc_Skipcheckout_Helper_Order extends Mage_Core_Helper_Abstract
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* We use this during the user signup phase.
|
15 |
+
* @var string
|
16 |
+
*/
|
17 |
+
public $sessionKey = 'skipcheckout_register_key';
|
18 |
+
public function getSessionKey()
|
19 |
+
{
|
20 |
+
return $this->sessionKey;
|
21 |
+
} // end
|
22 |
+
public function getOrder()
|
23 |
+
{
|
24 |
+
//get the order id from the session
|
25 |
+
$session = Mage::getSingleton('checkout/session');
|
26 |
+
$lastOrderId = $session->getLastOrderId();
|
27 |
+
// load the order
|
28 |
+
$order = Mage::getSingleton('sales/order');
|
29 |
+
$order->load($lastOrderId);
|
30 |
+
return $order;
|
31 |
+
} // end
|
32 |
+
/**
|
33 |
+
*
|
34 |
+
* @return Ambigous <mixed, unknown, multitype:>
|
35 |
+
*/
|
36 |
+
public function getEmail()
|
37 |
+
{
|
38 |
+
$order = $this->getOrder();
|
39 |
+
// get the orders email address
|
40 |
+
$email = $order->getCustomerEmail();
|
41 |
+
return $email;
|
42 |
+
} // end
|
43 |
+
}
|
app/code/local/Sunarc/Skipcheckout/Helper/Url.php
CHANGED
@@ -1,73 +1,100 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class Sunarc_Skipcheckout_Helper_Url extends Mage_Core_Helper_Abstract
|
3 |
{
|
4 |
-
protected $
|
5 |
/**
|
6 |
* Returns a true/false if the current page is https or not
|
7 |
* @return boolean
|
8 |
*/
|
9 |
public function getIsSecure()
|
10 |
{
|
11 |
-
if ($this->
|
12 |
-
$this->
|
13 |
} // end if
|
14 |
-
return $this->
|
15 |
} // end
|
16 |
/**
|
17 |
*
|
18 |
*/
|
19 |
public function getProgressUrl()
|
20 |
{
|
21 |
-
return Mage::getUrl(
|
|
|
22 |
"_secure" => $this->getIsSecure()
|
23 |
-
|
|
|
24 |
} // end
|
25 |
public function getReviewUrl()
|
26 |
{
|
27 |
-
return Mage::getUrl(
|
|
|
28 |
"_secure" => $this->getIsSecure()
|
29 |
-
|
|
|
30 |
} // end
|
31 |
public function getSaveMethodUrl()
|
32 |
{
|
33 |
-
return Mage::getUrl(
|
|
|
34 |
"_secure" => $this->getIsSecure()
|
35 |
-
|
|
|
36 |
}
|
37 |
public function getFailureUrl()
|
38 |
{
|
39 |
-
return Mage::getUrl(
|
|
|
40 |
"_secure" => $this->getIsSecure()
|
41 |
-
|
|
|
42 |
}
|
43 |
public function getAddressUrl()
|
44 |
{
|
45 |
-
return Mage::getUrl(
|
|
|
46 |
"_secure" => $this->getIsSecure()
|
47 |
-
|
|
|
48 |
} // end
|
49 |
public function getSaveBillingUrl()
|
50 |
{
|
51 |
-
return Mage::getUrl(
|
|
|
52 |
"_secure" => $this->getIsSecure()
|
53 |
-
|
|
|
54 |
} // end
|
55 |
public function getSaveShippingUrl()
|
56 |
{
|
57 |
-
return Mage::getUrl(
|
|
|
58 |
"_secure" => $this->getIsSecure()
|
59 |
-
|
|
|
60 |
}
|
61 |
public function getSaveShippingMethod()
|
62 |
{
|
63 |
-
return Mage::getUrl(
|
|
|
64 |
"_secure" => $this->getIsSecure()
|
65 |
-
|
|
|
66 |
}
|
67 |
public function getSavePaymentUrl()
|
68 |
{
|
69 |
-
return Mage::getUrl(
|
|
|
70 |
"_secure" => $this->getIsSecure()
|
71 |
-
|
|
|
72 |
}
|
73 |
} // end class
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*
|
5 |
+
* @category Sunarc
|
6 |
+
* @package Customize Checkout Steps-magento
|
7 |
+
* @author Sunarc Team <info@sunarctechnologies.com>
|
8 |
+
* @copyright Sunarc (http://sunarctechnologies.com/)
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
class Sunarc_Skipcheckout_Helper_Url extends Mage_Core_Helper_Abstract
|
12 |
{
|
13 |
+
protected $_isSecure;
|
14 |
/**
|
15 |
* Returns a true/false if the current page is https or not
|
16 |
* @return boolean
|
17 |
*/
|
18 |
public function getIsSecure()
|
19 |
{
|
20 |
+
if ($this->_isSecure == null) {
|
21 |
+
$this->_isSecure = Mage::app()->getStore()->isCurrentlySecure();
|
22 |
} // end if
|
23 |
+
return $this->_isSecure;
|
24 |
} // end
|
25 |
/**
|
26 |
*
|
27 |
*/
|
28 |
public function getProgressUrl()
|
29 |
{
|
30 |
+
return Mage::getUrl(
|
31 |
+
'skipcheckout/onepage/progress', array(
|
32 |
"_secure" => $this->getIsSecure()
|
33 |
+
)
|
34 |
+
);
|
35 |
} // end
|
36 |
public function getReviewUrl()
|
37 |
{
|
38 |
+
return Mage::getUrl(
|
39 |
+
'skipcheckout/onepage/review', array(
|
40 |
"_secure" => $this->getIsSecure()
|
41 |
+
)
|
42 |
+
);
|
43 |
} // end
|
44 |
public function getSaveMethodUrl()
|
45 |
{
|
46 |
+
return Mage::getUrl(
|
47 |
+
'skipcheckout/onepage/saveMethod', array(
|
48 |
"_secure" => $this->getIsSecure()
|
49 |
+
)
|
50 |
+
);
|
51 |
}
|
52 |
public function getFailureUrl()
|
53 |
{
|
54 |
+
return Mage::getUrl(
|
55 |
+
'checkout/cart', array(
|
56 |
"_secure" => $this->getIsSecure()
|
57 |
+
)
|
58 |
+
);
|
59 |
}
|
60 |
public function getAddressUrl()
|
61 |
{
|
62 |
+
return Mage::getUrl(
|
63 |
+
'skipcheckout/onepage/getAddress', array(
|
64 |
"_secure" => $this->getIsSecure()
|
65 |
+
)
|
66 |
+
);
|
67 |
} // end
|
68 |
public function getSaveBillingUrl()
|
69 |
{
|
70 |
+
return Mage::getUrl(
|
71 |
+
'skipcheckout/onepage/saveBilling', array(
|
72 |
"_secure" => $this->getIsSecure()
|
73 |
+
)
|
74 |
+
);
|
75 |
} // end
|
76 |
public function getSaveShippingUrl()
|
77 |
{
|
78 |
+
return Mage::getUrl(
|
79 |
+
'skipcheckout/onepage/saveShipping', array(
|
80 |
"_secure" => $this->getIsSecure()
|
81 |
+
)
|
82 |
+
);
|
83 |
}
|
84 |
public function getSaveShippingMethod()
|
85 |
{
|
86 |
+
return Mage::getUrl(
|
87 |
+
'skipcheckout/onepage/saveShippingMethod', array(
|
88 |
"_secure" => $this->getIsSecure()
|
89 |
+
)
|
90 |
+
);
|
91 |
}
|
92 |
public function getSavePaymentUrl()
|
93 |
{
|
94 |
+
return Mage::getUrl(
|
95 |
+
'skipcheckout/onepage/savePayment', array(
|
96 |
"_secure" => $this->getIsSecure()
|
97 |
+
)
|
98 |
+
);
|
99 |
}
|
100 |
} // end class
|
app/code/local/Sunarc/Skipcheckout/Model/Observer.php
CHANGED
@@ -1,114 +1,125 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
*
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
$this->getUpdate()->addHandle('
|
48 |
-
} // end
|
49 |
-
} // end
|
50 |
-
/**
|
51 |
-
* Adds the Handle "
|
52 |
-
* @see app/design/frontend/base/default/layout/sunarc/skipcheckout/skipcheckout.xml
|
53 |
-
*/
|
54 |
-
protected function
|
55 |
-
{
|
56 |
-
// should we remove the
|
57 |
-
if (Mage::helper('sunarc_skipcheckout/data')->
|
58 |
-
$this->getUpdate()->addHandle('
|
59 |
-
} // end
|
60 |
-
} // end
|
61 |
-
/**
|
62 |
-
* Adds the Handle "
|
63 |
-
* @see app/design/frontend/base/default/layout/sunarc/skipcheckout/skipcheckout.xml
|
64 |
-
*/
|
65 |
-
protected function
|
66 |
-
{
|
67 |
-
//
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
} // end
|
81 |
-
/**
|
82 |
-
* Returns true if the
|
83 |
-
* @return boolean
|
84 |
-
*/
|
85 |
-
protected function
|
86 |
-
{
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
//
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*
|
5 |
+
* @category Sunarc
|
6 |
+
* @package Customize Checkout Steps-magento
|
7 |
+
* @author Sunarc Team <info@sunarctechnologies.com>
|
8 |
+
* @copyright Sunarc (http://sunarctechnologies.com/)
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
class Sunarc_Skipcheckout_Model_Observer extends Mage_Core_Model_Observer
|
12 |
+
{
|
13 |
+
public function checkSkipCheckout(Varien_Event_Observer $observer)
|
14 |
+
{
|
15 |
+
// exit now if reduced checkout is not enabled or this is not checkout_onepage_index
|
16 |
+
if ($this->isSkipCheckoutEnabled() == false) {
|
17 |
+
return;
|
18 |
+
}
|
19 |
+
|
20 |
+
$handles = $observer->getEvent()->getLayout()->getUpdate()->getHandles();
|
21 |
+
$this->_update = $observer->getEvent()->getLayout()->getUpdate();
|
22 |
+
// find the handle we're looking for
|
23 |
+
if (array_search('checkout_onepage_index', $handles) == true) {
|
24 |
+
$this->_update->addHandle('sunarc_checkout_skip');
|
25 |
+
$this->_loginStepHandle();
|
26 |
+
$this->_paymentStepHandle();
|
27 |
+
$this->_shippingStepHandle();
|
28 |
+
$this->_telephoneFaxHandle();
|
29 |
+
return;
|
30 |
+
} // end
|
31 |
+
// find the handle we're looking for
|
32 |
+
if (array_search('customer_address_form', $handles) == true) {
|
33 |
+
$this->_telephoneFaxHandle();
|
34 |
+
return;
|
35 |
+
} // end
|
36 |
+
return;
|
37 |
+
} // end
|
38 |
+
/**
|
39 |
+
* Adds the handle "sunarc_checkout_skip_forceguestonly"
|
40 |
+
* @see app/design/frontend/base/default/layout/sunarc/skipcheckout/skipcheckout.xml
|
41 |
+
*/
|
42 |
+
protected function _loginStepHandle()
|
43 |
+
{
|
44 |
+
// should we remove the login step..
|
45 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()
|
46 |
+
== false && Mage::helper('sunarc_skipcheckout/data')->isLoginStepGuestOnly() == true) {
|
47 |
+
$this->getUpdate()->addHandle('sunarc_checkout_skip_forceguestonly');
|
48 |
+
} // end
|
49 |
+
} // end
|
50 |
+
/**
|
51 |
+
* Adds the Handle "sunarc_checkout_skip_skip_shippingmethod"
|
52 |
+
* @see app/design/frontend/base/default/layout/sunarc/skipcheckout/skipcheckout.xml
|
53 |
+
*/
|
54 |
+
protected function _paymentStepHandle()
|
55 |
+
{
|
56 |
+
// should we remove the payment method step..
|
57 |
+
if (Mage::helper('sunarc_skipcheckout/data')->skipShippingMethod() == true) {
|
58 |
+
$this->getUpdate()->addHandle('sunarc_checkout_skip_skip_shippingmethod');
|
59 |
+
} // end
|
60 |
+
} // end
|
61 |
+
/**
|
62 |
+
* Adds the Handle "sunarc_checkout_skip_skip_paymentmethod"
|
63 |
+
* @see app/design/frontend/base/default/layout/sunarc/skipcheckout/skipcheckout.xml
|
64 |
+
*/
|
65 |
+
protected function _shippingStepHandle()
|
66 |
+
{
|
67 |
+
// should we remove the shipping method step..
|
68 |
+
if (Mage::helper('sunarc_skipcheckout/data')->skipPaymentMethod() == true) {
|
69 |
+
$this->getUpdate()->addHandle('sunarc_checkout_skip_skip_paymentmethod');
|
70 |
+
} // end
|
71 |
+
} // end
|
72 |
+
/**
|
73 |
+
* Adds the Handle "sunarc_checkout_skip_hide_telephonefax"
|
74 |
+
* @see app/design/frontend/base/default/layout/sunarc/skipcheckout/skipcheckout.xml
|
75 |
+
*/
|
76 |
+
protected function _telephoneFaxHandle()
|
77 |
+
{
|
78 |
+
// hide the telphone input fields
|
79 |
+
// end
|
80 |
+
} // end
|
81 |
+
/**
|
82 |
+
* Returns true if the the user is not logged in and email doesn't already exist.
|
83 |
+
* @return boolean
|
84 |
+
*/
|
85 |
+
protected function _isValidGuest()
|
86 |
+
{
|
87 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn() || $this->_customerExists()) {
|
88 |
+
return false;
|
89 |
+
} // end
|
90 |
+
return true;
|
91 |
+
} // end
|
92 |
+
/**
|
93 |
+
* Returns true if the last order's email address already exists
|
94 |
+
* @return boolean
|
95 |
+
*/
|
96 |
+
protected function _customerExists()
|
97 |
+
{
|
98 |
+
$helper = Mage::helper('sunarc_skipcheckout/order');
|
99 |
+
$email = $helper->getEmail();
|
100 |
+
$customer = Mage::getSingleton('customer/customer')->setStore(Mage::app()->getStore())->loadByEmail($email);
|
101 |
+
if ($customer->getId()) {
|
102 |
+
return true;
|
103 |
+
} // end
|
104 |
+
return false;
|
105 |
+
} // end
|
106 |
+
/**
|
107 |
+
* Returns true if Reduced Checkout is Enabled in the Admin Configuration
|
108 |
+
*
|
109 |
+
* @return boolean
|
110 |
+
*/
|
111 |
+
protected function isSkipCheckoutEnabled()
|
112 |
+
{
|
113 |
+
$enabled = Mage::getStoreConfig('sunarc_skipcheckout_settings/skipcheckout/isenabled');
|
114 |
+
// return early if we're not enabled
|
115 |
+
if ($enabled != true) {
|
116 |
+
return false;
|
117 |
+
} // end
|
118 |
+
return true;
|
119 |
+
} // end
|
120 |
+
protected function getUpdate()
|
121 |
+
{
|
122 |
+
return $this->_update;
|
123 |
+
} // end
|
124 |
+
} // end
|
125 |
+
|
app/code/local/Sunarc/Skipcheckout/Model/System/Config/Source/Login/Step.php
CHANGED
@@ -1,11 +1,20 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*
|
5 |
+
* @category Sunarc
|
6 |
+
* @package Customize Checkout Steps-magento
|
7 |
+
* @author Sunarc Team <info@sunarctechnologies.com>
|
8 |
+
* @copyright Sunarc (http://sunarctechnologies.com/)
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
class Sunarc_Skipcheckout_Model_System_Config_Source_Login_Step
|
12 |
+
{
|
13 |
+
public function toOptionArray()
|
14 |
+
{
|
15 |
+
return array(
|
16 |
+
"0" => "Default Magento login",
|
17 |
+
"1" => "Skip Magento Login"
|
18 |
+
);
|
19 |
+
} // end
|
20 |
+
}
|
app/code/local/Sunarc/Skipcheckout/Model/System/Config/Source/Payment/Enabledmethods.php
CHANGED
@@ -1,22 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*
|
5 |
+
* @category Sunarc
|
6 |
+
* @package Customize Checkout Steps-magento
|
7 |
+
* @author Sunarc Team <info@sunarctechnologies.com>
|
8 |
+
* @copyright Sunarc (http://sunarctechnologies.com/)
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
class Sunarc_Skipcheckout_Model_System_Config_Source_Payment_Enabledmethods
|
12 |
+
{
|
13 |
+
public function toOptionArray()
|
14 |
+
{
|
15 |
+
$activeMethods = Mage::getSingleton('payment/config')->getActiveMethods();
|
16 |
+
$methods = array();
|
17 |
+
$methods['noskip'] = Mage::helper('sunarc_skipcheckout')->__("Do not skip [Default]");
|
18 |
+
foreach ($activeMethods as $code => $value) {
|
19 |
+
switch ($code) {
|
20 |
+
// we can't skip this method so make sure its not added to the array
|
21 |
+
case "ccsave":
|
22 |
+
break;
|
23 |
+
default:
|
24 |
+
$label = Mage::getStoreConfig('payment/' . $code . '/title');
|
25 |
+
$methods[$code] = $label;
|
26 |
+
break;
|
27 |
+
} // end
|
28 |
+
} // end
|
29 |
+
return $methods;
|
30 |
+
} // end fun
|
31 |
+
} // end class
|
app/code/local/Sunarc/Skipcheckout/Model/System/Config/Source/Shipping/Enabledmethods.php
CHANGED
@@ -1,21 +1,30 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*
|
5 |
+
* @category Sunarc
|
6 |
+
* @package Customize Checkout Steps-magento
|
7 |
+
* @author Sunarc Team <info@sunarctechnologies.com>
|
8 |
+
* @copyright Sunarc (http://sunarctechnologies.com/)
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
class Sunarc_Skipcheckout_Model_System_Config_Source_Shipping_Enabledmethods
|
12 |
+
{
|
13 |
+
public function toOptionArray()
|
14 |
+
{
|
15 |
+
$activeCarriers = Mage::getSingleton('shipping/config')->getActiveCarriers();
|
16 |
+
$carrierMethods = array();
|
17 |
+
$carrierMethods['noskip'] = Mage::helper('sunarc_skipcheckout')->__("Do not skip [Default]");
|
18 |
+
foreach ($activeCarriers as $code => $carrier) {
|
19 |
+
$label = Mage::getStoreConfig('carriers/' . $code . '/title');
|
20 |
+
$enabled = Mage::getStoreConfig('carriers/' . $code . '/active');
|
21 |
+
$methods = $carrier->getAllowedMethods();
|
22 |
+
foreach ($methods as $methodCode => $methodLabel) {
|
23 |
+
if ($label != null && $enabled == 1) {
|
24 |
+
$carrierMethods[$code . '_' . $methodCode] = $label . " [" . $methodLabel . "]";
|
25 |
+
} // end
|
26 |
+
}
|
27 |
+
} // end
|
28 |
+
return $carrierMethods;
|
29 |
+
} // end fun
|
30 |
+
} // end class
|
app/code/local/Sunarc/Skipcheckout/controllers/Adminhtml/SkipcheckoutController.php
CHANGED
@@ -1,13 +1,27 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class Sunarc_Skipcheckout_Adminhtml_SkipcheckoutController extends Mage_Adminhtml_Controller_Action
|
3 |
{
|
4 |
/**
|
5 |
*
|
6 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
public function issecureenabledAction()
|
8 |
{
|
9 |
$value = Mage::getStoreConfig('web/secure/base_url', Mage::app()->getStore());
|
10 |
-
echo $value;
|
11 |
return;
|
12 |
} // end
|
13 |
/**
|
@@ -24,7 +38,6 @@ class Sunarc_Skipcheckout_Adminhtml_SkipcheckoutController extends Mage_Adminhtm
|
|
24 |
$value = 'Disabled';
|
25 |
break;
|
26 |
} // end
|
27 |
-
echo $value;
|
28 |
return;
|
29 |
} // end
|
30 |
} // end
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*
|
5 |
+
* @category Sunarc
|
6 |
+
* @package Customize Checkout Steps-magento
|
7 |
+
* @author Sunarc Team <info@sunarctechnologies.com>
|
8 |
+
* @copyright Sunarc (http://sunarctechnologies.com/)
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
class Sunarc_Skipcheckout_Adminhtml_SkipcheckoutController extends Mage_Adminhtml_Controller_Action
|
12 |
{
|
13 |
/**
|
14 |
*
|
15 |
*/
|
16 |
+
protected function _isAllowed()
|
17 |
+
{
|
18 |
+
return Mage::getSingleton('admin/session')->isAllowed('sunarc/skipcheckout/sunarc_skipcheckout_settings');
|
19 |
+
//or at least
|
20 |
+
|
21 |
+
}
|
22 |
public function issecureenabledAction()
|
23 |
{
|
24 |
$value = Mage::getStoreConfig('web/secure/base_url', Mage::app()->getStore());
|
|
|
25 |
return;
|
26 |
} // end
|
27 |
/**
|
38 |
$value = 'Disabled';
|
39 |
break;
|
40 |
} // end
|
|
|
41 |
return;
|
42 |
} // end
|
43 |
} // end
|
app/code/local/Sunarc/Skipcheckout/controllers/OnepageController.php
CHANGED
@@ -1,300 +1,316 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
/**
|
17 |
-
* (non-PHPdoc)
|
18 |
-
* @see
|
19 |
-
*/
|
20 |
-
public function
|
21 |
-
{
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
//
|
68 |
-
|
69 |
-
$this->
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
));
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
if ($
|
90 |
-
|
91 |
-
} // end if
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
if
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
} // end if
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
$this->
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
if ($
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
*
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
*
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
$
|
215 |
-
|
216 |
-
$
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
} // end
|
221 |
-
/**
|
222 |
-
*
|
223 |
-
*
|
224 |
-
* @
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
$result['
|
261 |
-
'
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
$result['
|
276 |
-
|
277 |
-
'
|
278 |
-
);
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
)
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*
|
5 |
+
* @category Sunarc
|
6 |
+
* @package Customize Checkout Steps-magento
|
7 |
+
* @author Sunarc Team <info@sunarctechnologies.com>
|
8 |
+
* @copyright Sunarc (http://sunarctechnologies.com/)
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
require_once "Mage/Checkout/controllers/OnepageController.php";
|
12 |
+
class Sunarc_Skipcheckout_OnepageController extends Mage_Checkout_OnepageController
|
13 |
+
{
|
14 |
+
public $layout;
|
15 |
+
protected $_helper;
|
16 |
+
/**
|
17 |
+
* (non-PHPdoc)
|
18 |
+
* @see Mage_Core_Controller_Varien_Action::_construct()
|
19 |
+
*/
|
20 |
+
public function _construct()
|
21 |
+
{
|
22 |
+
parent::_construct();
|
23 |
+
$this->_helper = Mage::helper('sunarc_skipcheckout');
|
24 |
+
} // end
|
25 |
+
/**
|
26 |
+
* (non-PHPdoc)
|
27 |
+
* @see Mage_Checkout_OnepageController::saveMethodAction()
|
28 |
+
*/
|
29 |
+
public function saveMethodAction()
|
30 |
+
{
|
31 |
+
if ($this->_expireAjax()) {
|
32 |
+
return;
|
33 |
+
} // end if
|
34 |
+
// set the checkout method
|
35 |
+
if ($this->getRequest()->isPost()) {
|
36 |
+
$method = $this->getCheckoutMethod();
|
37 |
+
$result = $this->getOnepage()->saveCheckoutMethod($method);
|
38 |
+
} // end if
|
39 |
+
} // end if
|
40 |
+
/**
|
41 |
+
* Checks the System > Configuration Setting for this extension and sets the
|
42 |
+
* CheckoutMethod as appropriate
|
43 |
+
*
|
44 |
+
* @return Ambigous <mixed, unknown>
|
45 |
+
*/
|
46 |
+
private function getCheckoutMethod()
|
47 |
+
{
|
48 |
+
switch ($this->_helper->isLoginStepGuestOnly()) {
|
49 |
+
case true:
|
50 |
+
$method = "guest";
|
51 |
+
break;
|
52 |
+
default:
|
53 |
+
$method = $this->getRequest()->getPost('method');
|
54 |
+
break;
|
55 |
+
} // end
|
56 |
+
return $method;
|
57 |
+
} /// end
|
58 |
+
/**
|
59 |
+
* (non-PHPdoc)
|
60 |
+
* @see Mage_Checkout_OnepageController::saveShippingMethodAction()
|
61 |
+
* $gotonext = false forces the method not to go to the next section and return to the calling method
|
62 |
+
*/
|
63 |
+
public function saveShippingMethodAction($gotonext = true)
|
64 |
+
{
|
65 |
+
if ($this->_expireAjax()) {
|
66 |
+
return;
|
67 |
+
} // end if
|
68 |
+
// this is the default way
|
69 |
+
$shipping = $this->getRequest()->getPost('shipping_method', '');
|
70 |
+
// override the default value if we need to
|
71 |
+
if ($this->_helper->skipShippingMethod() == true) {
|
72 |
+
$shipping = $this->_helper->getShippingMethod();
|
73 |
+
} // end if
|
74 |
+
// set the shipping method
|
75 |
+
$result = $this->getOnepage()->saveShippingMethod($shipping);
|
76 |
+
// calculations for the checkout totals
|
77 |
+
$this->getOnepage()->getQuote()->collectTotals();
|
78 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
79 |
+
$this->getOnepage()->getQuote()->collectTotals()->save();
|
80 |
+
// save shipping method event
|
81 |
+
Mage::dispatchEvent(
|
82 |
+
'checkout_controller_onepage_save_shipping_method', array(
|
83 |
+
'request' => $this->getRequest(),
|
84 |
+
'quote' => $this->getOnepage()->getQuote()
|
85 |
+
)
|
86 |
+
);
|
87 |
+
$this->getOnepage()->getQuote()->setTotalsCollectedFlag(false);
|
88 |
+
// attempt to load the next section
|
89 |
+
if ($gotonext == true) {
|
90 |
+
$result = $this->getNextSection($result, $current = 'shippingmethod');
|
91 |
+
} // end if
|
92 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
93 |
+
} // end
|
94 |
+
/**
|
95 |
+
* (non-PHPdoc)
|
96 |
+
* @see Mage_Checkout_OnepageController::savePaymentAction()
|
97 |
+
*/
|
98 |
+
public function savePaymentAction($gotonext = true)
|
99 |
+
{
|
100 |
+
if ($this->_expireAjax()) {
|
101 |
+
return;
|
102 |
+
} // end if
|
103 |
+
if (!$this->getRequest()->isPost()) {
|
104 |
+
$this->_ajaxRedirectResponse();
|
105 |
+
return;
|
106 |
+
}
|
107 |
+
|
108 |
+
// this is the default way
|
109 |
+
$data = $this->getRequest()->getPost('payment', array());
|
110 |
+
// override the default value if we need to
|
111 |
+
if ($this->_helper->skipPaymentMethod() == true) {
|
112 |
+
$payment = $this->_helper->getPaymentMethod();
|
113 |
+
$data = array(
|
114 |
+
'method' => $payment
|
115 |
+
);
|
116 |
+
} // end if
|
117 |
+
// start forming the JSON result
|
118 |
+
$result = $this->getOnepage()->savePayment($data);
|
119 |
+
// get section and redirect data
|
120 |
+
$redirectUrl = $this->getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();
|
121 |
+
// if the redirect URL has been set in this step then make it visibile for the entire Checkout object
|
122 |
+
if ($redirectUrl) {
|
123 |
+
$this->getOnepage()->getCheckout()->setRedirectUrl($redirectUrl);
|
124 |
+
}
|
125 |
+
|
126 |
+
// attempt to load the next section
|
127 |
+
if ($gotonext == true) {
|
128 |
+
$result = $this->getNextSection($result, $current = 'payment');
|
129 |
+
} // end if
|
130 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
131 |
+
} // end
|
132 |
+
/**
|
133 |
+
* (non-PHPdoc)
|
134 |
+
* @see Mage_Checkout_OnepageController::saveShippingAction()
|
135 |
+
*/
|
136 |
+
public function saveShippingAction($gotonext = true)
|
137 |
+
{
|
138 |
+
if ($this->_expireAjax()) {
|
139 |
+
return;
|
140 |
+
}
|
141 |
+
|
142 |
+
if ($this->getRequest()->isPost()) {
|
143 |
+
$data = $this->getRequest()->getPost('shipping', array());
|
144 |
+
$customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);
|
145 |
+
// save the billing address info
|
146 |
+
$result = $this->getOnepage()->saveShipping($data, $customerAddressId);
|
147 |
+
} // end
|
148 |
+
// attempt to load the next section
|
149 |
+
if ($gotonext == true) {
|
150 |
+
$result = $this->getNextSection($result, $current = 'billing');
|
151 |
+
} // end if
|
152 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
153 |
+
} // end
|
154 |
+
/**
|
155 |
+
* (non-PHPdoc)
|
156 |
+
* @see Mage_Checkout_OnepageController::saveBillingAction()
|
157 |
+
*/
|
158 |
+
public function saveBillingAction()
|
159 |
+
{
|
160 |
+
if ($this->_expireAjax()) {
|
161 |
+
return;
|
162 |
+
}
|
163 |
+
|
164 |
+
if ($this->getRequest()->isPost()) {
|
165 |
+
if ($this->_helper->isLoginStepGuestOnly() == true) {
|
166 |
+
// set the checkout method
|
167 |
+
$this->saveMethodAction();
|
168 |
+
} // end if
|
169 |
+
$data = $this->getRequest()->getPost('billing', array());
|
170 |
+
$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);
|
171 |
+
if (isset($data['email'])) {
|
172 |
+
$data['email'] = trim($data['email']);
|
173 |
+
} // end if
|
174 |
+
// save the billing address info
|
175 |
+
$result = $this->getOnepage()->saveBilling($data, $customerAddressId);
|
176 |
+
// render the onepage review
|
177 |
+
if (!isset($result['error'])) {
|
178 |
+
/* check quote for virtual */
|
179 |
+
if ($this->getOnepage()->getQuote()->isVirtual()) {
|
180 |
+
// find out which section we should go to next
|
181 |
+
$result = $this->getNextSection($result, $current = 'billing');
|
182 |
+
} elseif (isset($data['use_for_shipping']) && $data['use_for_shipping'] == 1) {
|
183 |
+
// find out which section we should go to next
|
184 |
+
$result = $this->getNextSection($result, $current = 'billing');
|
185 |
+
$result['duplicateBillingInfo'] = 'true';
|
186 |
+
} else {
|
187 |
+
// go to the shipping section
|
188 |
+
$result['goto_section'] = 'shipping';
|
189 |
+
} // end if
|
190 |
+
} // end
|
191 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
192 |
+
}
|
193 |
+
} // end
|
194 |
+
/**
|
195 |
+
* (non-PHPdoc)
|
196 |
+
* @see Mage_Checkout_OnepageController::_getReviewHtml()
|
197 |
+
*/
|
198 |
+
protected function _getReviewHtml()
|
199 |
+
{
|
200 |
+
$layout = $this->getLayout();
|
201 |
+
$update = $layout->getUpdate();
|
202 |
+
$update->merge('checkout_onepage_review');
|
203 |
+
$layout->generateXml();
|
204 |
+
$layout->generateBlocks();
|
205 |
+
$output = $layout->getBlock('root')->toHtml();
|
206 |
+
return $output;
|
207 |
+
} // end
|
208 |
+
/**
|
209 |
+
* (non-PHPdoc)
|
210 |
+
* @see Mage_Checkout_OnepageController::progressAction()
|
211 |
+
*/
|
212 |
+
public function progressAction()
|
213 |
+
{
|
214 |
+
$versionArray = Mage::getVersionInfo();
|
215 |
+
// Quick fix Magento 1.8 and pre 1.8 have different methods to generate the right hand progress bar.
|
216 |
+
if ($versionArray['major'] == 1 && $versionArray['minor'] < 8) {
|
217 |
+
return $this->preV8ProgressAction();
|
218 |
+
} // end
|
219 |
+
return parent::progressAction();
|
220 |
+
} // end
|
221 |
+
/**
|
222 |
+
* Quick fix Magento 1.8 and pre 1.8 have different methods to generate the right hand progress bar.
|
223 |
+
* This method runs if magento 1.7 or older is being used.
|
224 |
+
* @return string
|
225 |
+
*/
|
226 |
+
protected function preV8ProgressAction()
|
227 |
+
{
|
228 |
+
$layout = $this->getLayout();
|
229 |
+
$update = $layout->getUpdate();
|
230 |
+
$update->load('checkout_onepage_progress');
|
231 |
+
$layout->generateXml();
|
232 |
+
$layout->generateBlocks();
|
233 |
+
$output = $layout->getOutput();
|
234 |
+
$this->renderLayout();
|
235 |
+
} // end
|
236 |
+
/**
|
237 |
+
* Returns html for the next step to display depending on logic set in the System > Configuration
|
238 |
+
*
|
239 |
+
* @param array $result
|
240 |
+
* @param string $current Current step code
|
241 |
+
* @return multitype:string html <string, unknown>
|
242 |
+
*/
|
243 |
+
private function getNextSection($result, $current)
|
244 |
+
{
|
245 |
+
// set the shipping method
|
246 |
+
if ($this->_helper->skipShippingMethod() == true) {
|
247 |
+
$this->saveShippingMethodAction($gotonext = false);
|
248 |
+
} // end
|
249 |
+
// set the payment method
|
250 |
+
if ($this->_helper->skipPaymentMethod() == true) {
|
251 |
+
$this->savePaymentAction($gotonext = false);
|
252 |
+
} // end if
|
253 |
+
switch ($current) {
|
254 |
+
case "billing":
|
255 |
+
if ($this->_helper->skipShippingMethod() == true && $this->_helper->skipPaymentMethod() == true) {
|
256 |
+
$result['goto_section'] = 'review';
|
257 |
+
$result['allow_sections'] = array(
|
258 |
+
'review'
|
259 |
+
);
|
260 |
+
$result['update_section'] = array(
|
261 |
+
'name' => 'review',
|
262 |
+
'html' => $this->_getReviewHtml()
|
263 |
+
);
|
264 |
+
} elseif ($this->_helper->skipShippingMethod() ==
|
265 |
+
true && $this->_helper->skipPaymentMethod() == false) {
|
266 |
+
$result['goto_section'] = 'payment';
|
267 |
+
$result['allow_sections'] = array(
|
268 |
+
'payment'
|
269 |
+
);
|
270 |
+
$result['update_section'] = array(
|
271 |
+
'name' => 'payment-method',
|
272 |
+
'html' => $this->_getPaymentMethodsHtml()
|
273 |
+
);
|
274 |
+
} elseif ($this->_helper->skipShippingMethod() == false) {
|
275 |
+
$result['goto_section'] = 'shipping_method';
|
276 |
+
$result['allow_sections'] = array(
|
277 |
+
'shipping'
|
278 |
+
);
|
279 |
+
$result['update_section'] = array(
|
280 |
+
'name' => 'shipping-method',
|
281 |
+
'html' => $this->_getShippingMethodsHtml()
|
282 |
+
);
|
283 |
+
} // end
|
284 |
+
break;
|
285 |
+
case "shippingmethod":
|
286 |
+
if ($this->_helper->skipPaymentMethod() == true) {
|
287 |
+
$result['goto_section'] = 'review';
|
288 |
+
$result['allow_sections'] = array(
|
289 |
+
'review'
|
290 |
+
);
|
291 |
+
$result['update_section'] = array(
|
292 |
+
'name' => 'review',
|
293 |
+
'html' => $this->_getReviewHtml()
|
294 |
+
);
|
295 |
+
} elseif ($this->_helper->skipPaymentMethod() == false) {
|
296 |
+
$result['goto_section'] = 'payment';
|
297 |
+
$result['allow_sections'] = array(
|
298 |
+
'payment'
|
299 |
+
);
|
300 |
+
$result['update_section'] = array(
|
301 |
+
'name' => 'payment-method',
|
302 |
+
'html' => $this->_getPaymentMethodsHtml()
|
303 |
+
);
|
304 |
+
} // end
|
305 |
+
break;
|
306 |
+
case "payment":
|
307 |
+
$result['goto_section'] = 'review';
|
308 |
+
$result['update_section'] = array(
|
309 |
+
'name' => 'review',
|
310 |
+
'html' => $this->_getReviewHtml()
|
311 |
+
);
|
312 |
+
break;
|
313 |
+
} // end sw
|
314 |
+
return $result;
|
315 |
+
} // end
|
316 |
+
} // end class
|
app/code/local/Sunarc/Skipcheckout/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Sunarc_Skipcheckout>
|
5 |
-
<version>1.
|
6 |
</Sunarc_Skipcheckout>
|
7 |
</modules>
|
8 |
<global>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Sunarc_Skipcheckout>
|
5 |
+
<version>1.1.0</version>
|
6 |
</Sunarc_Skipcheckout>
|
7 |
</modules>
|
8 |
<global>
|
app/code/local/Sunarc/Skipcheckout/sql/skipcheckout_setup/install-1.0.0.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Core_Model_Resource_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/local/Sunarc/Skipcheckout/sql/skipcheckout_setup/install-1.1.0.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*
|
5 |
+
* @category Sunarc
|
6 |
+
* @package Customize Checkout Steps-magento
|
7 |
+
* @author Sunarc Team <info@sunarctechnologies.com>
|
8 |
+
* @copyright Sunarc (http://sunarctechnologies.com/)
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
$installer = $this;
|
12 |
+
$installer->startSetup();
|
13 |
+
$installer->endSetup();
|
app/design/frontend/base/default/template/sunarc/skipcheckout/onepage.phtml
CHANGED
@@ -1,3 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div class="multiple-checkout">
|
2 |
<span></span>
|
3 |
</div>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*
|
5 |
+
* @category Sunarc
|
6 |
+
* @package Customize Checkout Steps-magento
|
7 |
+
* @author Sunarc Team <info@sunarctechnologies.com>
|
8 |
+
* @copyright Sunarc (http://sunarctechnologies.com/)
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
?>
|
12 |
<div class="multiple-checkout">
|
13 |
<span></span>
|
14 |
</div>
|
package.xml
CHANGED
@@ -1,19 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>26e794300ae96a620bdec2bed0b7cc14</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
-
<license
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>
|
11 |
-
|
12 |
-
<
|
13 |
-
<
|
14 |
-
<
|
15 |
-
<
|
16 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Sunarc_Skipcheckout.xml" hash="ca3dc5ba98d4e5b5bdb8f9f69aba8f97"/></dir></target><target name="magelocal"><dir name="Sunarc"><dir name="Skipcheckout"><dir name="Helper"><file name="Data.php" hash="1d0ec141f1aa1ce195f168f8d670e8b7"/><file name="Order.php" hash="72c4d1d2e4fee3bebde5dd25e7cd3449"/><file name="Url.php" hash="1e7b356fadffc0e0b69e8927b985477c"/></dir><dir name="Model"><file name="Observer.php" hash="2030076ab2123da626b30ded1630753c"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Login"><file name="Step.php" hash="171392b9c4174b259108a06dc7361d18"/></dir><dir name="Payment"><file name="Enabledmethods.php" hash="21b376b14c7dc9800052d587558d3b93"/></dir><dir name="Shipping"><file name="Enabledmethods.php" hash="a0ab79c3cc262296cbd2362c29990aeb"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="SkipcheckoutController.php" hash="8eb53f0c88a8d4aaabd5e0c8c5e8de98"/></dir><file name="OnepageController.php" hash="81ec3a9b87c0a1e326ca401b5f99c724"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d12e851fdea4fe3abe3039d488a45613"/><file name="config.xml" hash="17dbdc514b6ddf9da373c1e6ed1bf7b7"/><file name="system.xml" hash="ebdcd8c699b8402a971f78e251c3ab75"/></dir><dir name="sql"><dir name="skipcheckout_setup"><file name="install-1.0.0.php" hash="d4f7ea9ca2cb7d23d643ac5c0fd1d4f2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="sunarc"><dir name="skipcheckout"><file name="onepage.phtml" hash="b1d8d4bc4565fb182eec7cd7341d6cea"/></dir></dir></dir><dir name="layout"><dir name="sunarc"><dir name="skipcheckout"><file name="skipcheckout.xml" hash="28fd6d6feed70788be149ab7e35ce29e"/></dir></dir></dir></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
-
<dependencies><required><php><min>5.
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>26e794300ae96a620bdec2bed0b7cc14</name>
|
4 |
+
<version>1.1.0</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>The extension allows process by skipping any of the login page, shipping or payment methods. </summary>
|
10 |
+
<description>Customize Checkout Steps by SunArc Technologies, allows the checkout process customization by skipping login, shipping or payment methods. It helps to reduce the checkout steps by enabling faster checkout. By this extension you can choose the default shipping and payment options to be automatically applied to your store helping customer to avoid choosing them from front end store. So, this will reduce the checkout steps helping customers to get faster and quicker checkout for the purchase.</description>
|
11 |
+
<notes>Stable version 1.1.0 of "Customize Checkout Steps" extension.</notes>
|
12 |
+
<authors><author><name>Rajneesh Vyas</name><user>sunarctech</user><email>rajneesh.vyas@sunarctechnologies.com</email></author></authors>
|
13 |
+
<date>2017-07-18</date>
|
14 |
+
<time>10:55:54</time>
|
15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Sunarc_Skipcheckout.xml" hash="ca3dc5ba98d4e5b5bdb8f9f69aba8f97"/></dir></target><target name="magelocal"><dir name="Sunarc"><dir name="Skipcheckout"><dir name="Helper"><file name="Data.php" hash="154a1a7f40a840ce0fe5af9013e1fb9f"/><file name="Order.php" hash="1ac0e0dfd8f0464174bbb1d895d674d7"/><file name="Url.php" hash="79a029dc23053304f4406e3e7f81ca8b"/><file name="Data.php" hash="154a1a7f40a840ce0fe5af9013e1fb9f"/><file name="Order.php" hash="1ac0e0dfd8f0464174bbb1d895d674d7"/><file name="Url.php" hash="79a029dc23053304f4406e3e7f81ca8b"/></dir><dir name="Model"><file name="Observer.php" hash="a3aa98a4f5987656b6b8df1f71c68769"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Login"><file name="Step.php" hash="7343387e2280587d854b458e5c6fee80"/><file name="Step.php" hash="7343387e2280587d854b458e5c6fee80"/></dir><dir name="Payment"><file name="Enabledmethods.php" hash="de9a19731a2021b466eb5873433e234b"/><file name="Enabledmethods.php" hash="de9a19731a2021b466eb5873433e234b"/></dir><dir name="Shipping"><file name="Enabledmethods.php" hash="baf9abef1e7157f492105dc49abc7cdd"/><file name="Enabledmethods.php" hash="baf9abef1e7157f492105dc49abc7cdd"/></dir></dir></dir></dir><file name="Observer.php" hash="a3aa98a4f5987656b6b8df1f71c68769"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="SkipcheckoutController.php" hash="1777abe83c06c2e3397276502f21ca2d"/><file name="SkipcheckoutController.php" hash="1777abe83c06c2e3397276502f21ca2d"/></dir><file name="OnepageController.php" hash="acb9b5b9559938f13741f892f5f049c0"/><file name="OnepageController.php" hash="acb9b5b9559938f13741f892f5f049c0"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d12e851fdea4fe3abe3039d488a45613"/><file name="config.xml" hash="e9c724587a58d3aa280d29d8040dd5eb"/><file name="system.xml" hash="ebdcd8c699b8402a971f78e251c3ab75"/><file name="adminhtml.xml" hash="d12e851fdea4fe3abe3039d488a45613"/><file name="config.xml" hash="e9c724587a58d3aa280d29d8040dd5eb"/><file name="system.xml" hash="ebdcd8c699b8402a971f78e251c3ab75"/></dir><dir name="sql"><dir name="skipcheckout_setup"><file name="install-1.1.0.php" hash="5f8e852343b0996b4d9df51b8bc5ef8f"/><file name="install-1.1.0.php" hash="5f8e852343b0996b4d9df51b8bc5ef8f"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="sunarc"><dir name="skipcheckout"><file name="onepage.phtml" hash="8d25147f60a90eae6f086e5dfb3f19cb"/></dir></dir></dir><dir name="layout"><dir name="sunarc"><dir name="skipcheckout"><file name="skipcheckout.xml" hash="28fd6d6feed70788be149ab7e35ce29e"/></dir></dir></dir></dir></dir></dir></target></contents>
|
|
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>7.0.0</max></php></required></dependencies>
|
18 |
</package>
|