【问题标题】:How to remove complete header and footer from checkout/cart and afterwards all pages in magento如何从结帐/购物车中删除完整的页眉和页脚,然后在magento中删除所有页面
【发布时间】:2014-03-10 06:25:23
【问题描述】:

我必须从结帐/购物车页面删除完整的页眉和页脚到 magento 1.7 中的所有后续页面。我只知道我需要在“checkout.xml”文件中添加<remove name="header"/>,但是每当我尝试添加同一行时,前端没有任何反映或前端出现空白页。

【问题讨论】:

    标签: php magento content-management-system


    【解决方案1】:

    在你的 local.xml 中使用下面的代码

    从购物车页面中删除页眉和页脚:

    <checkout_cart_index>
      <remove name="header"/>
      <remove name="footer"/>
    </checkout_cart_index>
    

    要从 Checkout Onepage 中删除页眉和页脚:

    <checkout_onepage_index>
       <remove name="header"/>
       <remove name="footer"/>
    </checkout_onepage_index>
    

    【讨论】:

    • 你在谈论 app/etc/local.xml 文件吗?那么我应该把这段代码放在哪里呢?
    • 在您的设计布局文件夹中 例如:app\design\frontend\default(YourProjectNameSpace)\default\layout\local.xml 但如果您不使用 local.xml,您可以将上述代码粘贴到你的 page.xml
    • no 在page.xml中添加这几行代码后,前端只出现了一个空白页面
    • 你是在哪里添加的?
    • 我尝试将它添加到默认部分,在开头
    【解决方案2】:

    在您的 local.xml 布局文件夹内的自定义主题布局文件夹中,复制此代码以从结帐/购物车页面中删除页眉和页脚

    <checkout_cart_index> <remove name="header"/> <remove name="footer"/> </checkout_cart_index>

    用于删除结帐/单页

    <checkout_onepage_index> <remove name="header"/> <remove name="footer"/> </checkout_onepage_index>

    记得在你的 local.xml 中关闭默认标签后复制此代码,如果你在默认标签中插入此代码,它将从所有页面中删除页眉和页脚

    【讨论】:

      【解决方案3】:
          <checkout_cart_index translate="label">
                         <reference name="root">
                              <action method="setTemplate"><template>page/empty.phtml</template></action>
                  </reference>
         </checkout_cart_index>
      

      【讨论】:

        【解决方案4】:

        您可以按照以下步骤操作:

        第一步:

        转到 app/design/frontend/yourtheme/layout/checkout.xml 在这行之后添加这两行(

        <checkout_cart_index translate="label">
                <label>Shopping Cart</label>
        

        )

        <remove name="header"/>
        <remove name="footer"/>
        

        第 2 步:
        如果您使用任何扩展程序进行结帐,那么 转到 app/design/frontend/yourtheme/layout/your_extension_checkout.xml

        在这行之后添加这两行(

        <onepagecheckout_index_index translate="label">
        <label>One Page Checkout</label>
        

        )

        <remove name="header"/>
        <remove name="footer"/>
        

        否则转到您的主题/布局/checkout.xml(相同的 step1 文件)和

        在这行之后添加上面两行(&lt;checkout_onepage_index translate="label"&gt; &lt;label&gt;One Page Checkout&lt;/label&gt;)

        第 3 步:清除您的 magento 缓存

        【讨论】:

        • onepagecheckout.xml 在我的 magento 目录中不可用
        • onepagecheckout.xml 文件可供我使用,因为我启用了 onepage checkout 扩展。
        • 您是否使用默认的 magento 结帐?
        • 好的。你在你的主题/布局/checkout.xml 文件中找到“”
        • 如果找到,添加以下行
        【解决方案5】:

        您需要在您的 XML 文件中写入:

        <remove name="header" />
        <remove name="footer" />
        

        【讨论】:

          【解决方案6】:

          请为您的模板文件夹转到 page.xml

           <default translate="label" module="page">
          <remove name="header"/>
          <remove name="footer"/>
          
          </default>
          

          仅用于结帐请转到 checkout.xml

              <checkout_cart_index translate="label">
           <remove name="header"/>
              <remove name="footer"/>
          </checkout_cart_index>
          <checkout_onepage_index translate="label">
           <remove name="header"/>
              <remove name="footer"/>
          </checkout_onepage_index>
          

          【讨论】:

          • 它删除了所有页面上的页眉和页脚。我只需要在购物车和一个页面上删除
          猜你喜欢
          • 1970-01-01
          • 2023-01-19
          • 2017-06-05
          • 2020-10-27
          • 1970-01-01
          • 2018-10-01
          • 1970-01-01
          • 2018-01-24
          • 1970-01-01
          相关资源
          最近更新 更多