siteation / magento2-storeinfo-extra
2.1.2
2023-05-16 21:29 UTC
Requires
- magento/framework: ^102.0|^103.0
- magento/module-backend: ^101.0|^102.0
README
警告
此包已被弃用,并与StoreInfo的v3版本合并。
此Magento 2模块可轻松添加显示社交媒体按钮或其他额外功能。
因此,您可以从“店铺”>“配置”中获取whatsapp号码。而不是使用静态块或直接在模板中硬编码。
安装
通过以下方式安装包:
composer require siteation/magento2-storeinfo-extra bin/magento module:enable Siteation_StoreInfoExtra bin/magento setup:upgrade
注意
此模块需要Magento 2.3或更高版本!更多信息请参阅composer.json
。
如何使用
默认情况下,此模块不加载任何内容。
使用其中一个示例来开始。
之后,在“店铺”>“配置”>“常规”>“常规”>“店铺额外信息”中输入您的信息
添加示例块
Hyva - XML示例
<referenceContainer name="footer"> <block name="footer.store.socials" as="footer-store-socials" template="Siteation_StoreInfoExtra::hyva/socials.phtml" /> </referenceContainer>
其他选项包括:
coc-number.phtml
、whatsapp-button.phtml
Luma - XML示例
<referenceContainer name="footer"> <block name="footer.store.socials" as="footer-store-socials" template="Siteation_StoreInfoExtra::luma/socials.phtml" > <arguments> <argument name="viewModelStoreInfo" xsi:type="object">Siteation\StoreInfoExtra\ViewModel\StoreInfoExtra</argument> </arguments> </block> </referenceContainer>
其他选项包括:
coc-number.phtml
、whatsapp-button.phtml
扩展
如果您想添加自己的字段,您需要创建自己的模块,该模块至少包含etc/adminhtml/system.xml
文件。
在这里,您可以创建新字段,就像此模块所做的那样。