【问题标题】:How to update magento 2 checkout layout?如何更新 magento 2 结帐布局?
【发布时间】:2018-01-16 16:36:08
【问题描述】:

我正在尝试更新结帐布局以使用两列,因此结帐字段位于左列,购物车摘要位于右列。

在我的 checkout_index_index.xml 中,我创建了两个容器,例如:

<container htmlTag="div" htmlClass="checkout-main col-md-6">

</container>
<container htmlTag="div" htmlClass="checkout-aside col-md-6">

</container>

我不确定如何将 onepage.phtml 中的元素/项目移动到正确的列中?

谁能告诉我如何更新结帐布局?

checkout_index_index.xml

http://cnhv.co/1bq62

【问题讨论】:

    标签: magento2 checkout


    【解决方案1】:

    如果要在 XML 中移动元素,可以在 &lt;container&gt; 参数中添加 beforeafter

    所以你的代码可以这样修改:

    <container htmlTag="div" htmlClass="checkout-main col-md-6" before="<block_name>">
    
    </container>
    <container htmlTag="div" htmlClass="checkout-aside col-md-6" after="<block_name>">
    
    </container>
    

    取决于你要放置的位置,你可以分别使用beforeafter。请记住在任何编辑生效后清除缓存。

    参考:http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-instructions.html#fedg_layout_xml-instruc_ex_mv

    【讨论】:

      猜你喜欢
      • 2014-09-11
      • 2019-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-15
      • 2011-11-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多