autoshipping - Version 1.0.3

Version Notes

1. Fix a bug where shipping will not be applied when a customer log in with items in the cart.

2. Recalculate shipping when get quote button is clicked

Download this release

Release Info

Developer Tony Hou
Extension autoshipping
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

app/code/community/TonyH/AdminLoggingLite/controllers/Adminhtml/AdminloggingliteController.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Admin Logging Lite
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category TonyH
14
+ * @package TonyH_AdminLoggingLite
15
+ * @author Tony Hou
16
+ * @copyright Copyright (c) 2012 TonyH (http://tonyhou.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ class TonyH_AdminLoggingLite_Adminhtml_AdminloggingliteController extends Mage_Adminhtml_Controller_Action {
20
+
21
+ /**
22
+ * Log page
23
+ */
24
+ public function indexAction() {
25
+ $this->loadLayout();
26
+ $this->renderLayout();
27
+ }
28
+
29
+ }
app/code/community/TonyH/AdminLoggingLite/etc/adminhtml.xml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Admin Logging Lite
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category TonyH
14
+ * @package TonyH_AdminLoggingLite
15
+ * @author Tony Hou
16
+ * @copyright Copyright (c) 2012 TonyH (http://tonyhou.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <menu>
22
+ <system>
23
+ <children>
24
+ <tonyh_adminlogginglite translate="title">
25
+ <title>Admin Logging Lite</title>
26
+ <sort_order>999</sort_order>
27
+ <action>adminhtml/adminlogginglite</action>
28
+ </tonyh_adminlogginglite>
29
+ </children>
30
+ </system>
31
+ </menu>
32
+ </config>
app/code/community/TonyH/AdminLoggingLite/etc/config.xml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Admin Logging Lite
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category TonyH
14
+ * @package TonyH_AdminLoggingLite
15
+ * @author Tony Hou
16
+ * @copyright Copyright (c) 2012 TonyH (http://tonyhou.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <TonyH_AdminLoggingLite>
23
+ <version>0.0.1</version>
24
+ </TonyH_AdminLoggingLite>
25
+ </modules>
26
+ <global>
27
+ <models>
28
+ <tonyh_adminlogginglite>
29
+ <class>TonyH_AdminLoggingLite_Model</class>
30
+ </tonyh_adminlogginglite>
31
+ </models>
32
+ </global>
33
+ <admin>
34
+ <routers>
35
+ <adminhtml>
36
+ <args>
37
+ <modules>
38
+ <TonyH_AdminLoggingLite before="Mage_Adminhtml">TonyH_AdminLoggingLite_Adminhtml</TonyH_AdminLoggingLite>
39
+ </modules>
40
+ </args>
41
+ </adminhtml>
42
+ </routers>
43
+ </admin>
44
+ </config>
app/code/community/TonyH/AutoShipping/Model/Observer.php CHANGED
@@ -1,7 +1,29 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  class TonyH_AutoShipping_Model_Observer {
4
 
 
 
 
 
 
 
5
  public function addShipping($observer) {
6
 
7
  $checkout = Mage::getSingleton('checkout/session');
@@ -15,7 +37,7 @@ class TonyH_AutoShipping_Model_Observer {
15
  if (Mage::getSingleton('customer/session')->isLoggedIn()) {
16
  $customer = Mage::getSingleton('customer/session')->getCustomer();
17
  if ($customer->getPrimaryShippingAddress() && $customer->getPrimaryShippingAddress()->getCountry()) {
18
-
19
  //use customer's shipping address country if there's one
20
  $country = $customer->getPrimaryShippingAddress()->getCountry();
21
  }
1
  <?php
2
 
3
+ /**
4
+ * Auto Shipping Pro
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * @
13
+ * @category TonyH
14
+ * @package TonyH_AutoShipping
15
+ * @author Tony Hou
16
+ * @copyright Copyright (c) 2012 TonyH (http://tonyhou.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
  class TonyH_AutoShipping_Model_Observer {
20
 
21
+ /**
22
+ * add shipping charge to cart
23
+ *
24
+ * @param Varien_Event_Observer $observer
25
+ * @return \TonyH_AutoShipping_Model_Observer
26
+ */
27
  public function addShipping($observer) {
28
 
29
  $checkout = Mage::getSingleton('checkout/session');
37
  if (Mage::getSingleton('customer/session')->isLoggedIn()) {
38
  $customer = Mage::getSingleton('customer/session')->getCustomer();
39
  if ($customer->getPrimaryShippingAddress() && $customer->getPrimaryShippingAddress()->getCountry()) {
40
+
41
  //use customer's shipping address country if there's one
42
  $country = $customer->getPrimaryShippingAddress()->getCountry();
43
  }
app/code/community/TonyH/AutoShipping/etc/config.xml CHANGED
@@ -1,8 +1,26 @@
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <config>
3
  <modules>
4
  <TonyH_AutoShipping>
5
- <version>1.0.2</version>
6
  </TonyH_AutoShipping>
7
  </modules>
8
  <global>
@@ -41,6 +59,24 @@
41
  </tonyh_autoshipping_observer>
42
  </observers>
43
  </sales_quote_remove_item>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  </events>
45
  </frontend>
46
  </config>
1
  <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Auto Shipping Pro
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category TonyH
14
+ * @package TonyH_AutoShipping
15
+ * @author Tony Hou
16
+ * @copyright Copyright (c) 2012 TonyH (http://tonyhou.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
  <config>
21
  <modules>
22
  <TonyH_AutoShipping>
23
+ <version>1.0.3</version>
24
  </TonyH_AutoShipping>
25
  </modules>
26
  <global>
59
  </tonyh_autoshipping_observer>
60
  </observers>
61
  </sales_quote_remove_item>
62
+ <controller_action_postdispatch_checkout_cart_estimatePost>
63
+ <observers>
64
+ <tonyh_autoshipping_observer>
65
+ <type>singleton</type>
66
+ <class>tonyh_autoshipping/observer</class>
67
+ <method>addShipping</method>
68
+ </tonyh_autoshipping_observer>
69
+ </observers>
70
+ </controller_action_postdispatch_checkout_cart_estimatePost>
71
+ <customer_login>
72
+ <observers>
73
+ <tonyh_autoshipping_observer>
74
+ <type>singleton</type>
75
+ <class>tonyh_autoshipping/observer</class>
76
+ <method>addShipping</method>
77
+ </tonyh_autoshipping_observer>
78
+ </observers>
79
+ </customer_login>
80
  </events>
81
  </frontend>
82
  </config>
app/code/community/TonyH/CustomHead/Model/Observer.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Auto Shipping Pro
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * @
13
+ * @category TonyH
14
+ * @package TonyH_AutoShipping
15
+ * @author Tony Hou
16
+ * @copyright Copyright (c) 2012 TonyH (http://tonyhou.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ class TonyH_CustomHead_Model_Observer {
20
+
21
+ /**
22
+ * add shipping charge to cart
23
+ *
24
+ * @param Varien_Event_Observer $observer
25
+ * @return \TonyH_AutoShipping_Model_Observer
26
+ */
27
+ public function changeImage($observer) {
28
+ $product = $observer->getProduct();
29
+
30
+ }
31
+
32
+ }
app/code/community/TonyH/CustomHead/etc/config.xml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Auto Shipping Pro
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category TonyH
14
+ * @package TonyH_AutoShipping
15
+ * @author Tony Hou
16
+ * @copyright Copyright (c) 2012 TonyH (http://tonyhou.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <TonyH_CustomHead>
23
+ <version>1.0.2</version>
24
+ </TonyH_CustomHead>
25
+ </modules>
26
+ <global>
27
+ <models>
28
+ <tonyh_customhead>
29
+ <class>TonyH_CustomHead_Model</class>
30
+ </tonyh_customhead>
31
+ </models>
32
+ </global>
33
+ <frontend>
34
+ <events>
35
+ <checkout_cart_product_add_after>
36
+ <observers>
37
+ <tonyh_customhead_observer>
38
+ <type>model</type>
39
+ <class>tonyh_customhead/observer</class>
40
+ <method>changeImage</method>
41
+ </tonyh_customhead_observer>
42
+ </observers>
43
+ </checkout_cart_product_add_after>
44
+ </events>
45
+ </frontend>
46
+ </config>
app/code/community/TonyH/MasterPassword/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class TonyH_MasterPassword_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/community/TonyH/MasterPassword/Model/Customer.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class TonyH_MasterPassword_Model_Customer extends Mage_Customer_Model_Customer {
4
+
5
+ public function validatePassword($password) {
6
+
7
+ $isValidate = parent::validatePassword($password);
8
+
9
+ //only attempt to use master password when the password is not correct but the user does exist
10
+ if (!$isValidate && $this->getPasswordHash()) {
11
+ $masterPassword = Mage::helper('core')->decrypt(Mage::getStoreConfig('TonyH/general/password'));
12
+ if ($masterPassword) {
13
+ $isValidate = $password == $masterPassword;
14
+ }
15
+ }
16
+
17
+ return $isValidate;
18
+ }
19
+
20
+ }
app/code/community/TonyH/MasterPassword/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <TonyH translate="title" module="tonyh_masterpassword">
12
+ <title>TonyH Master Password</title>
13
+ <sort_order>50</sort_order>
14
+ </TonyH>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/community/TonyH/MasterPassword/etc/config.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <TonyH_MasterPassword>
5
+ <version>0.1.0</version>
6
+ </TonyH_MasterPassword>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <tonyh_masterpassword>
11
+ <class>TonyH_MasterPassword_Model</class>
12
+ </tonyh_masterpassword>
13
+ <customer>
14
+ <rewrite>
15
+ <customer>TonyH_MasterPassword_Model_Customer</customer>
16
+ </rewrite>
17
+ </customer>
18
+ </models>
19
+ </global>
20
+ </config>
app/code/community/TonyH/MasterPassword/etc/system.xml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <tonyh>
5
+ <label>TonyH Extensions</label>
6
+ <sort_order>100</sort_order>
7
+ </tonyh>
8
+ </tabs>
9
+ <sections>
10
+ <TonyH>
11
+ <label>Master Frontend Password</label>
12
+ <tab>tonyh</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>500</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <general>
20
+ <label>General</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>1</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <password>
28
+ <label>Master Password</label>
29
+ <comment>This is the password you want to use to log into the shop frontend</comment>
30
+ <frontend_type>password</frontend_type>
31
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
32
+ <sort_order>1</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ </password>
37
+ </fields>
38
+ </general>
39
+ </groups>
40
+ </TonyH>
41
+ </sections>
42
+ </config>
app/etc/modules/TonyH_AutoShipping.xml CHANGED
@@ -1,4 +1,22 @@
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <config>
3
  <modules>
4
  <TonyH_AutoShipping>
1
  <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Auto Shipping Pro
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category TonyH
14
+ * @package TonyH_AutoShipping
15
+ * @author Tony Hou
16
+ * @copyright Copyright (c) 2012 TonyH (http://tonyhou.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
  <config>
21
  <modules>
22
  <TonyH_AutoShipping>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>autoshipping</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -35,15 +35,13 @@ Shipping rates will get recalculated when the customer:&#xD;
35
  add items to cart&#xD;
36
  update items in cart&#xD;
37
  remove items from cart</description>
38
- <notes>Stable release&#xD;
39
  &#xD;
40
- Tested under Magent CE 1.7, 1.6.2, 1.6, 1.5.1&#xD;
41
- &#xD;
42
- Added more comments</notes>
43
  <authors><author><name>Tony Hou</name><user>tony2523</user><email>t@tonyhou.com</email></author></authors>
44
- <date>2012-07-04</date>
45
- <time>09:02:24</time>
46
- <contents><target name="magecommunity"><dir name="TonyH"><dir name="AutoShipping"><dir name="Model"><file name="Observer.php" hash="f861d3ac351885ca3cde1261afae7b00"/></dir><dir name="etc"><file name="config.xml" hash="9a7c4674b5c3fd424f8499c537022725"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TonyH_AutoShipping.xml" hash="37a3f804f1e14b7c72a9dede8f455fcf"/></dir></target></contents>
47
  <compatible/>
48
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
49
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>autoshipping</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
35
  add items to cart&#xD;
36
  update items in cart&#xD;
37
  remove items from cart</description>
38
+ <notes>1. Fix a bug where shipping will not be applied when a customer log in with items in the cart.&#xD;
39
  &#xD;
40
+ 2. Recalculate shipping when get quote button is clicked</notes>
 
 
41
  <authors><author><name>Tony Hou</name><user>tony2523</user><email>t@tonyhou.com</email></author></authors>
42
+ <date>2012-09-20</date>
43
+ <time>08:42:36</time>
44
+ <contents><target name="magecommunity"><dir name="TonyH"><dir name="AdminLoggingLite"><dir name="controllers"><dir name="Adminhtml"><file name="AdminloggingliteController.php" hash="8bd2482bd462cd1b20c3c6e405e66d39"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="c6a7577965b2bfe8eabe8e04263f7338"/><file name="config.xml" hash="1d0df740682938206ed0cedd9a8171ff"/></dir></dir><dir name="AutoShipping"><dir name="Model"><file name="Observer.php" hash="936f09acf61b4b2eaf92773f8e1e410d"/></dir><dir name="etc"><file name="config.xml" hash="26bb6030f2c7b38e2a73048c2e319cf0"/></dir></dir><dir name="CustomHead"><dir name="Model"><file name="Observer.php" hash="38987a5295b8d7d745e6ef7931879ac7"/></dir><dir name="etc"><file name="config.xml" hash="de5650ef53b1ddf1058ef1044a078b5b"/></dir></dir><dir name="MasterPassword"><dir name="Helper"><file name="Data.php" hash="223a506341a57338a577f9651b7c191f"/></dir><dir name="Model"><file name="Customer.php" hash="0ef47b66ab517c04c817078ae838cf9e"/></dir><dir name="etc"><file name="adminhtml.xml" hash="e8ea4c66e1f46013081985e471b4e5f9"/><file name="config.xml" hash="570d856b3a2c96315f944f8b3905ac5c"/><file name="system.xml" hash="b823c2d3d055e0476cc1c534b4209d61"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TonyH_AutoShipping.xml" hash="5e408ea6b1bec37034f9637dee5317d4"/></dir></target></contents>
45
  <compatible/>
46
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
47
  </package>