0

我试图替换默认的折扣块。不幸的是,块总是位于容器的底部。我无法将其移动到默认块位置。

我的 xml -

    <?xml version="1.0"?>
    <!--
    /**
     * Copyright © 2015 Magento. All rights reserved.
     * See COPYING.txt for license details.
     */
    -->
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
        <remove name="checkout.cart.coupon"/>
        <referenceContainer name="cart.discount">
            <block class="{namespace}\Coupons\Block\Coupon" name="checkout.cart.coupon2" as="sadasdasd" template="test.phtml"/>
        </referenceContainer>
        <move element="cart.discount" destination="checkout.cart.container" before="checkout.cart.order.actions.gift_options" />
    </body>
    </page>

结果屏幕 - 在此处输入图像描述

4

1 回答 1

0

我认为 checkout.cart.order.actions.gift_options 不是 checkout.cart.container 的直接子项,因此“之前”子句没有找到您想要的位置,并且默认为“最后一个子项”作为默认行为。

于 2015-08-11T06:48:59.717 回答