26e794300ae96a620bdec2bed0b7cc14 - Version 1.1.0

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 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 = Mage::getStoreConfig('sunarc_skipcheckout_settings/skipcheckout_customergroups/customergroups_enabled');
 
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 = Mage::getStoreConfig('sunarc_skipcheckout_settings/skipcheckout_customergroups/shipping_noskip_customergroups');
 
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 = Mage::getStoreConfig('sunarc_skipcheckout_settings/skipcheckout_customergroups/payment_noskip_customergroups');
 
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
- $noskip_groups = $this->getPaymentCustomerGroups();
104
- $current_group = $this->getCurrentCustomersGroup();
105
  switch ($code) {
106
  case "noskip":
107
  $return = false;
108
  break;
109
  default:
110
- $return = $this->skipThisSection($current_group, $noskip_groups);
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
- $noskip_groups = $this->getShippingCustomerGroups();
123
- $current_group = $this->getCurrentCustomersGroup();
124
  switch ($code) {
125
  case "noskip":
126
  $return = false;
127
  break;
128
  default:
129
- $return = $this->skipThisSection($current_group, $noskip_groups);
130
  break;
131
- } // end sw
 
132
  return $return;
133
  } // end fun
134
  /**
135
  * Returns true if we should skip this section
136
  *
137
- * @param int $current_group customers group id
138
- * @param array $noskip_groups array of groupid's
139
  */
140
- private function skipThisSection($current_group, $noskip_groups)
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 ($current_group !== false && is_array($noskip_groups) && array_search($current_group, $noskip_groups) > -1) {
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
- class Sunarc_Skipcheckout_Helper_Order extends Mage_Core_Helper_Abstract
3
- {
4
- /**
5
- * We use this during the user signup phase.
6
- * @var string
7
- */
8
- public $_session_key = 'skipcheckout_register_key';
9
- public function getSessionKey()
10
- {
11
- return $this->_session_key;
12
- } // end
13
- public function getOrder()
14
- {
15
- //get the order id from the session
16
- $session = Mage::getSingleton('checkout/session');
17
- $lastOrderId = $session->getLastOrderId();
18
- // load the order
19
- $order = Mage::getSingleton('sales/order');
20
- $order->load($lastOrderId);
21
- return $order;
22
- } // end
23
- /**
24
- *
25
- * @return Ambigous <mixed, unknown, multitype:>
26
- */
27
- public function getEmail()
28
- {
29
- $order = $this->getOrder();
30
- // get the orders email address
31
- $email = $order->getCustomerEmail();
32
- return $email;
33
- } // end
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 $is_secure;
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->is_secure == null) {
12
- $this->is_secure = Mage::app()->getStore()->isCurrentlySecure();
13
  } // end if
14
- return $this->is_secure;
15
  } // end
16
  /**
17
  *
18
  */
19
  public function getProgressUrl()
20
  {
21
- return Mage::getUrl('skipcheckout/onepage/progress', array(
 
22
  "_secure" => $this->getIsSecure()
23
- ));
 
24
  } // end
25
  public function getReviewUrl()
26
  {
27
- return Mage::getUrl('skipcheckout/onepage/review', array(
 
28
  "_secure" => $this->getIsSecure()
29
- ));
 
30
  } // end
31
  public function getSaveMethodUrl()
32
  {
33
- return Mage::getUrl('skipcheckout/onepage/saveMethod', array(
 
34
  "_secure" => $this->getIsSecure()
35
- ));
 
36
  }
37
  public function getFailureUrl()
38
  {
39
- return Mage::getUrl('checkout/cart', array(
 
40
  "_secure" => $this->getIsSecure()
41
- ));
 
42
  }
43
  public function getAddressUrl()
44
  {
45
- return Mage::getUrl('skipcheckout/onepage/getAddress', array(
 
46
  "_secure" => $this->getIsSecure()
47
- ));
 
48
  } // end
49
  public function getSaveBillingUrl()
50
  {
51
- return Mage::getUrl('skipcheckout/onepage/saveBilling', array(
 
52
  "_secure" => $this->getIsSecure()
53
- ));
 
54
  } // end
55
  public function getSaveShippingUrl()
56
  {
57
- return Mage::getUrl('skipcheckout/onepage/saveShipping', array(
 
58
  "_secure" => $this->getIsSecure()
59
- ));
 
60
  }
61
  public function getSaveShippingMethod()
62
  {
63
- return Mage::getUrl('skipcheckout/onepage/saveShippingMethod', array(
 
64
  "_secure" => $this->getIsSecure()
65
- ));
 
66
  }
67
  public function getSavePaymentUrl()
68
  {
69
- return Mage::getUrl('skipcheckout/onepage/savePayment', array(
 
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
- class Sunarc_Skipcheckout_Model_Observer extends Mage_Core_Model_Observer
3
- {
4
- public function checkSkipCheckout(Varien_Event_Observer $observer)
5
- {
6
- // exit now if reduced checkout is not enabled or this is not checkout_onepage_index
7
- if ($this->isSkipCheckoutEnabled() == false) {
8
- return;
9
- }
10
- $handles = $observer->getEvent()->getLayout()->getUpdate()->getHandles();
11
- $this->_update = $observer->getEvent()->getLayout()->getUpdate();
12
- // find the handle we're looking for
13
- if (array_search('checkout_onepage_index', $handles) == true) {
14
- $this->_update->addHandle('sunarc_checkout_skip');
15
- $this->_loginStepHandle();
16
- $this->_paymentStepHandle();
17
- $this->_shippingStepHandle();
18
- $this->_telephoneFaxHandle();
19
- return;
20
- } // end
21
- // find the handle we're looking for
22
- if (array_search('customer_address_form', $handles) == true) {
23
- $this->_telephoneFaxHandle();
24
- return;
25
- } // end
26
- return;
27
- } // end
28
- /**
29
- * Adds the handle "sunarc_checkout_skip_forceguestonly"
30
- * @see app/design/frontend/base/default/layout/sunarc/skipcheckout/skipcheckout.xml
31
- */
32
- protected function _loginStepHandle()
33
- {
34
- // should we remove the login step..
35
- if (Mage::getSingleton('customer/session')->isLoggedIn() == false && Mage::helper('sunarc_skipcheckout/data')->isLoginStepGuestOnly() == true) {
36
- $this->getUpdate()->addHandle('sunarc_checkout_skip_forceguestonly');
37
- } // end
38
- } // end
39
- /**
40
- * Adds the Handle "sunarc_checkout_skip_skip_shippingmethod"
41
- * @see app/design/frontend/base/default/layout/sunarc/skipcheckout/skipcheckout.xml
42
- */
43
- protected function _paymentStepHandle()
44
- {
45
- // should we remove the payment method step..
46
- if (Mage::helper('sunarc_skipcheckout/data')->skipShippingMethod() == true) {
47
- $this->getUpdate()->addHandle('sunarc_checkout_skip_skip_shippingmethod');
48
- } // end
49
- } // end
50
- /**
51
- * Adds the Handle "sunarc_checkout_skip_skip_paymentmethod"
52
- * @see app/design/frontend/base/default/layout/sunarc/skipcheckout/skipcheckout.xml
53
- */
54
- protected function _shippingStepHandle()
55
- {
56
- // should we remove the shipping method step..
57
- if (Mage::helper('sunarc_skipcheckout/data')->skipPaymentMethod() == true) {
58
- $this->getUpdate()->addHandle('sunarc_checkout_skip_skip_paymentmethod');
59
- } // end
60
- } // end
61
- /**
62
- * Adds the Handle "sunarc_checkout_skip_hide_telephonefax"
63
- * @see app/design/frontend/base/default/layout/sunarc/skipcheckout/skipcheckout.xml
64
- */
65
- protected function _telephoneFaxHandle()
66
- {
67
- // hide the telphone input fields
68
- // end
69
- } // end
70
- /**
71
- * Returns true if the the user is not logged in and email doesn't already exist.
72
- * @return boolean
73
- */
74
- protected function _isValidGuest()
75
- {
76
- if (Mage::getSingleton('customer/session')->isLoggedIn() || $this->_customerExists()) {
77
- return false;
78
- } // end
79
- return true;
80
- } // end
81
- /**
82
- * Returns true if the last order's email address already exists
83
- * @return boolean
84
- */
85
- protected function _customerExists()
86
- {
87
- $helper = Mage::helper('sunarc_skipcheckout/order');
88
- $email = $helper->getEmail();
89
- $customer = Mage::getSingleton('customer/customer')->setStore(Mage::app()->getStore())->loadByEmail($email);
90
- if ($customer->getId()) {
91
- return true;
92
- } // end
93
- return false;
94
- } // end
95
- /**
96
- * Returns true if Reduced Checkout is Enabled in the Admin Configuration
97
- *
98
- * @return boolean
99
- */
100
- protected function isSkipCheckoutEnabled()
101
- {
102
- $enabled = Mage::getStoreConfig('sunarc_skipcheckout_settings/skipcheckout/isenabled');
103
- // return early if we're not enabled
104
- if ($enabled != true) {
105
- return false;
106
- } // end
107
- return true;
108
- } // end
109
- protected function getUpdate()
110
- {
111
- return $this->_update;
112
- } // end
113
- } // end
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
- class Sunarc_Skipcheckout_Model_System_Config_Source_Login_Step
3
- {
4
- public function toOptionArray()
5
- {
6
- return array(
7
- "0" => "Default Magento login",
8
- "1" => "Skip Magento Login"
9
- );
10
- } // end
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
- class Sunarc_Skipcheckout_Model_System_Config_Source_Payment_Enabledmethods
3
- {
4
- public function toOptionArray()
5
- {
6
- $active_methods = Mage::getSingleton('payment/config')->getActiveMethods();
7
- $methods = array();
8
- $methods['noskip'] = Mage::helper('sunarc_skipcheckout')->__("Do not skip [Default]");
9
- foreach ($active_methods as $code => $value) {
10
- switch ($code) {
11
- // we can't skip this method so make sure its not added to the array
12
- case "ccsave":
13
- break;
14
- default:
15
- $label = Mage::getStoreConfig('payment/' . $code . '/title');
16
- $methods[$code] = $label;
17
- break;
18
- } // end
19
- } // end
20
- return $methods;
21
- } // end fun
22
- } // 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_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
- class Sunarc_Skipcheckout_Model_System_Config_Source_Shipping_Enabledmethods
3
- {
4
- public function toOptionArray()
5
- {
6
- $active_carriers = Mage::getSingleton('shipping/config')->getActiveCarriers();
7
- $carrier_methods = array();
8
- $carrier_methods['noskip'] = Mage::helper('sunarc_skipcheckout')->__("Do not skip [Default]");
9
- foreach ($active_carriers as $code => $carrier) {
10
- $label = Mage::getStoreConfig('carriers/' . $code . '/title');
11
- $enabled = Mage::getStoreConfig('carriers/' . $code . '/active');
12
- $methods = $carrier->getAllowedMethods();
13
- foreach ($methods as $method_code => $method_label) {
14
- if ($label != null && $enabled == 1) {
15
- $carrier_methods[$code . '_' . $method_code] = $label . " [" . $method_label . "]";
16
- } // end
17
- }
18
- } // end
19
- return $carrier_methods;
20
- } // end fun
21
- } // 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_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
- require_once "Mage/Checkout/controllers/OnepageController.php";
3
- class Sunarc_Skipcheckout_OnepageController extends Mage_Checkout_OnepageController
4
- {
5
- public $layout;
6
- protected $_helper;
7
- /**
8
- * (non-PHPdoc)
9
- * @see Mage_Core_Controller_Varien_Action::_construct()
10
- */
11
- public function _construct()
12
- {
13
- parent::_construct();
14
- $this->_helper = Mage::helper('sunarc_skipcheckout');
15
- } // end
16
- /**
17
- * (non-PHPdoc)
18
- * @see Mage_Checkout_OnepageController::saveMethodAction()
19
- */
20
- public function saveMethodAction()
21
- {
22
- if ($this->_expireAjax()) {
23
- return;
24
- } // end if
25
- // set the checkout method
26
- if ($this->getRequest()->isPost()) {
27
- $method = $this->getCheckoutMethod();
28
- $result = $this->getOnepage()->saveCheckoutMethod($method);
29
- } // end if
30
- } // end if
31
- /**
32
- * Checks the System > Configuration Setting for this extension and sets the
33
- * CheckoutMethod as appropriate
34
- *
35
- * @return Ambigous <mixed, unknown>
36
- */
37
- private function getCheckoutMethod()
38
- {
39
- switch ($this->_helper->isLoginStepGuestOnly()) {
40
- case true:
41
- $method = "guest";
42
- break;
43
- default:
44
- $method = $this->getRequest()->getPost('method');
45
- break;
46
- } // end
47
- return $method;
48
- } /// end
49
- /**
50
- * (non-PHPdoc)
51
- * @see Mage_Checkout_OnepageController::saveShippingMethodAction()
52
- * $gotonext = false forces the method not to go to the next section and return to the calling method
53
- */
54
- public function saveShippingMethodAction($gotonext = true)
55
- {
56
- if ($this->_expireAjax()) {
57
- return;
58
- } // end if
59
- // this is the default way
60
- $shipping = $this->getRequest()->getPost('shipping_method', '');
61
- // override the default value if we need to
62
- if ($this->_helper->skipShippingMethod() == true) {
63
- $shipping = $this->_helper->getShippingMethod();
64
- } // end if
65
- // set the shipping method
66
- $result = $this->getOnepage()->saveShippingMethod($shipping);
67
- // calculations for the checkout totals
68
- $this->getOnepage()->getQuote()->collectTotals();
69
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
70
- $this->getOnepage()->getQuote()->collectTotals()->save();
71
- // save shipping method event
72
- Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array(
73
- 'request' => $this->getRequest(),
74
- 'quote' => $this->getOnepage()->getQuote()
75
- ));
76
- $this->getOnepage()->getQuote()->setTotalsCollectedFlag(false);
77
- // attempt to load the next section
78
- if ($gotonext == true) {
79
- $result = $this->getNextSection($result, $current = 'shippingmethod');
80
- } // end if
81
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
82
- } // end
83
- /**
84
- * (non-PHPdoc)
85
- * @see Mage_Checkout_OnepageController::savePaymentAction()
86
- */
87
- public function savePaymentAction($gotonext = true)
88
- {
89
- if ($this->_expireAjax()) {
90
- return;
91
- } // end if
92
- if (!$this->getRequest()->isPost()) {
93
- $this->_ajaxRedirectResponse();
94
- return;
95
- }
96
- // this is the default way
97
- $data = $this->getRequest()->getPost('payment', array());
98
- // override the default value if we need to
99
- if ($this->_helper->skipPaymentMethod() == true) {
100
- $payment = $this->_helper->getPaymentMethod();
101
- $data = array(
102
- 'method' => $payment
103
- );
104
- } // end if
105
- // start forming the JSON result
106
- $result = $this->getOnepage()->savePayment($data);
107
- // get section and redirect data
108
- $redirectUrl = $this->getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();
109
- // if the redirect URL has been set in this step then make it visibile for the entire Checkout object
110
- if ($redirectUrl) {
111
- $this->getOnepage()->getCheckout()->setRedirectUrl($redirectUrl);
112
- }
113
- // attempt to load the next section
114
- if ($gotonext == true) {
115
- $result = $this->getNextSection($result, $current = 'payment');
116
- } // end if
117
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
118
- } // end
119
- /**
120
- * (non-PHPdoc)
121
- * @see Mage_Checkout_OnepageController::saveShippingAction()
122
- */
123
- public function saveShippingAction($gotonext = true)
124
- {
125
- if ($this->_expireAjax()) {
126
- return;
127
- }
128
- if ($this->getRequest()->isPost()) {
129
- $data = $this->getRequest()->getPost('shipping', array());
130
- $customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);
131
- // save the billing address info
132
- $result = $this->getOnepage()->saveShipping($data, $customerAddressId);
133
- } // end
134
- // attempt to load the next section
135
- if ($gotonext == true) {
136
- $result = $this->getNextSection($result, $current = 'billing');
137
- } // end if
138
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
139
- } // end
140
- /**
141
- * (non-PHPdoc)
142
- * @see Mage_Checkout_OnepageController::saveBillingAction()
143
- */
144
- public function saveBillingAction()
145
- {
146
- if ($this->_expireAjax()) {
147
- return;
148
- }
149
- if ($this->getRequest()->isPost()) {
150
- if ($this->_helper->isLoginStepGuestOnly() == true) {
151
- // set the checkout method
152
- $this->saveMethodAction();
153
- } // end if
154
- $data = $this->getRequest()->getPost('billing', array());
155
- $customerAddressId = $this->getRequest()->getPost('billing_address_id', false);
156
- if (isset($data['email'])) {
157
- $data['email'] = trim($data['email']);
158
- } // end if
159
- // save the billing address info
160
- $result = $this->getOnepage()->saveBilling($data, $customerAddressId);
161
- // render the onepage review
162
- if (!isset($result['error'])) {
163
- /* check quote for virtual */
164
- if ($this->getOnepage()->getQuote()->isVirtual()) {
165
- // find out which section we should go to next
166
- $result = $this->getNextSection($result, $current = 'billing');
167
- } elseif (isset($data['use_for_shipping']) && $data['use_for_shipping'] == 1) {
168
- // find out which section we should go to next
169
- $result = $this->getNextSection($result, $current = 'billing');
170
- $result['duplicateBillingInfo'] = 'true';
171
- } else {
172
- // go to the shipping section
173
- $result['goto_section'] = 'shipping';
174
- } // end if
175
- } // end
176
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
177
- }
178
- } // end
179
- /**
180
- * (non-PHPdoc)
181
- * @see Mage_Checkout_OnepageController::_getReviewHtml()
182
- */
183
- protected function _getReviewHtml()
184
- {
185
- $layout = $this->getLayout();
186
- $update = $layout->getUpdate();
187
- $update->merge('checkout_onepage_review');
188
- $layout->generateXml();
189
- $layout->generateBlocks();
190
- $output = $layout->getBlock('root')->toHtml();
191
- return $output;
192
- } // end
193
- /**
194
- * (non-PHPdoc)
195
- * @see Mage_Checkout_OnepageController::progressAction()
196
- */
197
- public function progressAction()
198
- {
199
- $version_array = Mage::getVersionInfo();
200
- // Quick fix Magento 1.8 and pre 1.8 have different methods to generate the right hand progress bar.
201
- if ($version_array['major'] == 1 && $version_array['minor'] < 8) {
202
- return $this->preV8ProgressAction();
203
- } // end
204
- return parent::progressAction();
205
- } // end
206
- /**
207
- * Quick fix Magento 1.8 and pre 1.8 have different methods to generate the right hand progress bar.
208
- * This method runs if magento 1.7 or older is being used.
209
- * @return string
210
- */
211
- protected function preV8ProgressAction()
212
- {
213
- $layout = $this->getLayout();
214
- $update = $layout->getUpdate();
215
- $update->load('checkout_onepage_progress');
216
- $layout->generateXml();
217
- $layout->generateBlocks();
218
- $output = $layout->getOutput();
219
- $this->renderLayout();
220
- } // end
221
- /**
222
- * Returns html for the next step to display depending on logic set in the System > Configuration
223
- *
224
- * @param array $result
225
- * @param string $current Current step code
226
- * @return multitype:string html <string, unknown>
227
- */
228
- private function getNextSection($result, $current)
229
- {
230
- // set the shipping method
231
- if ($this->_helper->skipShippingMethod() == true) {
232
- $this->saveShippingMethodAction($gotonext = false);
233
- } // end
234
- // set the payment method
235
- if ($this->_helper->skipPaymentMethod() == true) {
236
- $this->savePaymentAction($gotonext = false);
237
- } // end if
238
- switch ($current) {
239
- case "billing":
240
- if ($this->_helper->skipShippingMethod() == true && $this->_helper->skipPaymentMethod() == true) {
241
- $result['goto_section'] = 'review';
242
- $result['allow_sections'] = array(
243
- 'review'
244
- );
245
- $result['update_section'] = array(
246
- 'name' => 'review',
247
- 'html' => $this->_getReviewHtml()
248
- );
249
- } elseif ($this->_helper->skipShippingMethod() == true && $this->_helper->skipPaymentMethod() == false) {
250
- $result['goto_section'] = 'payment';
251
- $result['allow_sections'] = array(
252
- 'payment'
253
- );
254
- $result['update_section'] = array(
255
- 'name' => 'payment-method',
256
- 'html' => $this->_getPaymentMethodsHtml()
257
- );
258
- } elseif ($this->_helper->skipShippingMethod() == false) {
259
- $result['goto_section'] = 'shipping_method';
260
- $result['allow_sections'] = array(
261
- 'shipping'
262
- );
263
- $result['update_section'] = array(
264
- 'name' => 'shipping-method',
265
- 'html' => $this->_getShippingMethodsHtml()
266
- );
267
- } // end
268
- break;
269
- case "shippingmethod":
270
- if ($this->_helper->skipPaymentMethod() == true) {
271
- $result['goto_section'] = 'review';
272
- $result['allow_sections'] = array(
273
- 'review'
274
- );
275
- $result['update_section'] = array(
276
- 'name' => 'review',
277
- 'html' => $this->_getReviewHtml()
278
- );
279
- } elseif ($this->_helper->skipPaymentMethod() == false) {
280
- $result['goto_section'] = 'payment';
281
- $result['allow_sections'] = array(
282
- 'payment'
283
- );
284
- $result['update_section'] = array(
285
- 'name' => 'payment-method',
286
- 'html' => $this->_getPaymentMethodsHtml()
287
- );
288
- } // end
289
- break;
290
- case "payment":
291
- $result['goto_section'] = 'review';
292
- $result['update_section'] = array(
293
- 'name' => 'review',
294
- 'html' => $this->_getReviewHtml()
295
- );
296
- break;
297
- } // end sw
298
- return $result;
299
- } // end
300
- } // 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
+ 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.0.0</version>
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.0.0</version>
5
  <stability>stable</stability>
6
- <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Allows customizing checkout process by skipping any of login page, shipping or payment methods.</summary>
10
- <description>Allows to customize the checkout process by skipping login, shipping or payment methods helping to reduce the checkout steps enabling faster checkout.&#xD;
11
- You can skip any of the option or all the options altogether just through simple admin interface with enable/disable options.</description>
12
- <notes>Stable version release for approval</notes>
13
- <authors><author><name>Rajneesh Vyas</name><user>sunarcmagento</user><email>rajneesh.vyas@sunarctechnologies.com</email></author></authors>
14
- <date>2016-08-13</date>
15
- <time>11:47:43</time>
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.3.0</min><max>5.6.19</max></php></required></dependencies>
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>