Magento 将签出块添加到标题

Magento 将签出块添加到标题,magento,layout,block,checkout,Magento,Layout,Block,Checkout,我正在尝试向标题中添加一个显示购物车信息的块。 到目前为止,我还没有从这个街区得到任何显示 这是我的checkout.xml: <reference name="header"> <block type="checkout/cart_sidebar" name="checkout.basket" as="checkoutBasket" /> </reference> 这是我的篮子。phtml: <script>alert("TEST"

我正在尝试向标题中添加一个显示购物车信息的块。
到目前为止,我还没有从这个街区得到任何显示

这是我的checkout.xml:

<reference name="header">
    <block type="checkout/cart_sidebar" name="checkout.basket" as="checkoutBasket" />
</reference>

这是我的篮子。phtml:

<script>alert("TEST");</script>
<div class="block checkout-basket">
    TEST
</div>
警报(“测试”);
试验
这是我的header.phtml:

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


我对Magento和它的块系统是相当陌生的,所以我不确定我是否正确地将所有的点连接起来以显示这个块。

xml代码中缺少模板文件

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

如果您想像默认设置一样显示所有购物车项目 然后


在您的购物车中。“,$this->getUrl('checkout/cart'))?>


()


模板属性被激活。谢谢你的帮助
<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>
<?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;?>