siteation / magento2-module-storeinfo-extra
1.1.0
2022-02-03 15:39 UTC
README
警告 此软件包已迁移至 https://github.com/Siteation/magento2-storeinfo
此 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
文件。
在这里,您可以创建新的字段,就像此模块所做的那样。