mestrona / mestrona/magento-module-commonblocks
Magento 2 模块,包含简单的基础块
1.3.1
2020-02-06 16:16 UTC
Requires
- magento/module-store: *
README
本模块面向开发者。
Magento 2 模块,包含简单的基础块
-
商店信息模板
-
store_information.phtml - 例如用于页脚的地址和商店营业时间
-
store_information/contact.phtml - 电话和电子邮件链接
-
CMS 模块用于结账
计划中
- 系统版本(和可能的 Git 分支)
基本上,应该添加更多的小型简单块。如果您缺少某些内容,请提交一个问题或更好的是提交一个 pull request。
安装
使用 composer 客户端,通过模块名称 mestrona/magento-module-commonblocks
通常是按常规方式安装模块。
使用
将以下块添加到您的布局中。示例
<referenceContainer name="header.panel">
<block class="Mestrona\CommonBlocks\Block\StoreInformation" name="header_info" after="skip_to_content"
template="Mestrona_CommonBlocks::store_information/contact.phtml" />
</referenceContainer>
<referenceContainer name="footer">
<block class="Mestrona\CommonBlocks\Block\StoreInformation" name="footer_info" before="footer_links"
template="Mestrona_CommonBlocks::store_information.phtml" />
</referenceContainer>
CMS 模块用于结账
添加到您的 frontend/di.xml
<type name="Mestrona\CommonBlocks\Model\CmsBlockCheckoutConfigProvider">
<arguments>
<argument name="blockIdentifier" xsi:type="string">identifier or ID of the block goes here</argument>
</arguments>
</type>
将类似的内容添加到您的 checkout_index_index.xml(取决于您希望放置块的位置)
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<item name="steps" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shipping-step" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shippingAddress" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shipping-address-fieldset" xsi:type="array">
<item name="children" xsi:type="array">
<item name="cms-block" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">Mestrona_CommonBlocks/cms-block</item>
</item>
<item name="sortOrder" xsi:type="string">125</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
关于我们
Mestrona GbR 提供开源 Magento 模块。如果您遇到任何错误,您可能希望在此处提交一个问题。
本模块与 iMi digital 共同开发。
需要支持或实现现有系统中的模块,请随时联系我们。在这种情况下,我们将提供有偿的全服务支持。
当然,我们也可以提供封闭源代码模块的开发。