如何解决Magento 2-替代捆绑销售商品页面视图
是否有一种方法可以替代“捆绑产品”页面视图? 我尝试创建一个模块并使用以下文件:catalog_product_view_type_bundle.xml
我已经创建了registration.PHP:
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(ComponentRegistrar::MODULE,'vendor_MyModule',__DIR__);
我已经创建了module.xml:
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="vendor_MyModule" setup_version="1.0.0"/>
<sequence>
<module name="Magento_Bundle"/>
</sequence>
</config>
最后,我创建了view文件夹来插入文件: app / code / vendor / MyModule / view / layout / catalog_product_view_type_bundle.xml
<?xml version="1.0"?>
<!--
/**
* copyright © Magento,Inc. All rights reserved.
* See copYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<attribute name="class" value="page-product-bundle"/>
<referenceBlock name="product.info">
<block class="Magento\Catalog\Block\Product\View" name="bundle.summary" as="form_bottom" template="Magento_Bundle::catalog/product/view/summary.phtml">
<block class="Magento\Catalog\Pricing\Render" name="product.price.render.bundle.customization">
<arguments>
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
<argument name="price_type_code" xsi:type="string">configured_price</argument>
<argument name="zone" xsi:type="string">item_view</argument>
</arguments>
</block>
<block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart.bundle" as="addtocart" template="Magento_Catalog::product/view/addtocart.phtml">
<block class="Magento\Catalog\Block\ShortcutButtons\InCatalog" name="addtocart.shortcut.buttons"/>
</block>
<block class="Magento\Catalog\Block\Product\View" name="product.info.addto.bundle" as="addto" template="Magento_Catalog::product/view/addto.phtml"/>
</block>
</referenceBlock>
</body>
</page>
我已经清理并刷新了缓存,但没有任何变化! 如何仅使用模块更改捆绑产品的产品页面视图?
我需要覆盖整个页面,因为我需要使用逐步方法来让客户分3个步骤选择每个选项。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。