Version Notes
support 1.6.X to 1.9.X
Download this release
Release Info
Developer | Commerce Bees |
Extension | Ameex_Freeshiper |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- CommerceBees_FreeShipping_ByCustomer_Groups_Extension_Guide_V1.0.pdf +0 -0
- app/code/local/Ameex/Freeship/Helper/Data.php +5 -0
- app/code/local/Ameex/Freeship/Model/Carrier/Freeshipment.php +38 -0
- app/code/local/Ameex/Freeship/Model/Source/Customergroupsource.php +17 -0
- app/code/local/Ameex/Freeship/etc/config.xml +32 -0
- app/code/local/Ameex/Freeship/etc/system.xml +108 -0
- app/etc/modules/Ameex_Freeship.xml +13 -0
- package.xml +18 -0
CommerceBees_FreeShipping_ByCustomer_Groups_Extension_Guide_V1.0.pdf
ADDED
Binary file
|
app/code/local/Ameex/Freeship/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ameex_Freeship_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
}
|
5 |
+
|
app/code/local/Ameex/Freeship/Model/Carrier/Freeshipment.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ameex_Freeship_Model_Carrier_Freeshipment extends Mage_Shipping_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface
|
3 |
+
{
|
4 |
+
protected $_code = 'ameex_freeship';
|
5 |
+
public function collectRates(Mage_Shipping_Model_Rate_Request $request) {
|
6 |
+
if (!$this->getConfigFlag('active')) {
|
7 |
+
return false;
|
8 |
+
}
|
9 |
+
$result = Mage::getModel('shipping/rate_result');
|
10 |
+
if(Mage::getSingleton('customer/session')->isLoggedIn()){
|
11 |
+
$groupid=Mage::getSingleton('customer/session')->getCustomerGroupId();
|
12 |
+
}else{
|
13 |
+
$groupid='0';
|
14 |
+
}
|
15 |
+
$customergroupconfigdata=$this->getConfigData('customergroup');
|
16 |
+
$grouparray=explode(',',$customergroupconfigdata);
|
17 |
+
if (($request->getBaseSubtotalInclTax() >= $this->getConfigData('ameex_free_shipping_subtotal') && in_array($groupid,$grouparray))
|
18 |
+
) {
|
19 |
+
$method = Mage::getModel('shipping/rate_result_method');
|
20 |
+
|
21 |
+
$method->setCarrier('freeshipping');
|
22 |
+
$method->setCarrierTitle($this->getConfigData('title'));
|
23 |
+
|
24 |
+
$method->setMethod('freeshipping');
|
25 |
+
$method->setMethodTitle($this->getConfigData('name'));
|
26 |
+
|
27 |
+
$method->setPrice('0.00');
|
28 |
+
$method->setCost('0.00');
|
29 |
+
$result->append($method);
|
30 |
+
}
|
31 |
+
return $result;
|
32 |
+
}
|
33 |
+
public function getAllowedMethods()
|
34 |
+
{
|
35 |
+
return array('ameex_freeship' => $this->getConfigData('name'));
|
36 |
+
}
|
37 |
+
|
38 |
+
}
|
app/code/local/Ameex/Freeship/Model/Source/Customergroupsource.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
Supply customer group name to free shipping
|
4 |
+
*/
|
5 |
+
|
6 |
+
class Ameex_Freeship_Model_Source_Customergroupsource
|
7 |
+
{
|
8 |
+
public function toOptionArray()
|
9 |
+
{
|
10 |
+
$customer_group = new Mage_Customer_Model_Group();
|
11 |
+
$allGroups = $customer_group->getCollection()->toOptionHash();
|
12 |
+
foreach($allGroups as $key=>$allGroup){
|
13 |
+
$customerGroup[$key]=array('value'=>$key,'label'=>$allGroup);
|
14 |
+
}
|
15 |
+
return $customerGroup;
|
16 |
+
}
|
17 |
+
}
|
app/code/local/Ameex/Freeship/etc/config.xml
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Ameex_Freeship>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Ameex_Freeship>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<ameex_freeship>
|
11 |
+
<class>Ameex_Freeship_Model</class>
|
12 |
+
</ameex_freeship>
|
13 |
+
</models>
|
14 |
+
<helpers>
|
15 |
+
<freeship>
|
16 |
+
<class>Ameex_Freeship_Helper</class>
|
17 |
+
</freeship>
|
18 |
+
</helpers>
|
19 |
+
</global>
|
20 |
+
<default>
|
21 |
+
<carriers>
|
22 |
+
<ameex_freeship>
|
23 |
+
<active>1</active>
|
24 |
+
<model>ameex_freeship/carrier_freeshipment</model>
|
25 |
+
<title>Free Shipping Based on Customer Group</title>
|
26 |
+
<name>Free Shipping</name>
|
27 |
+
<ameex_free_shipping_subtotal>50</ameex_free_shipping_subtotal>
|
28 |
+
<description>Free Shipping is Available</description>
|
29 |
+
</ameex_freeship>
|
30 |
+
</carriers>
|
31 |
+
</default>
|
32 |
+
</config>
|
app/code/local/Ameex/Freeship/etc/system.xml
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<carriers translate="label" module="shipping">
|
5 |
+
<groups>
|
6 |
+
<ameex_freeship translate="label">
|
7 |
+
<label>Free Shipping For Customer Groups- By commercebees.com</label>
|
8 |
+
<frontend_type>text</frontend_type>
|
9 |
+
<sort_order>0</sort_order>
|
10 |
+
<show_in_default>1</show_in_default>
|
11 |
+
<show_in_website>1</show_in_website>
|
12 |
+
<show_in_store>1</show_in_store>
|
13 |
+
<fields>
|
14 |
+
<active translate="label">
|
15 |
+
<label>Enabled</label>
|
16 |
+
<frontend_type>select</frontend_type>
|
17 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
18 |
+
<sort_order>1</sort_order>
|
19 |
+
<show_in_default>1</show_in_default>
|
20 |
+
<show_in_website>1</show_in_website>
|
21 |
+
<show_in_store>1</show_in_store>
|
22 |
+
</active>
|
23 |
+
<title translate="label">
|
24 |
+
<label>Title</label>
|
25 |
+
<frontend_type>text</frontend_type>
|
26 |
+
<sort_order>2</sort_order>
|
27 |
+
<show_in_default>1</show_in_default>
|
28 |
+
<show_in_website>1</show_in_website>
|
29 |
+
<show_in_store>1</show_in_store>
|
30 |
+
</title>
|
31 |
+
<name translate="label">
|
32 |
+
<label>Method Name</label>
|
33 |
+
<frontend_type>text</frontend_type>
|
34 |
+
<sort_order>3</sort_order>
|
35 |
+
<show_in_default>1</show_in_default>
|
36 |
+
<show_in_website>1</show_in_website>
|
37 |
+
<show_in_store>1</show_in_store>
|
38 |
+
</name>
|
39 |
+
<description translate="label">
|
40 |
+
<label>Description</label>
|
41 |
+
<frontend_type>textarea</frontend_type>
|
42 |
+
<sort_order>76</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
</description>
|
47 |
+
<ameex_free_shipping_subtotal translate="label">
|
48 |
+
<label>Minimum Order Amount</label>
|
49 |
+
<frontend_type>text</frontend_type>
|
50 |
+
<validate>validate-number validate-zero-or-greater</validate>
|
51 |
+
<sort_order>4</sort_order>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>0</show_in_store>
|
55 |
+
</ameex_free_shipping_subtotal>
|
56 |
+
<sallowspecific translate="label">
|
57 |
+
<label>Ship to Applicable Countries</label>
|
58 |
+
<frontend_type>select</frontend_type>
|
59 |
+
<sort_order>90</sort_order>
|
60 |
+
<frontend_class>shipping-applicable-country</frontend_class>
|
61 |
+
<source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
|
62 |
+
<show_in_default>1</show_in_default>
|
63 |
+
<show_in_website>1</show_in_website>
|
64 |
+
<show_in_store>0</show_in_store>
|
65 |
+
</sallowspecific>
|
66 |
+
<specificcountry translate="label">
|
67 |
+
<label>Ship to Specific Countries</label>
|
68 |
+
<frontend_type>multiselect</frontend_type>
|
69 |
+
<sort_order>91</sort_order>
|
70 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
71 |
+
<show_in_default>1</show_in_default>
|
72 |
+
<show_in_website>1</show_in_website>
|
73 |
+
<show_in_store>0</show_in_store>
|
74 |
+
<can_be_empty>1</can_be_empty>
|
75 |
+
</specificcountry>
|
76 |
+
<specificerrmsg translate="label">
|
77 |
+
<label>Displayed Error Message</label>
|
78 |
+
<frontend_type>textarea</frontend_type>
|
79 |
+
<sort_order>80</sort_order>
|
80 |
+
<show_in_default>1</show_in_default>
|
81 |
+
<show_in_website>1</show_in_website>
|
82 |
+
<show_in_store>1</show_in_store>
|
83 |
+
</specificerrmsg>
|
84 |
+
<customergroup translate="label">
|
85 |
+
<label>Show Free Shipping For Customer Groups</label>
|
86 |
+
<frontend_type>multiselect</frontend_type>
|
87 |
+
<sort_order>99</sort_order>
|
88 |
+
<source_model>ameex_freeship/source_customergroupsource</source_model>
|
89 |
+
<show_in_default>1</show_in_default>
|
90 |
+
<show_in_website>1</show_in_website>
|
91 |
+
<show_in_store>1</show_in_store>
|
92 |
+
<can_be_empty>1</can_be_empty>
|
93 |
+
</customergroup>
|
94 |
+
<sort_order translate="label">
|
95 |
+
<label>Sort Order</label>
|
96 |
+
<frontend_type>text</frontend_type>
|
97 |
+
<sort_order>100</sort_order>
|
98 |
+
<show_in_default>1</show_in_default>
|
99 |
+
<show_in_website>1</show_in_website>
|
100 |
+
<show_in_store>1</show_in_store>
|
101 |
+
<sort_order>100</sort_order>
|
102 |
+
</sort_order>
|
103 |
+
</fields>
|
104 |
+
</ameex_freeship>
|
105 |
+
</groups>
|
106 |
+
</carriers>
|
107 |
+
</sections>
|
108 |
+
</config>
|
app/etc/modules/Ameex_Freeship.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Ameex_Freeship>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
<depends>
|
8 |
+
<Mage_Shipping />
|
9 |
+
</depends>
|
10 |
+
<version>0.1.0</version>
|
11 |
+
</Ameex_Freeship>
|
12 |
+
</modules>
|
13 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Ameex_Freeshiper</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Allow Free shipping based upon customer group</summary>
|
10 |
+
<description>This extension allow store owner to provide free shipping based on customer groups</description>
|
11 |
+
<notes>support 1.6.X to 1.9.X</notes>
|
12 |
+
<authors><author><name>commercebees</name><user>CommerceBees</user><email>support@commercebees.com</email></author></authors>
|
13 |
+
<date>2014-06-27</date>
|
14 |
+
<time>08:39:45</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Ameex"><dir name="Freeship"><dir name="Helper"><file name="Data.php" hash="3d0c5d1473bb03ad6b99477d44535dd7"/></dir><dir name="Model"><dir name="Carrier"><file name="Freeshipment.php" hash="93cc4d1954229bdb3983239d82c6ec96"/></dir><dir name="Source"><file name="Customergroupsource.php" hash="753739a45b8cf141959638505cc2c92f"/></dir></dir><dir name="etc"><file name="config.xml" hash="faca3a1726555aef9e9dabfc5111c793"/><file name="system.xml" hash="f013dda998f8a81882fa93ed78df477b"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ameex_Freeship.xml" hash="2c7608db4be978ee6b043c3ff8f76c2b"/></dir></target><target name="mage"><dir name="."><file name="CommerceBees_FreeShipping_ByCustomer_Groups_Extension_Guide_V1.0.pdf" hash="c2cb5cb98c6989f5cd6370e49ad30a31"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|