Add Custom Block in Cart Page Above Coupon Block – Magento 1.9

cartlayoutmagento-1.9xml

i am adding the block through xml on cart page. i searching a lot but could not find the find the solution where i am getting wrong.

<checkout_cart_index>

    <reference name="checkout.cart">

            <block type="test/test" before="coupon"   template="test/cart_test.phtml" />

    </reference>
</checkout_cart_index>

when i and the block is added to cart page but i want to add before the coupon block any help will be appreciated.

Best Answer

Try like this,

<reference name="checkout.cart">

   <block type="test/test" before="coupon" name="custom-block"  template="test/cart_test.phtml" />

</reference>

call your custom block before coupon in app\design\frontend\package\theme\template\checkout\cart.phtml,

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

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