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 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
$value =
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
public function
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
$value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
$
|
81 |
-
$
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
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 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
//
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
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.
|
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<br />
|
15 |
<br />
|
16 |
Did you fix a bunch of Bugs?<br />
|
17 |
-
|
18 |
<br />
|
19 |
Well then, what in funkytown did you do?<br />
|
20 |
-
Added the ability to skip checkout steps based on Customer Groups
|
|
|
21 |
<authors><author><name>Gareth Price</name><user>clearandfizzy</user><email>gareth@clearandfizzy.com</email></author></authors>
|
22 |
-
<date>2013-02-
|
23 |
-
<time>
|
24 |
-
<contents><target name="magecommunity"><dir name="Clearandfizzy"><dir name="Reducedcheckout"><dir name="Helper"><file name="Data.php" hash="
|
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<br />
|
15 |
<br />
|
16 |
Did you fix a bunch of Bugs?<br />
|
17 |
+
Yes<br />
|
18 |
<br />
|
19 |
Well then, what in funkytown did you do?<br />
|
20 |
+
Added the ability to skip checkout steps based on Customer Groups.<br />
|
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>
|