Version Notes
The is the first release version
Download this release
Release Info
| Developer | Medma Infomatix |
| Extension | Medma_ChangeShipping |
| Version | 1.0.0 |
| Comparing to | |
| See all releases | |
Version 1.0.0
- app/code/local/Medma/Ship/Helper/Data.php +6 -0
- app/code/local/Medma/Ship/controllers/IndexController.php +13 -0
- app/code/local/Medma/Ship/controllers/IndexController.php~ +13 -0
- app/code/local/Medma/Ship/etc/config.xml +36 -0
- app/code/local/Medma/Ship/etc/system.xml +37 -0
- app/design/adminhtml/default/default/layout/ship.xml +7 -0
- app/design/adminhtml/default/default/template/ship/sales/order/view/tab/info.phtml +147 -0
- app/etc/modules/Medma_Ship.xml +9 -0
- package.xml +20 -0
app/code/local/Medma/Ship/Helper/Data.php
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Medma_Ship_Helper_Data extends Mage_Core_Helper_Abstract
|
| 4 |
+
{
|
| 5 |
+
|
| 6 |
+
}
|
app/code/local/Medma/Ship/controllers/IndexController.php
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Medma_Ship_IndexController extends Mage_Core_Controller_Front_Action
|
| 3 |
+
{
|
| 4 |
+
public function shippingAction()
|
| 5 |
+
{
|
| 6 |
+
$orderId = $this->getRequest()->getParam('order_id');
|
| 7 |
+
$customShipTitle = Mage::getStoreConfig('carriers/medma/title');
|
| 8 |
+
$order = Mage::getModel('sales/order')->load($orderId);//print_r($order);
|
| 9 |
+
#$setShipment = $order->setShippingMethod('excellence_excellence')->setShippingDescription($customShipTitle)->save();
|
| 10 |
+
$setShipment = $order->setShippingDescription($customShipTitle)->save();
|
| 11 |
+
$this->_redirectReferer('');
|
| 12 |
+
}
|
| 13 |
+
}
|
app/code/local/Medma/Ship/controllers/IndexController.php~
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Medma_Ship_IndexController extends Mage_Core_Controller_Front_Action
|
| 3 |
+
{
|
| 4 |
+
public function shippingAction()
|
| 5 |
+
{
|
| 6 |
+
$orderId = $this->getRequest()->getParam('order_id');
|
| 7 |
+
$customShipTitle = Mage::getStoreConfig('carriers/medma/title');
|
| 8 |
+
$order = Mage::getModel('sales/order')->load($orderId);//print_r($order);
|
| 9 |
+
#$setShipment = $order->setShippingMethod('excellence_excellence')->setShippingDescription($customShipTitle)->save();
|
| 10 |
+
$setShipment = $order->setShippingDescription($customShipTitle)->save();
|
| 11 |
+
$this->_redirectReferer('');
|
| 12 |
+
}
|
| 13 |
+
}
|
app/code/local/Medma/Ship/etc/config.xml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Medma_Ship>
|
| 5 |
+
<version>0.1.0</version>
|
| 6 |
+
</Medma_Ship>
|
| 7 |
+
</modules>
|
| 8 |
+
<frontend>
|
| 9 |
+
<routers>
|
| 10 |
+
<ship>
|
| 11 |
+
<use>standard</use>
|
| 12 |
+
<args>
|
| 13 |
+
<module>Medma_Ship</module>
|
| 14 |
+
<frontName>ship</frontName>
|
| 15 |
+
</args>
|
| 16 |
+
</ship>
|
| 17 |
+
</routers>
|
| 18 |
+
</frontend>
|
| 19 |
+
<adminhtml>
|
| 20 |
+
|
| 21 |
+
<layout>
|
| 22 |
+
<updates>
|
| 23 |
+
<ship>
|
| 24 |
+
<file>ship.xml</file>
|
| 25 |
+
</ship>
|
| 26 |
+
</updates>
|
| 27 |
+
</layout>
|
| 28 |
+
</adminhtml>
|
| 29 |
+
<global>
|
| 30 |
+
<helpers>
|
| 31 |
+
<ship>
|
| 32 |
+
<class>Medma_Ship_Helper</class>
|
| 33 |
+
</ship>
|
| 34 |
+
</helpers>
|
| 35 |
+
</global>
|
| 36 |
+
</config>
|
app/code/local/Medma/Ship/etc/system.xml
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<config>
|
| 3 |
+
<sections>
|
| 4 |
+
<carriers>
|
| 5 |
+
<groups>
|
| 6 |
+
<medma translate="label" module="ship">
|
| 7 |
+
<label>Medma 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 |
+
|
| 32 |
+
</fields>
|
| 33 |
+
</medma>
|
| 34 |
+
</groups>
|
| 35 |
+
</carriers>
|
| 36 |
+
</sections>
|
| 37 |
+
</config>
|
app/design/adminhtml/default/default/layout/ship.xml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<layout>
|
| 2 |
+
<adminhtml_sales_order_view>
|
| 3 |
+
<reference name="order_tab_info">
|
| 4 |
+
<action method="setTemplate"><template>ship/sales/order/view/tab/info.phtml</template></action>
|
| 5 |
+
</reference>
|
| 6 |
+
</adminhtml_sales_order_view>
|
| 7 |
+
</layout>
|
app/design/adminhtml/default/default/template/ship/sales/order/view/tab/info.phtml
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Magento
|
| 4 |
+
*
|
| 5 |
+
* NOTICE OF LICENSE
|
| 6 |
+
*
|
| 7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
| 8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
| 11 |
+
* If you did not receive a copy of the license and are unable to
|
| 12 |
+
* obtain it through the world-wide-web, please send an email
|
| 13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 14 |
+
*
|
| 15 |
+
* DISCLAIMER
|
| 16 |
+
*
|
| 17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 18 |
+
* versions in the future. If you wish to customize Magento for your
|
| 19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
| 20 |
+
*
|
| 21 |
+
* @category design
|
| 22 |
+
* @package default_default
|
| 23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
| 24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
| 25 |
+
*/
|
| 26 |
+
$orderId = $this->getRequest()->getParam('order_id');
|
| 27 |
+
$getShippingURL = Mage::helper('adminhtml')->getUrl('ship/index/shipping/order_id/'.$orderId);
|
| 28 |
+
$enableShipment = Mage::getStoreConfig('carriers/medma/active');
|
| 29 |
+
|
| 30 |
+
?>
|
| 31 |
+
<?php /** @var $this Mage_Adminhtml_Block_Sales_Order_View_Tab_Info */ ?>
|
| 32 |
+
<?php $_order = $this->getOrder() ?>
|
| 33 |
+
<div>
|
| 34 |
+
<div id="order-messages">
|
| 35 |
+
<?php echo $this->getChildHtml('order_messages') ?>
|
| 36 |
+
</div>
|
| 37 |
+
<?php echo $this->getChildHtml('order_info') ?>
|
| 38 |
+
<input type="hidden" name="order_id" value="<?php echo $_order->getId() ?>"/>
|
| 39 |
+
<?php if ($_order->getIsVirtual()): ?>
|
| 40 |
+
<div class="box-right">
|
| 41 |
+
<?php else: ?>
|
| 42 |
+
<div class="box-left">
|
| 43 |
+
<?php endif; ?>
|
| 44 |
+
<!--Payment Method-->
|
| 45 |
+
<div class="entry-edit">
|
| 46 |
+
<div class="entry-edit-head">
|
| 47 |
+
<h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
|
| 48 |
+
</div>
|
| 49 |
+
<fieldset>
|
| 50 |
+
<?php echo $this->getPaymentHtml() ?>
|
| 51 |
+
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
| 52 |
+
</fieldset>
|
| 53 |
+
</div>
|
| 54 |
+
</div>
|
| 55 |
+
<?php if (!$_order->getIsVirtual()): ?>
|
| 56 |
+
<div class="box-right">
|
| 57 |
+
<!--Shipping Method-->
|
| 58 |
+
<div class="entry-edit">
|
| 59 |
+
<div class="entry-edit-head">
|
| 60 |
+
<h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping & Handling Information') ?></h4>
|
| 61 |
+
|
| 62 |
+
</div>
|
| 63 |
+
|
| 64 |
+
<fieldset>
|
| 65 |
+
|
| 66 |
+
<?php if ($_order->getTracksCollection()->count()) : ?>
|
| 67 |
+
<a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>','trackorder','width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track Order') ?>"><?php echo $this->__('Track Order') ?></a>
|
| 68 |
+
<br/>
|
| 69 |
+
<?php endif; ?>
|
| 70 |
+
<?php if ($_order->getShippingDescription()): ?>
|
| 71 |
+
<strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
|
| 72 |
+
|
| 73 |
+
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
| 74 |
+
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
| 75 |
+
<?php else: ?>
|
| 76 |
+
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
| 77 |
+
<?php endif; ?>
|
| 78 |
+
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
| 79 |
+
|
| 80 |
+
<?php echo $_excl; ?>
|
| 81 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
| 82 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
| 83 |
+
<?php endif; ?>
|
| 84 |
+
<?php else: ?>
|
| 85 |
+
<?php echo $this->helper('sales')->__('No shipping information available'); ?>
|
| 86 |
+
<?php endif; ?>
|
| 87 |
+
<?php if($enableShipment==1){?>
|
| 88 |
+
<br/><span><a href="<?php echo $getShippingURL ?>">Change shipping method</a></span>
|
| 89 |
+
<?php }?>
|
| 90 |
+
</fieldset>
|
| 91 |
+
|
| 92 |
+
</div>
|
| 93 |
+
|
| 94 |
+
</div>
|
| 95 |
+
<?php endif; ?>
|
| 96 |
+
<div class="clear"></div>
|
| 97 |
+
<?php echo $this->getGiftOptionsHtml() ?>
|
| 98 |
+
<div class="clear"></div>
|
| 99 |
+
<div class="entry-edit">
|
| 100 |
+
<div class="entry-edit-head">
|
| 101 |
+
<h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items Ordered') ?></h4>
|
| 102 |
+
</div>
|
| 103 |
+
</div>
|
| 104 |
+
<?php echo $this->getItemsHtml() ?>
|
| 105 |
+
<div class="clear"></div>
|
| 106 |
+
|
| 107 |
+
<div class="box-left">
|
| 108 |
+
<div class="entry-edit">
|
| 109 |
+
<div class="entry-edit-head">
|
| 110 |
+
<h4><?php echo Mage::helper('sales')->__('Comments History') ?></h4>
|
| 111 |
+
</div>
|
| 112 |
+
<fieldset><?php echo $this->getChildHtml('order_history') ?></fieldset>
|
| 113 |
+
</div>
|
| 114 |
+
</div>
|
| 115 |
+
<div class="box-right entry-edit">
|
| 116 |
+
<div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Order Totals') ?></h4></div>
|
| 117 |
+
<div class="order-totals"><?php echo $this->getChildHtml('order_totals') ?></div>
|
| 118 |
+
</div>
|
| 119 |
+
<div class="clear"></div>
|
| 120 |
+
</div>
|
| 121 |
+
|
| 122 |
+
<?php echo $this->getChildHtml('popup_window');?>
|
| 123 |
+
<script type="text/javascript">
|
| 124 |
+
//<![CDATA[
|
| 125 |
+
/**
|
| 126 |
+
* Retrieve gift options tooltip content
|
| 127 |
+
*/
|
| 128 |
+
function getGiftOptionsTooltipContent(itemId) {
|
| 129 |
+
var contentLines = [];
|
| 130 |
+
var headerLine = null;
|
| 131 |
+
var contentLine = null;
|
| 132 |
+
|
| 133 |
+
$$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element) {
|
| 134 |
+
if (element.down(0)) {
|
| 135 |
+
headerLine = element.down(0).innerHTML;
|
| 136 |
+
contentLine = element.down(0).next().innerHTML;
|
| 137 |
+
if (contentLine.length > 30) {
|
| 138 |
+
contentLine = contentLine.slice(0,30) + '...';
|
| 139 |
+
}
|
| 140 |
+
contentLines.push(headerLine + ' ' + contentLine);
|
| 141 |
+
}
|
| 142 |
+
});
|
| 143 |
+
return contentLines.join('<br/>');
|
| 144 |
+
}
|
| 145 |
+
giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
|
| 146 |
+
//]]>
|
| 147 |
+
</script>
|
app/etc/modules/Medma_Ship.xml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Medma_Ship>
|
| 5 |
+
<active>true</active>
|
| 6 |
+
<codePool>local</codePool>
|
| 7 |
+
</Medma_Ship>
|
| 8 |
+
</modules>
|
| 9 |
+
</config>
|
package.xml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>Medma_ChangeShipping</name>
|
| 4 |
+
<version>1.0.0</version>
|
| 5 |
+
<stability>stable</stability>
|
| 6 |
+
<license>OSL v3.0</license>
|
| 7 |
+
<channel>community</channel>
|
| 8 |
+
<extends/>
|
| 9 |
+
<summary>A shipping extension that allows the admin to change the shipping after order is placed from the frontend.</summary>
|
| 10 |
+
<description>A shipping extension that allows the admin to change the shipping after order is placed from the front-end. This is one of the feature that magento currently lacks but needed by merchants.
|
| 11 |
+

|
| 12 |
+
The basic use of this extension is to change the shipping of an order to what-ever is present at that particular time.</description>
|
| 13 |
+
<notes>The is the first release version</notes>
|
| 14 |
+
<authors><author><name>Medma Infomatix</name><user>Medma_Infomatix</user><email>gaurav@medma.in</email></author></authors>
|
| 15 |
+
<date>2012-09-25</date>
|
| 16 |
+
<time>10:12:11</time>
|
| 17 |
+
<contents><target name="magelocal"><dir name="Medma"><dir name="Ship"><dir name="Helper"><file name="Data.php" hash="05365e042b42b8c6cbac01375f0ea32a"/></dir><dir name="controllers"><file name="IndexController.php" hash="5bb451347033682f88d6f54183dc26fe"/><file name="IndexController.php~" hash="5bb451347033682f88d6f54183dc26fe"/></dir><dir name="etc"><file name="config.xml" hash="11cf116878bcf18f21acbca466f7cf66"/><file name="system.xml" hash="8b078ec1ad9bb135097d8d644edbe07b"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Medma_Ship.xml" hash="d44777b5423a74554d3a93dbab779471"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ship.xml" hash="57fca5fd725b29ed4d9f6a6d82d12556"/></dir><dir name="template"><dir name="ship"><dir name="sales"><dir name="order"><dir name="view"><dir name="tab"><file name="info.phtml" hash="a539710aea16d7aaf36dcd0a533cc04d"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
| 18 |
+
<compatible/>
|
| 19 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 20 |
+
</package>
|
