text跳过运送方式(代码片段)

author author     2022-11-28     637

关键词:


https://www.aitoc.com/magentomods-configurable-checkout.html

https://marketplace.magento.com/chandankumarsingh-skip-shipping-method.html

https://codeday.me/en/qa/20190315/15155.html

https://magento2.atlassian.net/wiki/spaces/m1wiki/pages/14024866/Removing+the+Shipping+Method+from+One-Page+Checkout

**Magento: Skip Shipping Method from onepage checkout**

First override following files(i.e. in local directory) rather than changing the core:
1) app/code/core/Mage/Checkout/Block/Onepage/Onepage.php
2) app/code/core/mage/checkout/controller/Onepagecontrollers.php
3) app/code/core/Mage/Sales/Model/Service/Quote.php
4) app/design/frontend/base/default/template/checkout/onepage/progress.phtml
5) app/code/core/Mage/Sales/Model/Service/Quote.php

Once done follow the below steps:

**Step 1: app/code/local/Mage/Checkout/Block/Onepage.php**

Change the line:
$stepCodes = array('billing', 'shipping', 'shipping_method', 'payment', 'review');

In Magento 1.7+ you will find $stepCodes in for each just replace with below code 
with:
$stepCodes = array('billing', 'shipping', 'payment', 'review');


**Step 2: app/code/local/Mage/Checkout/controller/Onepagecontrollers.php**

Change the line:
protected $_sectionUpdateFunctions = array(
'payment-method' => '_getPaymentMethodsHtml',
'shpping-method' => '_getShippingMeghtoHtml',
'review' => '_getReviewHtml',
);

with:
protected $_sectionUpdateFunctions = array(
'payment-method' => '_getPaymentMethodsHtml',
'review' => '_getReviewHtml',
);


**Step 3: app/code/local/Mage/Checkout/controller/Onepagecontrollers.php**

Change saveBillingAction() function with:

public function saveBillingAction()

if ($this->_expireAjax()) 
return;

if ($this->getRequest()->isPost()) 
$postData = $this->getRequest()->getPost('billing', array());
$data = $this->_filterPostData($postData);
$data = $this->getRequest()->getPost('billing', array());
$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);

if (isset($data['email'])) 
$data['email'] = trim($data['email']);

$result = $this->getOnepage()->saveBilling($data, $customerAddressId);

if (!isset($result['error'])) 
/* check quote for virtual */
if ($this->getOnepage()->getQuote()->isVirtual()) 
$result['goto_section'] = 'payment';
$result['update_section'] = array(
'name' => 'payment-method',
'html' => $this->_getPaymentMethodsHtml()
);
 elseif (isset($data['use_for_shipping']) && $data['use_for_shipping'] == 1) 
$result['goto_section'] = 'payment';
$result['update_section'] = array(
'name' => 'payment-method',
'html' => $this->_getPaymentMethodsHtml()
);

$result['allow_sections'] = array('shipping');
$result['duplicateBillingInfo'] = 'true';
 else 
$result['goto_section'] = 'shipping';



$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));



Change saveShippingAction() function with:

public function saveShippingAction()

if ($this->_expireAjax()) 
return;

if ($this->getRequest()->isPost()) 
$data = $this->getRequest()->getPost('shipping', array());
$customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);
$result = $this->getOnepage()->saveShipping($data, $customerAddressId);

if (!isset($result['error'])) 
$result['goto_section'] = 'payment';
$result['update_section'] = array(
'name' => 'payment-method',
'html' => $this->_getPaymentMethodsHtml()
);

$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));



**Step 4: app/code/local/Mage/Sales/Model/Service/Quote.php**

Change _validate() function with:

protected function _validate()

$helper = Mage::helper('sales');
if (!$this->getQuote()->isVirtual()) 
$address = $this->getQuote()->getShippingAddress();
$addressValidation = $address->validate();
if ($addressValidation !== true) 
Mage::throwException(
$helper->__('Please check shipping address information. %s', implode(' ', $addressValidation))
);



$addressValidation = $this->getQuote()->getBillingAddress()->validate();
if ($addressValidation !== true) 
Mage::throwException(
$helper->__('Please check billing address information. %s', implode(' ', $addressValidation))
);


if (!($this->getQuote()->getPayment()->getMethod())) 
Mage::throwException($helper->__('Please select a valid payment method.'));


return $this;



**Step 5: app/design/frontend/default/default/template/checkout/onepage/progress.phtml**

Remove the shipping method block.

**Step 6: app/locale/en_US/template/email/sales/order_new.html**

Remove the shipping method block(i.e. var order.getShippingDescription()).

text鞅-模拟器(仅跳过)(代码片段)

查看详情

text[archlinux]yaourt跳过有效性检查(代码片段)

查看详情

xml运送xml(代码片段)

查看详情

xml运送xml(代码片段)

查看详情

mavencleaninstall跳过单元测试(代码片段)

...tall-DskipTestsmvncleaninstall-Dmaven.test.skip=true 使用IDEAInstall跳过单元测试IDEAInstall跳过单元测试有以下两种方式:第一种比较蠢,是通过IDEA配置Maven命令从而实现Install时跳过单元测试;第二种非常方便,因为IDEA已经提供了跳过单... 查看详情

text终端快捷方式(代码片段)

查看详情

text有用的快捷方式(代码片段)

查看详情

text快捷方式,提示和技巧(代码片段)

查看详情

背包问题解决实际问题的应用-船只运送货物(代码片段)

...箱子以及每个箱子重量,船只最大承载量是W,如何在T次运送之内运完箱子(不考虑空间因素,只要重量没超过都能放得下)   思路:要保证在T次之内送完箱子,换句话说就要要每次运送的货物的总重量达到或者最接近船... 查看详情

text为afc添加快捷方式(代码片段)

查看详情

text以编程方式禁用gutenberg(代码片段)

查看详情

text创建应用程序快捷方式(代码片段)

查看详情

text图像在内存之中的储存方式(代码片段)

查看详情

跳过用例skip(代码片段)

1、装饰器,放在函数前面,跳过用例 @pytest.mark.skip(reason="nowayofcurrentlytestingthis")importpytestdeftest1():print(‘操作1‘)print("-----------------------------------------------")@pytest.mark.skip(reason="nowayofcurrentlytestingthis")deftest12():print(‘操作2‘)prin... 查看详情

计蒜客习题蒜头君运送宝藏(代码片段)

 !!!原来LCA的题可以出的这么难,完了这还属于水题?!先来解释一下题意,有N个城市,在这N城市之间有M条边(不一定每个城市都有边)。我们的任务是找出给定两个点之间路径上的最小边权,使得这个最小边权尽量大... 查看详情

text以编程方式设置相关产品magento2(代码片段)

查看详情

flutter-text以字符的方式截断(代码片段)

本文主要介绍Text以字符的方式截断Text以字符的方式截断https://github.com/flutter/flutter/issues/52869在flutter中,Text控件默认的溢出显示模式是TextOverflow.fade,就是淡出在iOS或者Android平台默认的文件截断模式一般是…省略,flutter里... 查看详情

flutter-text以字符的方式截断(代码片段)

本文主要介绍Text以字符的方式截断Text以字符的方式截断https://github.com/flutter/flutter/issues/52869在flutter中,Text控件默认的溢出显示模式是TextOverflow.fade,就是淡出在iOS或者Android平台默认的文件截断模式一般是…省略,flutter里... 查看详情