Version Notes
Rush Shipping extension will add extra feature to normal shipping methods.
Download this release
Release Info
Developer | Magento Core Team |
Extension | Mage_Rush |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
app/code/local/Mage/Rush/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mage_Rush_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
}
|
app/code/local/Mage/Rush/Model/Carrier/Rush.php
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mage_Rush_Model_Carrier_Rush extends Mage_Shipping_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface
|
3 |
+
{
|
4 |
+
|
5 |
+
protected $_code = 'rush';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Enter description here...
|
9 |
+
*
|
10 |
+
* @param Mage_Shipping_Model_Rate_Request $data
|
11 |
+
* @return Mage_Shipping_Model_Rate_Result
|
12 |
+
*/
|
13 |
+
public function collectRates(Mage_Shipping_Model_Rate_Request $request)
|
14 |
+
{
|
15 |
+
if (!$this->getConfigFlag('active')) {
|
16 |
+
return false;
|
17 |
+
}
|
18 |
+
|
19 |
+
$freeBoxes = 0;
|
20 |
+
if ($request->getAllItems()) {
|
21 |
+
foreach ($request->getAllItems() as $item) {
|
22 |
+
|
23 |
+
if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
|
24 |
+
continue;
|
25 |
+
}
|
26 |
+
|
27 |
+
if ($item->getHasChildren() && $item->isShipSeparately()) {
|
28 |
+
foreach ($item->getChildren() as $child) {
|
29 |
+
if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {
|
30 |
+
$freeBoxes += $item->getQty() * $child->getQty();
|
31 |
+
}
|
32 |
+
}
|
33 |
+
} elseif ($item->getFreeShipping()) {
|
34 |
+
$freeBoxes += $item->getQty();
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
$this->setFreeBoxes($freeBoxes);
|
39 |
+
|
40 |
+
$result = Mage::getModel('shipping/rate_result');
|
41 |
+
if ($this->getConfigData('type') == 'O') { // per order
|
42 |
+
$shippingPrice = $this->getConfigData('price');
|
43 |
+
} elseif ($this->getConfigData('type') == 'I') { // per item
|
44 |
+
$shippingPrice = ($request->getPackageQty() * $this->getConfigData('price')) - ($this->getFreeBoxes() * $this->getConfigData('price'));
|
45 |
+
} else {
|
46 |
+
$shippingPrice = false;
|
47 |
+
}
|
48 |
+
|
49 |
+
$shippingPrice = $this->getFinalPriceWithHandlingFee($shippingPrice);
|
50 |
+
|
51 |
+
if ($shippingPrice !== false) {
|
52 |
+
$method = Mage::getModel('shipping/rate_result_method');
|
53 |
+
|
54 |
+
$method->setCarrier('rush');
|
55 |
+
$method->setCarrierTitle($this->getConfigData('title'));
|
56 |
+
|
57 |
+
$method->setMethod('rush');
|
58 |
+
$method->setMethodTitle($this->getConfigData('name'));
|
59 |
+
|
60 |
+
if ($request->getFreeShipping() === true || $request->getPackageQty() == $this->getFreeBoxes()) {
|
61 |
+
$shippingPrice = '0.00';
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
$method->setPrice($shippingPrice);
|
66 |
+
$method->setCost($shippingPrice);
|
67 |
+
|
68 |
+
$result->append($method);
|
69 |
+
}
|
70 |
+
|
71 |
+
return $result;
|
72 |
+
}
|
73 |
+
|
74 |
+
public function getAllowedMethods()
|
75 |
+
{
|
76 |
+
return array('rush'=>$this->getConfigData('name'));
|
77 |
+
}
|
78 |
+
}
|
app/code/local/Mage/Rush/etc/config.xml
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mage_Rush>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
<!--<depends>
|
7 |
+
<Mage_Shipping/>
|
8 |
+
</depends>-->
|
9 |
+
</Mage_Rush>
|
10 |
+
</modules>
|
11 |
+
<global>
|
12 |
+
<models>
|
13 |
+
<rush>
|
14 |
+
<class>Mage_Rush_Model</class>
|
15 |
+
</rush>
|
16 |
+
</models>
|
17 |
+
|
18 |
+
<!--<resources>
|
19 |
+
<shipflat_setup>
|
20 |
+
<setup>
|
21 |
+
<module>Mage_Shipflat</module>
|
22 |
+
</setup>
|
23 |
+
<connection>
|
24 |
+
<use>core_setup</use>
|
25 |
+
</connection>
|
26 |
+
</shipflat_setup>
|
27 |
+
</resources>-->
|
28 |
+
</global>
|
29 |
+
|
30 |
+
|
31 |
+
<!--<adminhtml>
|
32 |
+
<translate>
|
33 |
+
<modules>
|
34 |
+
<Mage_Shipflat>
|
35 |
+
<files>
|
36 |
+
<default>Mage_Shipping.csv</default>
|
37 |
+
</files>
|
38 |
+
</Mage_Shipflat>
|
39 |
+
</modules>
|
40 |
+
</translate>
|
41 |
+
</adminhtml>-->
|
42 |
+
<frontend>
|
43 |
+
|
44 |
+
|
45 |
+
</frontend>
|
46 |
+
<default>
|
47 |
+
<carriers>
|
48 |
+
<rush>
|
49 |
+
<active>1</active>
|
50 |
+
<sallowspecific>0</sallowspecific>
|
51 |
+
<model>rush/carrier_rush</model>
|
52 |
+
<name>Rush</name>
|
53 |
+
<days>2</days>
|
54 |
+
<price>5.00</price>
|
55 |
+
<title>Rush Shipping</title>
|
56 |
+
<type>I</type>
|
57 |
+
<specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg>
|
58 |
+
<handling_type>F</handling_type>
|
59 |
+
</rush>
|
60 |
+
</carriers>
|
61 |
+
</default>
|
62 |
+
</config>
|
63 |
+
|
app/code/local/Mage/Rush/etc/system.xml
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<carriers translate="label" module="rush">
|
5 |
+
<label>Shipping Methods</label>
|
6 |
+
<tab>sales</tab>
|
7 |
+
<frontend_type>text</frontend_type>
|
8 |
+
<sort_order>320</sort_order>
|
9 |
+
<show_in_default>1</show_in_default>
|
10 |
+
<show_in_website>1</show_in_website>
|
11 |
+
<show_in_store>1</show_in_store>
|
12 |
+
<groups>
|
13 |
+
<rush translate="label">
|
14 |
+
<label>Rush Shipping</label>
|
15 |
+
<frontend_type>text</frontend_type>
|
16 |
+
<sort_order>50</sort_order>
|
17 |
+
<show_in_default>1</show_in_default>
|
18 |
+
<show_in_website>1</show_in_website>
|
19 |
+
<show_in_store>1</show_in_store>
|
20 |
+
<fields>
|
21 |
+
<active translate="label">
|
22 |
+
<label>Enabled</label>
|
23 |
+
<frontend_type>select</frontend_type>
|
24 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
25 |
+
<sort_order>1</sort_order>
|
26 |
+
<show_in_default>1</show_in_default>
|
27 |
+
<show_in_website>1</show_in_website>
|
28 |
+
<show_in_store>0</show_in_store>
|
29 |
+
</active>
|
30 |
+
<name translate="label">
|
31 |
+
<label>Method name</label>
|
32 |
+
<frontend_type>text</frontend_type>
|
33 |
+
<sort_order>3</sort_order>
|
34 |
+
<show_in_default>1</show_in_default>
|
35 |
+
<show_in_website>1</show_in_website>
|
36 |
+
<show_in_store>1</show_in_store>
|
37 |
+
</name>
|
38 |
+
<model translate="label">
|
39 |
+
<label>Model</label>
|
40 |
+
<frontend_type>text</frontend_type>
|
41 |
+
<sort_order>3</sort_order>
|
42 |
+
<show_in_default>1</show_in_default>
|
43 |
+
<show_in_website>1</show_in_website>
|
44 |
+
<show_in_store>1</show_in_store>
|
45 |
+
</model>
|
46 |
+
<days translate="label">
|
47 |
+
<label>Days</label>
|
48 |
+
<frontend_type>text</frontend_type>
|
49 |
+
<sort_order>4</sort_order>
|
50 |
+
<show_in_default>1</show_in_default>
|
51 |
+
<show_in_website>1</show_in_website>
|
52 |
+
<show_in_store>1</show_in_store>
|
53 |
+
</days>
|
54 |
+
<price translate="label">
|
55 |
+
<label>Price</label>
|
56 |
+
<frontend_type>text</frontend_type>
|
57 |
+
<sort_order>5</sort_order>
|
58 |
+
<show_in_default>1</show_in_default>
|
59 |
+
<show_in_website>1</show_in_website>
|
60 |
+
<show_in_store>0</show_in_store>
|
61 |
+
</price>
|
62 |
+
<handling_type translate="label">
|
63 |
+
<label>Calculate Handling Fee</label>
|
64 |
+
<frontend_type>select</frontend_type>
|
65 |
+
<source_model>shipping/source_handlingType</source_model>
|
66 |
+
<sort_order>7</sort_order>
|
67 |
+
<show_in_default>1</show_in_default>
|
68 |
+
<show_in_website>1</show_in_website>
|
69 |
+
<show_in_store>0</show_in_store>
|
70 |
+
</handling_type>
|
71 |
+
<handling_fee translate="label">
|
72 |
+
<label>Handling Fee</label>
|
73 |
+
<frontend_type>text</frontend_type>
|
74 |
+
<sort_order>8</sort_order>
|
75 |
+
<show_in_default>1</show_in_default>
|
76 |
+
<show_in_website>1</show_in_website>
|
77 |
+
<show_in_store>0</show_in_store>
|
78 |
+
</handling_fee>
|
79 |
+
<sort_order translate="label">
|
80 |
+
<label>Sort order</label>
|
81 |
+
<frontend_type>text</frontend_type>
|
82 |
+
<sort_order>100</sort_order>
|
83 |
+
<show_in_default>1</show_in_default>
|
84 |
+
<show_in_website>1</show_in_website>
|
85 |
+
<show_in_store>0</show_in_store>
|
86 |
+
</sort_order>
|
87 |
+
<title translate="label">
|
88 |
+
<label>Title</label>
|
89 |
+
<frontend_type>text</frontend_type>
|
90 |
+
<sort_order>2</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 |
+
</title>
|
95 |
+
<type translate="label">
|
96 |
+
<label>Type</label>
|
97 |
+
<frontend_type>select</frontend_type>
|
98 |
+
<source_model>adminhtml/system_config_source_shipping_flatrate</source_model>
|
99 |
+
<sort_order>4</sort_order>
|
100 |
+
<show_in_default>1</show_in_default>
|
101 |
+
<show_in_website>1</show_in_website>
|
102 |
+
<show_in_store>0</show_in_store>
|
103 |
+
</type>
|
104 |
+
<sallowspecific translate="label">
|
105 |
+
<label>Ship to applicable countries</label>
|
106 |
+
<frontend_type>select</frontend_type>
|
107 |
+
<sort_order>90</sort_order>
|
108 |
+
<frontend_class>shipping-applicable-country</frontend_class>
|
109 |
+
<source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
|
110 |
+
<show_in_default>1</show_in_default>
|
111 |
+
<show_in_website>1</show_in_website>
|
112 |
+
<show_in_store>0</show_in_store>
|
113 |
+
</sallowspecific>
|
114 |
+
<specificcountry translate="label">
|
115 |
+
<label>Ship to Specific countries</label>
|
116 |
+
<frontend_type>multiselect</frontend_type>
|
117 |
+
<sort_order>91</sort_order>
|
118 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
119 |
+
<show_in_default>1</show_in_default>
|
120 |
+
<show_in_website>1</show_in_website>
|
121 |
+
<show_in_store>0</show_in_store>
|
122 |
+
<can_be_empty>1</can_be_empty>
|
123 |
+
</specificcountry>
|
124 |
+
<showmethod translate="label">
|
125 |
+
<label>Show method if not applicable</label>
|
126 |
+
<frontend_type>select</frontend_type>
|
127 |
+
<sort_order>92</sort_order>
|
128 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
129 |
+
<show_in_default>1</show_in_default>
|
130 |
+
<show_in_website>1</show_in_website>
|
131 |
+
<show_in_store>0</show_in_store>
|
132 |
+
</showmethod>
|
133 |
+
<specificerrmsg translate="label">
|
134 |
+
<label>Displayed Error Message</label>
|
135 |
+
<frontend_type>textarea</frontend_type>
|
136 |
+
<sort_order>80</sort_order>
|
137 |
+
<show_in_default>1</show_in_default>
|
138 |
+
<show_in_website>1</show_in_website>
|
139 |
+
<show_in_store>1</show_in_store>
|
140 |
+
</specificerrmsg>
|
141 |
+
</fields>
|
142 |
+
</rush>
|
143 |
+
</groups>
|
144 |
+
</carriers>
|
145 |
+
</sections>
|
146 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Mage_Rush</name>
|
4 |
+
<version>1.0.0</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>
|
8 |
+
<extends/>
|
9 |
+
<summary>Rush Shipping extension will add extra feature to normal shipping methods.</summary>
|
10 |
+
<description>"Rush Shipping extension will add extra feature to normal shipping methode. Extra features are :
|
11 |
+
1) Admin can set the separate time schedule for shipping and rate.
|
12 |
+
2) for example : Within 5 days, then it will treat as Rush Shipping and charge for this will be set from admin part in the magento. Admin can change the delivery day limit also.
|
13 |
+
3) In same way admin can set days slab and price to be charged for that.
|
14 |
+
"</description>
|
15 |
+
<notes>Rush Shipping extension will add extra feature to normal shipping methods.</notes>
|
16 |
+
<authors><author><name>SBOeConnect.com</name><user>auto-converted</user><email>sboeconnect@insync.co.in</email></author></authors>
|
17 |
+
<date>2010-09-03</date>
|
18 |
+
<time>08:43:28</time>
|
19 |
+
<contents><target name="magelocal"><dir name="Mage"><dir name="Rush"><dir name="etc"><file name="config.xml" hash="49964a4370f36a74291c027dcaebb4e5"/><file name="system.xml" hash="d37deec4d27e370ea5deba3d5f771e84"/></dir><dir name="Helper"><file name="Data.php" hash="75b1099a7cc029a1ee2f8a0534e05291"/></dir><dir name="Model"><dir name="Carrier"><file name="Rush.php" hash="1e3ac8cd9080b0d6e123e8c28fd739fd"/></dir></dir></dir></dir></target></contents>
|
20 |
+
<compatible/>
|
21 |
+
<dependencies/>
|
22 |
+
</package>
|