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 (将#修改为@)