Version Notes
First release
Download this release
Release Info
| Developer | Mitesh Prajapati |
| Extension | fixed_shipping_method |
| Version | 1.0.0.0 |
| Comparing to | |
| See all releases | |
Version 1.0.0.0
- app/code/local/Infinity/Ship/Block/Ship.php +5 -0
- app/code/local/Infinity/Ship/Helper/Data.php +6 -0
- app/code/local/Infinity/Ship/Model/Carrier/Infinity.php +44 -0
- app/code/local/Infinity/Ship/controllers/IndexController.php +5 -0
- app/code/local/Infinity/Ship/etc/config.xml +84 -0
- app/code/local/Infinity/Ship/etc/system.xml +80 -0
- app/etc/modules/Infinity_Ship.xml +9 -0
- package.xml +20 -0
app/code/local/Infinity/Ship/Block/Ship.php
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Infinity_Ship_Block_Ship extends Mage_Core_Block_Template
|
| 3 |
+
{
|
| 4 |
+
|
| 5 |
+
}
|
app/code/local/Infinity/Ship/Helper/Data.php
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Infinity_Ship_Helper_Data extends Mage_Core_Helper_Abstract
|
| 4 |
+
{
|
| 5 |
+
|
| 6 |
+
}
|
app/code/local/Infinity/Ship/Model/Carrier/Infinity.php
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Infinity_Ship_Model_Carrier_Infinity extends Mage_Shipping_Model_Carrier_Abstract
|
| 3 |
+
implements Mage_Shipping_Model_Carrier_Interface {
|
| 4 |
+
protected $_code = 'infinity';
|
| 5 |
+
|
| 6 |
+
public function collectRates(Mage_Shipping_Model_Rate_Request $request)
|
| 7 |
+
{
|
| 8 |
+
if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
|
| 9 |
+
return false;
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
$price = 0;
|
| 13 |
+
$price = $this->getConfigData('price');
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
$handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
|
| 18 |
+
$result = Mage::getModel('shipping/rate_result');
|
| 19 |
+
$show = true;
|
| 20 |
+
if($show){
|
| 21 |
+
|
| 22 |
+
$method = Mage::getModel('shipping/rate_result_method');
|
| 23 |
+
$method->setCarrier($this->_code);
|
| 24 |
+
$method->setMethod($this->_code);
|
| 25 |
+
$method->setCarrierTitle($this->getConfigData('title'));
|
| 26 |
+
$method->setMethodTitle($this->getConfigData('name'));
|
| 27 |
+
$method->setPrice($price);
|
| 28 |
+
$method->setCost($price);
|
| 29 |
+
$result->append($method);
|
| 30 |
+
|
| 31 |
+
}else{
|
| 32 |
+
$error = Mage::getModel('shipping/rate_result_error');
|
| 33 |
+
$error->setCarrier($this->_code);
|
| 34 |
+
$error->setCarrierTitle($this->getConfigData('name'));
|
| 35 |
+
$error->setErrorMessage($this->getConfigData('specificerrmsg'));
|
| 36 |
+
$result->append($error);
|
| 37 |
+
}
|
| 38 |
+
return $result;
|
| 39 |
+
}
|
| 40 |
+
public function getAllowedMethods()
|
| 41 |
+
{
|
| 42 |
+
return array('infinity'=>$this->getConfigData('name'));
|
| 43 |
+
}
|
| 44 |
+
}
|
app/code/local/Infinity/Ship/controllers/IndexController.php
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Infinity_Ship_IndexController extends Mage_Core_Controller_Front_Action
|
| 3 |
+
{
|
| 4 |
+
|
| 5 |
+
}
|
app/code/local/Infinity/Ship/etc/config.xml
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Infinity_Ship>
|
| 5 |
+
<version>0.1.0</version>
|
| 6 |
+
</Infinity_Ship>
|
| 7 |
+
</modules>
|
| 8 |
+
<frontend>
|
| 9 |
+
<routers>
|
| 10 |
+
<ship>
|
| 11 |
+
<use>standard</use>
|
| 12 |
+
<args>
|
| 13 |
+
<module>Infinity_Ship</module>
|
| 14 |
+
<frontName>ship</frontName>
|
| 15 |
+
</args>
|
| 16 |
+
</ship>
|
| 17 |
+
</routers>
|
| 18 |
+
<layout>
|
| 19 |
+
<updates>
|
| 20 |
+
<ship>
|
| 21 |
+
<file>ship.xml</file>
|
| 22 |
+
</ship>
|
| 23 |
+
</updates>
|
| 24 |
+
</layout>
|
| 25 |
+
</frontend>
|
| 26 |
+
<global>
|
| 27 |
+
<models>
|
| 28 |
+
<ship>
|
| 29 |
+
<class>Infinity_Ship_Model</class>
|
| 30 |
+
<resourceModel>ship_mysql4</resourceModel>
|
| 31 |
+
</ship>
|
| 32 |
+
<ship_mysql4>
|
| 33 |
+
<class>Infinity_Ship_Model_Mysql4</class>
|
| 34 |
+
<entities>
|
| 35 |
+
<ship>
|
| 36 |
+
<table>ship</table>
|
| 37 |
+
</ship>
|
| 38 |
+
</entities>
|
| 39 |
+
</ship_mysql4>
|
| 40 |
+
</models>
|
| 41 |
+
<resources>
|
| 42 |
+
<ship_setup>
|
| 43 |
+
<setup>
|
| 44 |
+
<module>Infinity_Ship</module>
|
| 45 |
+
</setup>
|
| 46 |
+
<connection>
|
| 47 |
+
<use>core_setup</use>
|
| 48 |
+
</connection>
|
| 49 |
+
</ship_setup>
|
| 50 |
+
<ship_write>
|
| 51 |
+
<connection>
|
| 52 |
+
<use>core_write</use>
|
| 53 |
+
</connection>
|
| 54 |
+
</ship_write>
|
| 55 |
+
<ship_read>
|
| 56 |
+
<connection>
|
| 57 |
+
<use>core_read</use>
|
| 58 |
+
</connection>
|
| 59 |
+
</ship_read>
|
| 60 |
+
</resources>
|
| 61 |
+
<blocks>
|
| 62 |
+
<ship>
|
| 63 |
+
<class>Infinity_Ship_Block</class>
|
| 64 |
+
</ship>
|
| 65 |
+
</blocks>
|
| 66 |
+
<helpers>
|
| 67 |
+
<ship>
|
| 68 |
+
<class>Infinity_Ship_Helper</class>
|
| 69 |
+
</ship>
|
| 70 |
+
</helpers>
|
| 71 |
+
</global>
|
| 72 |
+
<default>
|
| 73 |
+
<carriers>
|
| 74 |
+
<infinity>
|
| 75 |
+
<active>1</active>
|
| 76 |
+
<model>ship/carrier_infinity</model>
|
| 77 |
+
<title>Carrier Title</title>
|
| 78 |
+
<name>Method Name</name>
|
| 79 |
+
<price>5.00</price>
|
| 80 |
+
<specificerrmsg>This shipping method is currently unavailable.</specificerrmsg>
|
| 81 |
+
</infinity>
|
| 82 |
+
</carriers>
|
| 83 |
+
</default>
|
| 84 |
+
</config>
|
app/code/local/Infinity/Ship/etc/system.xml
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<config>
|
| 3 |
+
<sections>
|
| 4 |
+
<carriers>
|
| 5 |
+
<groups>
|
| 6 |
+
<infinity translate="label" module="ship">
|
| 7 |
+
<label>Infinity Shipping Module</label>
|
| 8 |
+
<frontend_type>text</frontend_type>
|
| 9 |
+
<sort_order>99</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>2</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 |
+
<price translate="label">
|
| 40 |
+
<label>Price</label>
|
| 41 |
+
<frontend_type>text</frontend_type>
|
| 42 |
+
<sort_order>3</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 |
+
</price>
|
| 47 |
+
<specificerrmsg translate="label">
|
| 48 |
+
<label>Displayed Error Message</label>
|
| 49 |
+
<frontend_type>textarea</frontend_type>
|
| 50 |
+
<sort_order>4</sort_order>
|
| 51 |
+
<show_in_default>1</show_in_default>
|
| 52 |
+
<show_in_website>1</show_in_website>
|
| 53 |
+
<show_in_store>1</show_in_store>
|
| 54 |
+
</specificerrmsg>
|
| 55 |
+
<sallowspecific translate="label">
|
| 56 |
+
<label>Ship to Applicable Countries</label>
|
| 57 |
+
<frontend_type>select</frontend_type>
|
| 58 |
+
<sort_order>90</sort_order>
|
| 59 |
+
<frontend_class>shipping-applicable-country</frontend_class>
|
| 60 |
+
<source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
|
| 61 |
+
<show_in_default>1</show_in_default>
|
| 62 |
+
<show_in_website>1</show_in_website>
|
| 63 |
+
<show_in_store>1</show_in_store>
|
| 64 |
+
</sallowspecific>
|
| 65 |
+
<specificcountry translate="label">
|
| 66 |
+
<label>Ship to Specific Countries</label>
|
| 67 |
+
<frontend_type>multiselect</frontend_type>
|
| 68 |
+
<sort_order>91</sort_order>
|
| 69 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
| 70 |
+
<show_in_default>1</show_in_default>
|
| 71 |
+
<show_in_website>1</show_in_website>
|
| 72 |
+
<show_in_store>1</show_in_store>
|
| 73 |
+
<can_be_empty>1</can_be_empty>
|
| 74 |
+
</specificcountry>
|
| 75 |
+
</fields>
|
| 76 |
+
</infinity>
|
| 77 |
+
</groups>
|
| 78 |
+
</carriers>
|
| 79 |
+
</sections>
|
| 80 |
+
</config>
|
app/etc/modules/Infinity_Ship.xml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Infinity_Ship>
|
| 5 |
+
<active>true</active>
|
| 6 |
+
<codePool>local</codePool>
|
| 7 |
+
</Infinity_Ship>
|
| 8 |
+
</modules>
|
| 9 |
+
</config>
|
package.xml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>fixed_shipping_method</name>
|
| 4 |
+
<version>1.0.0.0</version>
|
| 5 |
+
<stability>stable</stability>
|
| 6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
| 7 |
+
<channel>community</channel>
|
| 8 |
+
<extends/>
|
| 9 |
+
<summary>Add simple fixed price shipping methods. </summary>
|
| 10 |
+
<description>fixed shipping method extension allows you to add fixed price shipping methods to 
|
| 11 |
+
Your Magento shopping cart.
|
| 12 |
+
</description>
|
| 13 |
+
<notes>First release</notes>
|
| 14 |
+
<authors><author><name>Infinitely</name><user>Mitesh</user><email>info@infintelyinfinite.com</email></author></authors>
|
| 15 |
+
<date>2014-04-19</date>
|
| 16 |
+
<time>10:05:08</time>
|
| 17 |
+
<contents><target name="magelocal"><dir name="Infinity"><dir name="Ship"><dir name="Block"><file name="Ship.php" hash="2944c702d3c884fe5190fb55e8383df6"/></dir><dir name="Helper"><file name="Data.php" hash="873594d93aa3700f6d0efb45c14f1ec4"/></dir><dir name="Model"><dir name="Carrier"><file name="Infinity.php" hash="2297090b461f27e89853f37d8b32aeea"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="30f29c7fe43c73cbf03fbde5b49a4b30"/></dir><dir name="etc"><file name="config.xml" hash="4d08382c34ede8f2ce7be32aef8133cc"/><file name="system.xml" hash="0b53b95c50c03d325e30d1c398ec31a4"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Infinity_Ship.xml" hash="321a77df29294bfd4912ad4918b304e6"/></dir></target></contents>
|
| 18 |
+
<compatible/>
|
| 19 |
+
<dependencies><required><php><min>5.1.0</min><max>5.5.9</max></php></required></dependencies>
|
| 20 |
+
</package>
|
