• 自动填写麦进斗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;
        }
    }
    
  • 相关阅读:
    001-导航条悬浮顶部
    000-导航栏单击事件背景变换
    1-MySQL命令行
    了解CentOS服务器的基本信息
    SecureCRT配色
    SecureCRT中文显示乱码
    Android Studio 1.1 使用介绍及导入 jar 包和第三方依赖库
    Android Json 解析
    不断更新中 书签
    Android 常用的权限
  • 原文地址:https://www.cnblogs.com/magento-maijindou/p/5977561.html
Copyright © 2020-2023  润新知