2013-07-03 4 views
1

체크 아웃 장바구니 페이지의 기본/템플릿/checkout/cart.phtml 아래에 추가하려고하는 맞춤 블록이 있습니다.체크 아웃/카트 페이지의 기본 카트 블록 아래에 맞춤 블록을 표시하는 데 문제가 발생했습니다.

내가 블록 다음과 같이 local.xml를 사용하여 표시가 있습니다,

<?xml version="1.0" encoding="UTF-8"?> 

<layout> 
    <default> 
     <reference name="checkout.cart"> 
      <reference name="content"> 

        <block type="module/checkoutextras" name="checkoutextras" as="extras" template="fracture/module/checkoutextras.phtml" after="content" /> 

      </reference> 
     </reference> 
    </default> 
</layout> 

문제가 cart.phtml 위에 나타나는 점이다 기본적으로는 블록 정의의 후 = "내용"을 무시하는 것으로 나타납니다 또한 after = "-"를 사용하면 이동하지 않습니다.

checkout.xml의 관련 부분은 다음과 같습니다

<checkout_cart_index translate="label"> 
     <label>Shopping Cart</label> 
     <remove name="right"/> 
     <remove name="left"/> 
     <!-- Mage_Checkout --> 
     <reference name="root"> 
      <action method="setTemplate"><template>page/1column.phtml</template></action> 
     </reference> 
     <reference name="content"> 
      <block type="checkout/cart" name="checkout.cart"> 
       <action method="setCartTemplate"><value>checkout/cart.phtml</value></action> 
       <action method="setEmptyTemplate"><value>checkout/cart/noItems.phtml</value></action> 
       <action method="chooseTemplate"/> 
       <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/item/default.phtml</template></action> 
       <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/item/default.phtml</template></action> 
       <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/item/default.phtml</template></action> 

       <block type="core/text_list" name="checkout.cart.top_methods" as="top_methods" translate="label"> 
        <label>Payment Methods Before Checkout Button</label> 
        <block type="checkout/onepage_link" name="checkout.cart.methods.onepage" template="checkout/onepage/link.phtml"/> 
       </block> 

       <block type="page/html_wrapper" name="checkout.cart.form.before" as="form_before" translate="label"> 
        <label>Shopping Cart Form Before</label> 
       </block> 

       <block type="core/text_list" name="checkout.cart.methods" as="methods" translate="label"> 
        <label>Payment Methods After Checkout Button</label> 
        <block type="checkout/onepage_link" name="checkout.cart.methods.onepage" template="checkout/onepage/link.phtml"/> 
        <block type="checkout/multishipping_link" name="checkout.cart.methods.multishipping" template="checkout/multishipping/link.phtml"/> 
       </block> 

       <block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/> 
       <block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml"/> 

       <block type="checkout/cart_totals" name="checkout.cart.totals" as="totals" template="checkout/cart/totals.phtml"> 
       <block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping" template="checkout/cart/shipping.phtml"/> 
       </block> 
      </block> 
     </reference> 
     <block type="core/text_list" name="additional.product.info" translate="label"> 
      <label>Additional Product Info</label> 
     </block> 
    </checkout_cart_index> 

내가 모르는 뭔가가 있어야합니다,하지만 난 심지어 = "checkout.cart"후 해봤하고 있지만, 직접 블록을 추가 두 경우 모두 블록이 렌더링되지 않으며 콘텐츠 참조가 포함되어 있지만 잘못된 위치에만 렌더링됩니다. checkoutextras 블록이 장바구니 아래에 렌더링되도록 local.xml을 어떻게 업데이트 할 수 있습니까?

답변

4

이 작동합니다 :

<?xml version="1.0"?> 
<layout> 
    <checkout_cart_index><!-- You just need to update the layout for the cart page, so you can use the corresponding action name --> 
     <reference name="content"><!-- A single reference to the wrapping "content" block is enough (you want to put content below the cart, not inside) --> 
      <block type="module/checkoutextras" name="checkoutextras" as="extras" template="fracture/module/checkoutextras.phtml" after="-" /> 
     </reference> 
    </checkout_cart_index> 
</layout> 
+0

감사 bImage를 완벽하게 작동, 당신은 내가이 작업을 얻을려고 내 layout.xml 만지작 봤는데 얼마나 믿지 않을 것! 건배. 당신의 대답에 투표 할 수 있도록 더 많은 평판을 얻었 으면 좋겠어요. – fracture