2

So I want to change a code block (discount vouchers) on the cart page. I need to create a new file to style this block.

The existing layout file (XML) has the following code:

<checkout_cart_index>
 <reference name="checkout.cart.coupon">
 <action method="setTemplate">
 <template>rewardpoints/coupons.phtml</template>
 </action>
 <block type="rewardpoints/coupon" name="checkout_cart_coupon_normal" as="coupon_points" template="rewardpoints/reward_coupon.phtml">
 <block type="checkout/cart_coupon" name="checkout_cart_coupon_reward" as="coupon_original" template="checkout/cart/coupon.phtml"/>
 </block>
 </reference>
</checkout_cart_index>

I'm trying to copy that by adding the following below that:

 <reference name="checkout.cart.coupon.short">
 <action method="setTemplate">
 <template>rewardpoints/coupons_short.phtml</template>
 </action>
 <block type="rewardpoints/coupon" name="cart_coupon_points_short" as="coupon_points_short" template="rewardpoints/reward_coupon_short.phtml">
 <block type="checkout/cart_coupon" name="cart_coupon_points_cart" as="coupon_points_cart" template="checkout/cart/coupon_cart.phtml"/>
 </block>
 </reference> 

I have created the new phtml files and for now, they contain exactly the same data. There are no ID conflicts.

These are being called with the $this->getChildHtml('coupon_points_short'); code. Needless to say, the page is just empty. White. Nothing.

Could someone please advise me how to proceed.

Marius
199k55 gold badges431 silver badges837 bronze badges
asked May 29, 2013 at 14:51
2
  • I just cracked it! This file was actually correct, but it was referenced higher up in another layout template (checkout.xml) first. I put a block in there: <block type="checkout/cart_coupon" name="checkout.cart.coupon.short" as="coupon_short" template="checkout/cart/coupon_short.phtml"/> ...now it works like a charm. Thanks for taking a look. Commented May 29, 2013 at 15:08
  • 2
    Please add this as an answer, mark it in two days as correct. You should be able to answer your own question when I remember correct (15 reputation) Commented May 29, 2013 at 19:07

1 Answer 1

1

I just cracked it! This file was actually correct, but it was referenced higher up in another layout template (checkout.xml) first. I put a block in there: ...now it works like a charm. Thanks for taking a look.

This is the answer, and the question can be marked as closed.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.