`
kirenenko04
  • 浏览: 152341 次
  • 性别: Icon_minigender_2
  • 来自: 上海
社区版块
存档分类
最新评论

Add 'Shipped' Status and make customer confirm receipt goods

php 
阅读更多

1. Fist, Add a shipped status in backend



 

2.rewrite Mage_Adminhtml_Sales_Order_ShipmentController

<config>  
 <admin>
          <routers>
            <adminhtml>
                <args>
                    <modules>
                        <Bysoft_Mysales before="Mage_Adminhtml">Bysoft_Mysales</Bysoft_Mysales>
                    </modules>
                </args>
            </adminhtml>
          </routers>
      </admin>

 

<?php
include_once("Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php");
class Bysoft_Mysales_Sales_Order_ShipmentController extends Mage_Adminhtml_Sales_Order_ShipmentController {
	protected function _saveShipment($shipment)
	{
		$shipment->getOrder()->setIsInProcess(true);
	
		$order = $shipment->getOrder();
	
		$order = Mage::getModel('sales/order')->loadByIncrementId($order->getIncrementId());
		$state = 'processing';
		$status = 'shipped';
		$comment = 'Changing state to Processing and status to shipped Status';
		$isCustomerNotified = false;
		$order->setState($state, $status, $comment, $isCustomerNotified);
		$order->save();
	
		$transactionSave = Mage::getModel('core/resource_transaction')
		->addObject($shipment)
		->save();
	
		return $this;
	}
}

 3. add a confirm controller for frontend , make cusotmer to confirm the order

<config>
   <frontend>
        <routers>
            <mysales>
                <use>standard</use>
                <args>
                    <module>Bysoft_Mysales</module>
                    <frontName>mysales</frontName>
                </args>
            </mysales>
        </routers>  
    </frontend>

 

<?php
class Bysoft_Mysales_ConfirmController extends Mage_Core_Controller_Front_Action {
	public function saveAction() {
		$order_id = Mage::app()->getRequest()->getParam('order_id');
		if(Mage::getSingleton('customer/session')->isLoggedIn()) {
			$customerData = Mage::getSingleton('customer/session')->getCustomer();
			$customer_id = $customerData->getId();
			$order = Mage::getModel('sales/order')->load($order_id);
			if ( $order->getCustomerId() == $customer_id) {
				$order->setData('state', "complete");
				$order->setStatus("complete");
				$history = $order->addStatusHistoryComment('Order status to complete by customer confirm.', false);
				$history->setIsCustomerNotified(false);
				$order->save();
				$message = $this->__('You have confirmed the order.');
				Mage::getSingleton('core/session')->addSuccess($message);
				$this->_redirectReferer();
			} else {
				return ;
			}
		} else {
			return ;
		}				
	}
}

 

  • 大小: 103.1 KB
  • 大小: 103.1 KB
分享到:
评论

相关推荐

    Oracle EBS R12 Order Management_TRAIN

    - **Receipt of Goods**: RMAs that involve physically receiving returned goods and processing credits if applicable. - **Sales Agreements**: Contracts between the seller and buyer for the supply of ...

    Laravel开发-status

    在Laravel框架中进行开发时,"status"通常指的是应用中的状态管理,这涉及到数据模型的状态字段、状态更新逻辑以及与用户界面的交互。在Cartalist平台中,"status"可能涉及订单状态、用户账户状态、商品库存状态等多...

    Shipped and sold by Amazon-crx插件

    语言:Deutsch,English,Français ... 此扩展名可让您只搜索亚马逊直接销售和发货的产品。 只需在亚马逊网站上单击蓝色按钮... 亚马逊的隐私政策有关Http://www.amazon.com/gp/help/customer/display.html?nodeid=468496

    Python Continuous Integration and Delivery: A Concise Guide with Examples

    moving world, no software project can afford to go through development, then an integration phase of unpredictable length and complexity, and finally be shipped to the customer — just to find out ...

    ActiveXperts SMS and Pager Toolkit3.2_crack

    Today, Windows developers rely upon the power, flexibility and reliability of the SMS and Pager Toolkit by ActiveXperts Software.SMS and Pager Toolkit is a COM component, and provides SMS and Pager ...

    Learning Docker_Faster App Development and Deployment, 2nd-Packt(2017).pdf

    Further on, containers are shipped and run everywhere without any hassle, hitches, and hurdles. The containerization concept has made IT infrastructures and processes agile and adaptive. This means ...

    ARM Assembly Language: Fundamentals and Techniques William Hohl [扫描版]

    CRC Press ARM Assembly Language Fundamentals and Techniques 2009 William Hohl Publication Date: March 13, 2009 | ISBN-10: 1439806101 | ISBN-13: 978-1439806104 | Edition: 1 Written by the director of ...

    TsiLang v7.5 Full Source for Delphi 10 Seattle & 10.1 Berlin

    TheResource Strings Wizard allows you to extract and add to translation data the resource strings of your project even if they are hidden somewhere in a .dcu (.obj) file without the source code. ...

    英语单词state与status的区别

    英语中的“state”和“status”虽然在中文中都可翻译为“状态”,但在实际使用中,它们有着明显的差异。了解这些差异对于精确地表达思想和理解英文文本至关重要。 首先,“state”一词通常用于描述一种持续性或稳定...

    PSCAD4.2破解版

    Where are the rest of the utilities, such as make and gdb? Jan-Jaap has made most of these tools available from his site, and I see no reason to duplicate them. His site can be reached from the ...

    针对JPA的活动记录模式ActiveJPA.zip

    // Get all orders for a customer that are shipped List orders = Order.where("customer_email", "dummyemail@dummy.com", "status", "shipped"); // Get all orders for the product ...

    TWAIN Specification Version 2.2

    TWAIN defines a standard software protocol and API (application programming interface) for communication between software applications and...Source software and do not need to be shipped by applications.

    mysql存储过程之返回多个值的方法示例

    WHERE customerNumber = cust_no AND status = 'Shipped'; -- 计算取消订单数 SELECT COUNT(*) INTO canceled FROM orders WHERE customerNumber = cust_no AND status = 'Canceled'; -- 计算解决订单数 ...

    shipped-devbox:已发货的开发者 Vagrant 盒子

    Cisco Shipped developer Vagrant box (shipped-devbox) 构建代码。 提供 CentOS 7 x86_64(最低) 码头工人 Docker-compose 要求 VirtualBox &gt;= 4.3.14 打包机 制作 互联网 Packer安装注意事项:将可执行文件复制...

    Sakemail

    ).- Added the property FileStream to the class TAtachedFile and the procedure SaveToStream, this was done by Brian Sheperd- The address separator (in the TO: field) is ‘,‘ and ‘;‘ now (before it ...

    Shipped.io-crx插件

    -允许您从亚马逊添加产品-自动向您显示最终价格-结帐并将订单放置在shipped.io网站上-交货最快到家门口(最多2-3周)有什么问题吗? 我们希望收到您的来信:-给我们发电子邮件info@shipped.io-检查我们的网站“ ...

    BX2400蓝牙JLINK程序烧录工具包

    With more than 1.5 billion devices shipped to date and dozens of licensees, the RivieraWaves Bluetooth IP is widely deployed in consumer and IoT devices with many of the world's leading ...

    BX2400开发文档

    With more than 1.5 billion devices shipped to date and dozens of licensees, the RivieraWaves Bluetooth IP is widely deployed in consumer and IoT devices with many of the world's leading ...

Global site tag (gtag.js) - Google Analytics