zoukankan      html  css  js  c++  java
  • 自动填写麦进斗Magento进货地址字段

    在这种情况下,你需要为这个插件。

    创建di.xml [Vendor/Module/etc/frontend/di.xml]

    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
     </config>

    创建LayoutProcessor.php [Vendor/Module/Plugin/Checkout/Model/Checkout/LayoutProcessor.php]

    namespace VendorModulePluginCheckoutModelCheckout;
    
    
    class LayoutProcessor
    {
        /**
         * @param MagentoCheckoutBlockCheckoutLayoutProcessor $subject
         * @param array $jsLayout
         * @return array
         */
        public function afterProcess(
            MagentoCheckoutBlockCheckoutLayoutProcessor $subject,
            array  $jsLayout
        ) {
            $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
            ['shippingAddress']['children']['shipping-address-fieldset']['children']['firstname']['value'] = 'FirstName';
    
            $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
            ['shippingAddress']['children']['shipping-address-fieldset']['children']['company']['value'] = 'Demo Company';
            return $jsLayout;
        }
    }
    
  • 相关阅读:
    DP2_第K优解
    DP1
    算法第一讲_动态规划
    CodeForces 487A Fight the Monster
    HDU 2899 Strange fuction
    lower_bound() 与 upper_bound()
    jQuery qrcode生成二维码
    本地代码上传至git仓库
    图片懒加载
    react-native学习(一)————使用react-native-tab-navigator创建底部导航
  • 原文地址:https://www.cnblogs.com/magento-maijindou/p/5977561.html
Copyright © 2011-2022 走看看