2014-02-17 4 views
0

장바구니 정보를 표시하는 머리글에 블록을 추가하려고합니다.
아직이 블록에서 어떤 표시도 나타나지 않습니다. 나는 젠토에 비교적 새로운 해요머리글에 체크 아웃 블록 추가

<?php echo $this->getChildHtml('checkoutBasket'); ?> 

: 여기

<script>alert("TEST");</script> 
<div class="block checkout-basket"> 
    TEST 
</div> 

내 header.phtml입니다 : 여기
<reference name="header"> 
    <block type="checkout/cart_sidebar" name="checkout.basket" as="checkoutBasket" /> 
</reference> 

내 basket.phtml입니다 : 여기

내 checkout.xml입니다 그리고 Block 시스템이기 때문에이 블록을 표시하기 위해 모든 점들을 올바르게 결합했는지 확신 할 수 없습니다. 당신이 다음

<block type="checkout/cart_sidebar" name="checkout.basket" as="checkoutBasket" template="pathoftemplate/basket.phtml"> 
<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action> 
       <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action> 
       <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action> 
       <block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout"> 
        <label>Shopping Cart Sidebar Extra Actions</label> 
       </block> 

그리고 코드가 basket.phtml에 추가해야합니다 단지 기본 처럼 모든 카트 항목을 표시 할 경우

답변

1

이 템플릿 파일은 XML

<block type="checkout/cart_sidebar" name="checkout.basket" as="checkoutBasket" template="pathoftemplate/basket.phtml" /> 

의 코드에 없습니다

<?php if ($this->getIsNeedToDisplaySideBar()):?> 
<div class="block block-cart"> 
    <?php $_cartQty = $this->getSummaryCount() ?> 
    <div class="block-title"> 
     <strong><span><?php echo $this->__('My Cart') ?></span></strong> 
    </div> 
    <div class="block-content"> 
    <?php if ($_cartQty>0): ?> 
     <div class="summary"> 
      <?php if ($_cartQty==1): ?> 
       <p class="amount"><?php echo $this->__('There is <a href="%s">1 item</a> in your cart.', $this->getUrl('checkout/cart')) ?></p> 
      <?php else: ?> 
       <p class="amount"><?php echo $this->__('There are <a href="%s">%s items</a> in your cart.', $this->getUrl('checkout/cart'), $_cartQty) ?></p> 
      <?php endif ?> 
      <p class="subtotal"> 
       <?php if ($this->canApplyMsrp()): ?> 
        <span class="map-cart-sidebar-total"><?php echo $this->__('ORDER TOTAL WILL BE DISPLAYED BEFORE YOU SUBMIT THE ORDER'); ?></span> 
       <?php else: ?> 
        <span class="label"><?php echo $this->__('Cart Subtotal:') ?></span> <?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()) ?> 
        <?php if ($_subtotalInclTax = $this->getSubtotalInclTax()): ?> 
         <br />(<?php echo Mage::helper('checkout')->formatPrice($_subtotalInclTax) ?> <?php echo Mage::helper('tax')->getIncExcText(true) ?>) 
        <?php endif; ?> 
       <?php endif; ?> 
      </p> 
     </div> 
    <?php endif ?> 
    <?php if($_cartQty && $this->isPossibleOnepageCheckout()): ?> 
    <div class="actions"> 
     <?php echo $this->getChildHtml('extra_actions') ?> 
     <button type="button" title="<?php echo $this->__('Checkout') ?>" class="button" onclick="setLocation('<?php echo $this->getCheckoutUrl() ?>')"><span><span><?php echo $this->__('Checkout') ?></span></span></button> 
    </div> 
    <?php endif ?> 
    <?php $_items = $this->getRecentItems() ?> 
    <?php if(count($_items)): ?> 
     <p class="block-subtitle"><?php echo $this->__('Recently added item(s)') ?></p> 
     <ol id="cart-sidebar" class="mini-products-list"> 
     <?php foreach($_items as $_item): ?> 
      <?php echo $this->getItemHtml($_item) ?> 
     <?php endforeach; ?> 
     </ol> 
     <script type="text/javascript">decorateList('cart-sidebar', 'none-recursive')</script> 
    <?php else: ?> 
     <p class="empty"><?php echo $this->__('You have no items in your shopping cart.') ?></p> 
    <?php endif ?> 
    </div> 
</div> 
<?php endif;?> 
+0

템플릿 속성이 활성화되었습니다. 당신의 도움을 주셔서 감사합니다 –

관련 문제