Clearandfizzy_Reducedcheckout - Version 1.3.1

Version Notes

Did we add new features?

Yes



Did you fix a bunch of Bugs?

Yes



Well then, what in funkytown did you do?

Added the ability to skip checkout steps based on Customer Groups.

Fixed a bug inthe Force Guest Checkout mode being ignored.

Download this release

Release Info

Developer Gareth Price
Extension Clearandfizzy_Reducedcheckout
Version 1.3.1
Comparing to
See all releases


Code changes from version 1.3.0 to 1.3.1

app/code/community/Clearandfizzy/Reducedcheckout/Helper/Data.php CHANGED
@@ -1,149 +1,188 @@
1
- <?php
2
-
3
- class Clearandfizzy_Reducedcheckout_Helper_Data extends Mage_Core_Helper_Abstract {
4
-
5
- public function getPaymentMethod() {
6
- $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout/default_payment');
7
- return $value;
8
- } // end
9
-
10
- public function getShippingMethod() {
11
- $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout/default_shipping');
12
- return $value;
13
- } // end
14
-
15
- public function getCustomerGroupsEnabled() {
16
- $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/customergroups_enabled');
17
- return $value;
18
- }
19
-
20
- public function getShippingCustomerGroups() {
21
-
22
- if ($this->getCustomerGroupsEnabled() == 0) {
23
- return array();
24
- } // end
25
-
26
- $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/shipping_noskip_customergroups');
27
- $value = explode(',', $value);
28
-
29
- return $value;
30
- } // end
31
-
32
- public function getPaymentCustomerGroups() {
33
-
34
- if ($this->getCustomerGroupsEnabled() == 0) {
35
- return array();
36
- } // end
37
-
38
- $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/payment_noskip_customergroups');
39
- $value = explode(',', $value);
40
-
41
- return $value;
42
- } // end
43
-
44
- public function isGuestCheckoutOnly() {
45
- $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/guestcheckoutonly');
46
- return $value;
47
- } // end
48
-
49
-
50
- /**
51
- * Returns the current logged in customers group.
52
- * If the customer is not logged in return false
53
- *
54
- * @return boolean
55
- */
56
- protected function getCurrentCustomersGroup() {
57
-
58
- // Check Customer is loggedin or not
59
- if(Mage::getSingleton('customer/session')->isLoggedIn()){
60
-
61
- // Get group Id
62
- $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
63
-
64
- return $groupId;
65
- //Get customer Group name
66
- //$group = Mage::getModel('customer/group')->load($groupId);
67
- //return $group->getCode();
68
- } // end
69
-
70
- return false;
71
- } // end
72
-
73
-
74
- /**
75
- * Returns true if we should force the payment method
76
- * @return boolean
77
- */
78
- public function skipPaymentMethod() {
79
- $code = $this->getPaymentMethod();
80
- $noskip_groups = $this->getPaymentCustomerGroups();
81
- $current_group = $this->getCurrentCustomersGroup();
82
-
83
- switch ($code) {
84
-
85
- case "noskip":
86
- $return = false;
87
- break;
88
-
89
- default:
90
- $return = $this->skipThisSection($current_group, $noskip_groups);
91
- break;
92
-
93
- } // end sw
94
-
95
- return $return;
96
-
97
- } // end fun
98
-
99
- /**
100
- * Returns true if we should force the shipping method
101
- * @return boolean
102
- */
103
- public function skipShippingMethod() {
104
- $code = $this->getShippingMethod();
105
- $noskip_groups = $this->getShippingCustomerGroups();
106
- $current_group = $this->getCurrentCustomersGroup();
107
-
108
- switch ($code) {
109
-
110
- case "noskip":
111
- $return = false;
112
- break;
113
-
114
- default:
115
- $return = $this->skipThisSection($current_group, $noskip_groups);
116
- break;
117
-
118
- } // end sw
119
-
120
- return $return;
121
-
122
- } // end fun
123
-
124
-
125
- /**
126
- * Returns true if we should skip this section
127
- *
128
- * @param int $current_group customers group id
129
- * @param array $noskip_groups array of groupid's
130
- */
131
- private function skipThisSection($current_group, $noskip_groups) {
132
-
133
- // var_dump($current_group);
134
- // var_dump($noskip_groups);
135
- // var_dump(is_array($noskip_groups));
136
- // var_dump(array_search($current_group, $noskip_groups));
137
-
138
- // if we find the current users groupid in the "dont skip" array, tell checkout not to skip this section
139
- if ( $current_group !== false && is_array($noskip_groups) && array_search($current_group, $noskip_groups) > -1 ) {
140
- return false;
141
- } // end
142
-
143
- return true;
144
-
145
- } // end
146
-
147
-
148
- }
149
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Clearandfizzy_Reducedcheckout_Helper_Data extends Mage_Core_Helper_Abstract {
4
+
5
+ public function getPaymentMethod() {
6
+ $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout/default_payment');
7
+ return $value;
8
+ } // end
9
+
10
+ public function getShippingMethod() {
11
+ $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout/default_shipping');
12
+ return $value;
13
+ } // end
14
+
15
+ <<<<<<< HEAD
16
+ public function getCustomerGroupsEnabled() {
17
+ $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/customergroups_enabled');
18
+ return $value;
19
+ }
20
+
21
+ public function getShippingCustomerGroups() {
22
+
23
+ if ($this->getCustomerGroupsEnabled() == 0) {
24
+ return array();
25
+ } // end
26
+
27
+ $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/shipping_noskip_customergroups');
28
+ $value = explode(',', $value);
29
+
30
+ =======
31
+
32
+ public function isGuestCheckoutOnly() {
33
+ $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout/guestcheckoutonly');
34
+ >>>>>>> refs/remotes/extensions/master
35
+ return $value;
36
+ } // end
37
+
38
+ <<<<<<< HEAD
39
+ public function getPaymentCustomerGroups() {
40
+
41
+ if ($this->getCustomerGroupsEnabled() == 0) {
42
+ return array();
43
+ } // end
44
+
45
+ $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/payment_noskip_customergroups');
46
+ $value = explode(',', $value);
47
+
48
+ return $value;
49
+ } // end
50
+
51
+ public function isGuestCheckoutOnly() {
52
+ $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/guestcheckoutonly');
53
+ return $value;
54
+ } // end
55
+ =======
56
+
57
+ public function getCustomerGroupsEnabled() {
58
+ $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/customergroups_enabled');
59
+ return $value;
60
+ }
61
+
62
+ public function getShippingCustomerGroups() {
63
+
64
+ if ($this->getCustomerGroupsEnabled() == 0) {
65
+ return array();
66
+ } // end
67
+
68
+ $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/shipping_noskip_customergroups');
69
+ $value = explode(',', $value);
70
+
71
+ return $value;
72
+ } // end
73
+
74
+ public function getPaymentCustomerGroups() {
75
+
76
+ if ($this->getCustomerGroupsEnabled() == 0) {
77
+ return array();
78
+ } // end
79
+
80
+ $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/payment_noskip_customergroups');
81
+ $value = explode(',', $value);
82
+
83
+ return $value;
84
+ } // end
85
+
86
+ >>>>>>> refs/remotes/extensions/master
87
+
88
+
89
+ /**
90
+ * Returns the current logged in customers group.
91
+ * If the customer is not logged in return false
92
+ *
93
+ * @return boolean
94
+ */
95
+ protected function getCurrentCustomersGroup() {
96
+
97
+ // Check Customer is loggedin or not
98
+ if(Mage::getSingleton('customer/session')->isLoggedIn()){
99
+
100
+ // Get group Id
101
+ $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
102
+
103
+ return $groupId;
104
+ //Get customer Group name
105
+ //$group = Mage::getModel('customer/group')->load($groupId);
106
+ //return $group->getCode();
107
+ } // end
108
+
109
+ return false;
110
+ } // end
111
+
112
+
113
+ /**
114
+ * Returns true if we should force the payment method
115
+ * @return boolean
116
+ */
117
+ public function skipPaymentMethod() {
118
+ $code = $this->getPaymentMethod();
119
+ $noskip_groups = $this->getPaymentCustomerGroups();
120
+ $current_group = $this->getCurrentCustomersGroup();
121
+
122
+ switch ($code) {
123
+
124
+ case "noskip":
125
+ $return = false;
126
+ break;
127
+
128
+ default:
129
+ $return = $this->skipThisSection($current_group, $noskip_groups);
130
+ break;
131
+
132
+ } // end sw
133
+
134
+ return $return;
135
+
136
+ } // end fun
137
+
138
+ /**
139
+ * Returns true if we should force the shipping method
140
+ * @return boolean
141
+ */
142
+ public function skipShippingMethod() {
143
+ $code = $this->getShippingMethod();
144
+ $noskip_groups = $this->getShippingCustomerGroups();
145
+ $current_group = $this->getCurrentCustomersGroup();
146
+
147
+ switch ($code) {
148
+
149
+ case "noskip":
150
+ $return = false;
151
+ break;
152
+
153
+ default:
154
+ $return = $this->skipThisSection($current_group, $noskip_groups);
155
+ break;
156
+
157
+ } // end sw
158
+
159
+ return $return;
160
+
161
+ } // end fun
162
+
163
+
164
+ /**
165
+ * Returns true if we should skip this section
166
+ *
167
+ * @param int $current_group customers group id
168
+ * @param array $noskip_groups array of groupid's
169
+ */
170
+ private function skipThisSection($current_group, $noskip_groups) {
171
+
172
+ // var_dump($current_group);
173
+ // var_dump($noskip_groups);
174
+ // var_dump(is_array($noskip_groups));
175
+ // var_dump(array_search($current_group, $noskip_groups));
176
+
177
+ // if we find the current users groupid in the "dont skip" array, tell checkout not to skip this section
178
+ if ( $current_group !== false && is_array($noskip_groups) && array_search($current_group, $noskip_groups) > -1 ) {
179
+ return false;
180
+ } // end
181
+
182
+ return true;
183
+
184
+ } // end
185
+
186
+
187
+ }
188
+
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Clearandfizzy_Reducedcheckout</name>
4
- <version>1.3.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/afl-3.0.php">AFL 3.0</license>
7
  <channel>community</channel>
@@ -14,14 +14,15 @@ Integration with 3rd-party payment and shipping extensions should be easy as thi
14
  Yes&lt;br /&gt;&#xD;
15
  &lt;br /&gt;&#xD;
16
  Did you fix a bunch of Bugs?&lt;br /&gt;&#xD;
17
- No&lt;br /&gt;&#xD;
18
  &lt;br /&gt;&#xD;
19
  Well then, what in funkytown did you do?&lt;br /&gt;&#xD;
20
- Added the ability to skip checkout steps based on Customer Groups.</notes>
 
21
  <authors><author><name>Gareth Price</name><user>clearandfizzy</user><email>gareth@clearandfizzy.com</email></author></authors>
22
- <date>2013-02-24</date>
23
- <time>21:03:56</time>
24
- <contents><target name="magecommunity"><dir name="Clearandfizzy"><dir name="Reducedcheckout"><dir name="Helper"><file name="Data.php" hash="ba32d1914690cba78aa1f88c3ce63c3f"/></dir><dir name="Model"><file name="Observer.php" hash="8f4498205db5d37752b3f795816517b4"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Payment"><file name="EnabledMethods.php" hash="f6b69e6fc6697870c53c6c86dbd68e98"/></dir><dir name="Shipping"><file name="EnabledMethods.php" hash="5cf16d02a105f9699e4258bb5bc57364"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="OnepageController.php" hash="8d8d7ee733035d27a202cbd277041267"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0bb1372118e88ad09fbd1b1d5113dea7"/><file name="config.xml" hash="d6f318cedca281655d55e0813c8282a4"/><file name="system.xml" hash="4b2819dbe5db301e2067a2331ad1c145"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Clearandfizzy_ReducedCheckout.xml" hash="9cb58e8121e0c0e294f10a3595b2be7d"/></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="clearandfizzy"><dir name="reducedcheckout"><file name="reducedcheckout.xml" hash="282aeb07fe3b9510bcbd92498907968f"/></dir></dir></dir><dir name="template"><dir name="clearandfizzy"><dir name="reducedcheckout"><file name="onepage.phtml" hash="21921ab772ef02af217c49200619f2d5"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
25
  <compatible/>
26
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
27
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Clearandfizzy_Reducedcheckout</name>
4
+ <version>1.3.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/afl-3.0.php">AFL 3.0</license>
7
  <channel>community</channel>
14
  Yes&lt;br /&gt;&#xD;
15
  &lt;br /&gt;&#xD;
16
  Did you fix a bunch of Bugs?&lt;br /&gt;&#xD;
17
+ Yes&lt;br /&gt;&#xD;
18
  &lt;br /&gt;&#xD;
19
  Well then, what in funkytown did you do?&lt;br /&gt;&#xD;
20
+ Added the ability to skip checkout steps based on Customer Groups.&lt;br /&gt;&#xD;
21
+ Fixed a bug inthe Force Guest Checkout mode being ignored.</notes>
22
  <authors><author><name>Gareth Price</name><user>clearandfizzy</user><email>gareth@clearandfizzy.com</email></author></authors>
23
+ <date>2013-02-25</date>
24
+ <time>01:31:13</time>
25
+ <contents><target name="magecommunity"><dir name="Clearandfizzy"><dir name="Reducedcheckout"><dir name="Helper"><file name="Data.php" hash="eb38b72cf9e7d141b0ae12ceaba82ccf"/></dir><dir name="Model"><file name="Observer.php" hash="8f4498205db5d37752b3f795816517b4"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Payment"><file name="EnabledMethods.php" hash="f6b69e6fc6697870c53c6c86dbd68e98"/></dir><dir name="Shipping"><file name="EnabledMethods.php" hash="5cf16d02a105f9699e4258bb5bc57364"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="OnepageController.php" hash="8d8d7ee733035d27a202cbd277041267"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0bb1372118e88ad09fbd1b1d5113dea7"/><file name="config.xml" hash="d6f318cedca281655d55e0813c8282a4"/><file name="system.xml" hash="4b2819dbe5db301e2067a2331ad1c145"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Clearandfizzy_ReducedCheckout.xml" hash="9cb58e8121e0c0e294f10a3595b2be7d"/></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="clearandfizzy"><dir name="reducedcheckout"><file name="reducedcheckout.xml" hash="282aeb07fe3b9510bcbd92498907968f"/></dir></dir></dir><dir name="template"><dir name="clearandfizzy"><dir name="reducedcheckout"><file name="onepage.phtml" hash="21921ab772ef02af217c49200619f2d5"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
28
  </package>