magento2中想实现一步支付的功能,即在购物车页面添加按钮,点击这个按钮直接跳转到第三方支付平台。
目前我做到的程度是已经在购物车页面添加按钮,点击跳转后,怎么把quote表里面的数据保存到order表啊?发现quote表里有数据,order表里面没数据。
public function arrangePostData(){
$orderId = $this->checkoutSession->getLastOrderId(); //这个orderid只能取到上一次的orderid
$order = $this->orderFactory->create()->load($orderId);
$billingAddress = $order->getBillingAddress();
$shippingAddress = $order->getShippingAddress();
$warehouseId = $this->scopeConfig->getValue('payment/pilipay/warehouseInfo',\Magento\Store\Model\ScopeInterface::SCOPE_STORE);
$warehouseInfo = $this->getWarehouseAddressBy($warehouseId);
请看出来的朋友指点一二
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
sales_model_service_quote_submit_before与sales_model_service_quote_submit_success两个EVENT之间的过程便是从quote到sales_order的过程。
请参考以下代码片段
vendor/magento/module-quote/Model/QuoteManagement.php
