Clearandfizzy_Reducedcheckout - Version 1.4.0

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 a fix for Magento bug #28112 which prevent Shipping Tablerates to work correctly.

You can enable /disable the fix on the configuration screen.

Download this release

Release Info

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


Code changes from version 1.3.2 to 1.4.0

app/code/community/Clearandfizzy/Reducedcheckout/Helper/Data.php CHANGED
@@ -12,12 +12,15 @@ class Clearandfizzy_Reducedcheckout_Helper_Data extends Mage_Core_Helper_Abstrac
12
  return $value;
13
  } // end
14
 
15
-
16
  public function isGuestCheckoutOnly() {
17
  $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout/guestcheckoutonly');
18
  return $value;
19
  } // end
20
 
 
 
 
 
21
 
22
  public function getCustomerGroupsEnabled() {
23
  $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/customergroups_enabled');
@@ -48,8 +51,6 @@ class Clearandfizzy_Reducedcheckout_Helper_Data extends Mage_Core_Helper_Abstrac
48
  return $value;
49
  } // end
50
 
51
-
52
-
53
  /**
54
  * Returns the current logged in customers group.
55
  * If the customer is not logged in return false
12
  return $value;
13
  } // end
14
 
 
15
  public function isGuestCheckoutOnly() {
16
  $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout/guestcheckoutonly');
17
  return $value;
18
  } // end
19
 
20
+ public function isFix28112Enabled() {
21
+ $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout/enable28112fix');
22
+ return $value;
23
+ } // end
24
 
25
  public function getCustomerGroupsEnabled() {
26
  $value = Mage::getStoreConfig('clearandfizzy_reducedcheckout_settings/reducedcheckout_customergroups/customergroups_enabled');
51
  return $value;
52
  } // end
53
 
 
 
54
  /**
55
  * Returns the current logged in customers group.
56
  * If the customer is not logged in return false
app/code/community/Clearandfizzy/Reducedcheckout/Model/Resource/Carrier/TablerateFix.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Clearandfizzy_ReducedCheckout_Model_Resource_Carrier_TablerateFix extends Mage_Shipping_Model_Resource_Carrier_Tablerate
4
+ {
5
+
6
+ /**
7
+ * (non-PHPdoc)
8
+ * @see Mage_Shipping_Model_Resource_Carrier_Tablerate::getRate()
9
+ */
10
+ public function getRate(Mage_Shipping_Model_Rate_Request $request) {
11
+ if ( Mage::helper('clearandfizzy_reducedcheckout')->isFix28112Enabled() ) {
12
+ return $this->__getRate($request);
13
+ } // end
14
+
15
+ // otherwise return the magento code
16
+ return parent::getRate($request);
17
+
18
+ } // end fun
19
+
20
+ /**
21
+ * This is a bug fix for
22
+ * (non-PHPdoc)
23
+ * @see Mage_Shipping_Model_Resource_Carrier_Tablerate::getRate()
24
+ */
25
+ private function __getRate(Mage_Shipping_Model_Rate_Request $request) {
26
+ $adapter = $this->_getReadAdapter();
27
+
28
+ $bind = array(
29
+ ':website_id' => (int) $request->getWebsiteId(),
30
+ ':country_id' => $request->getDestCountryId(),
31
+ ':region_id' => (int) $request->getDestRegionId(),
32
+ ':postcode' => $request->getDestPostcode()
33
+ );
34
+
35
+ // condition_value DESC fix
36
+ $select = $adapter->select()
37
+ ->from($this->getMainTable())
38
+ ->where('website_id = :website_id')
39
+ ->order(array('dest_country_id DESC', 'dest_region_id DESC', 'dest_zip DESC', 'condition_value DESC'))
40
+ ->limit(1);
41
+
42
+ // Render destination condition
43
+ $orWhere = '(' . implode(') OR (', array(
44
+ "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = :postcode",
45
+ "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = ''",
46
+
47
+ // Handle asterix in dest_zip field
48
+ "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = '*'",
49
+ "dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = '*'",
50
+ "dest_country_id = '0' AND dest_region_id = :region_id AND dest_zip = '*'",
51
+ "dest_country_id = '0' AND dest_region_id = 0 AND dest_zip = '*'",
52
+
53
+ "dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = ''",
54
+ "dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = :postcode",
55
+ "dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = '*'",
56
+ )) . ')';
57
+ $select->where($orWhere);
58
+
59
+ // Render condition by condition name
60
+ if (is_array($request->getConditionName())) {
61
+ $orWhere = array();
62
+ $i = 0;
63
+ foreach ($request->getConditionName() as $conditionName) {
64
+ $bindNameKey = sprintf(':condition_name_%d', $i);
65
+ $bindValueKey = sprintf(':condition_value_%d', $i);
66
+ $orWhere[] = "(condition_name = {$bindNameKey} AND condition_value <= {$bindValueKey})";
67
+ $bind[$bindNameKey] = $conditionName;
68
+ $bind[$bindValueKey] = $request->getData($conditionName);
69
+ $i++;
70
+ }
71
+
72
+ if ($orWhere) {
73
+ $select->where(implode(' OR ', $orWhere));
74
+ }
75
+ } else {
76
+ $bind[':condition_name'] = $request->getConditionName();
77
+ $bind[':condition_value'] = $request->getData($request->getConditionName());
78
+
79
+ $select->where('condition_name = :condition_name');
80
+ $select->where('condition_value <= :condition_value');
81
+ }
82
+
83
+ $result = $adapter->fetchRow($select, $bind);
84
+ // Normalize destination zip code
85
+ if ($result && $result['dest_zip'] == '*') {
86
+ $result['dest_zip'] = '';
87
+ }
88
+ return $result;
89
+
90
+ } // end
91
+
92
+ } // end
app/code/community/Clearandfizzy/Reducedcheckout/etc/config.xml CHANGED
@@ -20,6 +20,19 @@
20
  <clearandfizzy_reducedcheckout>
21
  <class>Clearandfizzy_Reducedcheckout_Model</class>
22
  </clearandfizzy_reducedcheckout>
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  </models>
24
 
25
  <helpers>
20
  <clearandfizzy_reducedcheckout>
21
  <class>Clearandfizzy_Reducedcheckout_Model</class>
22
  </clearandfizzy_reducedcheckout>
23
+
24
+ <shipping_resource>
25
+ <rewrite>
26
+
27
+
28
+ <carrier_tablerate>Clearandfizzy_ReducedCheckout_Model_Resource_Carrier_TablerateFix</carrier_tablerate>
29
+
30
+
31
+
32
+ </rewrite>
33
+ </shipping_resource>
34
+
35
+
36
  </models>
37
 
38
  <helpers>
app/code/community/Clearandfizzy/Reducedcheckout/etc/system.xml CHANGED
@@ -54,6 +54,7 @@
54
  <li>Allows forced Guest Registration.</li>
55
  <li>Allows forced Payment method.</li>
56
  <li>Allows forced Shipping method.</li>
 
57
  <li>Allows you to setup rules based on Customer groups.</li>
58
  <li><a target="_blank" href="http://www.magentocommerce.com/magento-connect/clearandfizzy-reduced-one-step-checkout-6893.html">http://www.magentocommerce.com/magento-connect/clearandfizzy-reduced-one-step-checkout-6893.html</a>
59
  </ol> ]]></comment>
@@ -80,6 +81,17 @@
80
  <show_in_website>1</show_in_website>
81
  <show_in_store>1</show_in_store>
82
  </isenabled>
 
 
 
 
 
 
 
 
 
 
 
83
 
84
  <guestcheckoutonly>
85
  <label>Force guest checkout only</label>
54
  <li>Allows forced Guest Registration.</li>
55
  <li>Allows forced Payment method.</li>
56
  <li>Allows forced Shipping method.</li>
57
+ <li>Fix for Magento Shipping Tablerates in 1.7.0.2 <a target="_blank" href="http://www.magentocommerce.com/bug-tracking/issue?issue=14069">http://www.magentocommerce.com/bug-tracking/issue?issue=14069</a></li>
58
  <li>Allows you to setup rules based on Customer groups.</li>
59
  <li><a target="_blank" href="http://www.magentocommerce.com/magento-connect/clearandfizzy-reduced-one-step-checkout-6893.html">http://www.magentocommerce.com/magento-connect/clearandfizzy-reduced-one-step-checkout-6893.html</a>
60
  </ol> ]]></comment>
81
  <show_in_website>1</show_in_website>
82
  <show_in_store>1</show_in_store>
83
  </isenabled>
84
+
85
+ <enable28112fix>
86
+ <label>Enable Shipping Tablerates Bug #28112 fix</label>
87
+ <frontend_type>select</frontend_type>
88
+ <source_model>adminhtml/system_config_source_yesno</source_model>
89
+ <comment>Enable fix for Magento bug #28112 Shipping tablerates</comment>
90
+ <sort_order>1</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>1</show_in_store>
94
+ </enable28112fix>
95
 
96
  <guestcheckoutonly>
97
  <label>Force guest checkout only</label>
package.xml CHANGED
@@ -1,15 +1,17 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Clearandfizzy_Reducedcheckout</name>
4
- <version>1.3.2</version>
5
  <stability>stable</stability>
6
- <license uri="http://opensource.org/licenses/afl-3.0.php">AFL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>The standard Magento checkout process but allows you to force payment and shipping methods. </summary>
10
  <description>Extending the standard Magento checkout process this extension allows you reduce the number of steps a customer takes to a minimum, by allowing you to force one type of payment and shipping method within the admin screen and therefore remove these steps from the checkout process. &#xD;
11
  &#xD;
12
- Integration with 3rd-party payment and shipping extensions should be easy as this extension makes no modifications to the base templates.</description>
 
 
13
  <notes>Did we add new features?&lt;br /&gt;&#xD;
14
  Yes&lt;br /&gt;&#xD;
15
  &lt;br /&gt;&#xD;
@@ -17,12 +19,12 @@ 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:38:56</time>
25
- <contents><target name="magecommunity"><dir name="Clearandfizzy"><dir name="Reducedcheckout"><dir name="Helper"><file name="Data.php" hash="957c2c95e91ec3206a0abab3a3dc32f0"/></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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Clearandfizzy_Reducedcheckout</name>
4
+ <version>1.4.0</version>
5
  <stability>stable</stability>
6
+ <license uri="http://creativecommons.org/licenses/by-nd/3.0/">CC BY-ND 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>The standard Magento checkout process but allows you to force payment and shipping methods. </summary>
10
  <description>Extending the standard Magento checkout process this extension allows you reduce the number of steps a customer takes to a minimum, by allowing you to force one type of payment and shipping method within the admin screen and therefore remove these steps from the checkout process. &#xD;
11
  &#xD;
12
+ Integration with 3rd-party payment and shipping extensions should be easy as this extension makes no modifications to the base templates.&#xD;
13
+ &#xD;
14
+ Contains a fix for Magento bug #28112 with regards to Shipping Tablerates.</description>
15
  <notes>Did we add new features?&lt;br /&gt;&#xD;
16
  Yes&lt;br /&gt;&#xD;
17
  &lt;br /&gt;&#xD;
19
  Yes&lt;br /&gt;&#xD;
20
  &lt;br /&gt;&#xD;
21
  Well then, what in funkytown did you do?&lt;br /&gt;&#xD;
22
+ Added a fix for Magento bug #28112 which prevent Shipping Tablerates to work correctly.&lt;br /&gt; &#xD;
23
+ You can enable /disable the fix on the configuration screen.&lt;br /&gt;</notes>
24
  <authors><author><name>Gareth Price</name><user>clearandfizzy</user><email>gareth@clearandfizzy.com</email></author></authors>
25
+ <date>2013-09-08</date>
26
+ <time>22:45:59</time>
27
+ <contents><target name="magecommunity"><dir name="Clearandfizzy"><dir name="Reducedcheckout"><dir name="Helper"><file name="Data.php" hash="23f488e4f752563e3343c6ea02004ac3"/></dir><dir name="Model"><file name="Observer.php" hash="8f4498205db5d37752b3f795816517b4"/><dir name="Resource"><dir name="Carrier"><file name="TablerateFix.php" hash="0a8685c145d95ae76b838d2af2b88638"/></dir></dir><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="a3071a3f2a7c9988ee42b4c72a8f1eb0"/><file name="system.xml" hash="7b3d424939a66fd0a31de7e33f54229b"/></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>
28
  <compatible/>
29
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
30
  </package>