如何在结帐页面的magento 2中的订单摘要中显示包含送货地址表单的帐单地址表单

时间:2017-08-03 11:11:51

标签: php node.js magento2 checkout

我不知道怎么可能 我的代码是:

class LayoutProcessorPlugin
{

   /**
    * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
    * @param array $jsLayout
    * @return array
    */

   public function afterProcess(
       \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
       array $jsLayout
   )
   {
       // get billing address form at billing step
       $billingAddressForm = $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']['payment']['children']['afterMethods']['children']['billing-address-form'];

       // move address form to shipping step
       $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['billing-address-form'] = $billingAddressForm; 

       // remove form from billing step
       unset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']['payment']['children']['afterMethods']['children']['billing-address-form']);

       return $jsLayout;
   }
}

0 个答案:

没有答案