It appears as though OP has solved this issue:
There are a buffet of options here. This can be accomplished without a class rewrite by using a custom renderer class or renderer template. The Mage_Checkout_Block_Cart_Abstract
sets the default renderer:
public function __construct()
{
parent::__construct();
$this->addItemRender('default', 'checkout/cart_item_renderer', 'checkout/cart/item/default.phtml');
}
Additional renderers are specified in checkout.xml
:
<checkout_cart_index translate="label">
<!-- ... -->
<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>
<!-- ... ->
</checkout_cart_index
It is possible to override these templates & specifications using similar directives in custom layout XML:
<checkout_cart_index>
<action method="addItemRender" block="checkout.cart">
<type>configurable</type>
<block>checkout/cart_item_renderer_configurable</block
<template>checkout/cart/item/configurable.phtml</template> <!-- custom! -->
</action>
</checkout_cart_index>
The Mage_Catalog_Helper_Product_Configuration::getFormattedOptionValue()
method is ultimately responsible for building the array which is parsed for the display - it's possible to rewrite that class method, but it would be necessary to ensure no knock-on effects exist with other types.
You can download Magento 1.4.1.1 from here then click on Release Archives tab and find the release version that you're looking for and download it, then extract it, then copy coupon.phtml
from base theme app/design/frontend/base/default/template/checkout/cart/coupon.phtml
to your active theme folder.
Or just copy the following code:
<form id="discount-coupon-form" action="<?php echo $this->getUrl('checkout/cart/couponPost') ?>" method="post">
<div class="discount">
<h2><?php echo $this->__('Discount Codes') ?></h2>
<div class="discount-form">
<label for="coupon_code"><?php echo $this->__('Enter your coupon code if you have one.') ?></label>
<input type="hidden" name="remove" id="remove-coupone" value="0" />
<div class="input-box">
<input class="input-text" id="coupon_code" name="coupon_code" value="<?php echo $this->htmlEscape($this->getCouponCode()) ?>" />
</div>
<div class="buttons-set">
<button type="button" title="<?php echo $this->__('Apply Coupon') ?>" class="button" onclick="discountForm.submit(false)" value="<?php echo $this->__('Apply Coupon') ?>"><span><span><?php echo $this->__('Apply Coupon') ?></span></span></button>
<?php if(strlen($this->getCouponCode())): ?>
<button type="button" title="<?php echo $this->__('Cancel Coupon') ?>" class="button" onclick="discountForm.submit(true)" value="<?php echo $this->__('Cancel Coupon') ?>"><span><span><?php echo $this->__('Cancel Coupon') ?></span></span></button>
<?php endif;?>
</div>
</div>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
var discountForm = new VarienForm('discount-coupon-form');
discountForm.submit = function (isRemove) {
if (isRemove) {
$('coupon_code').removeClassName('required-entry');
$('remove-coupone').value = "1";
} else {
$('coupon_code').addClassName('required-entry');
$('remove-coupone').value = "0";
}
return VarienForm.prototype.submit.bind(discountForm)();
}
//]]>
</script>
Best Answer
You shouldn't make translations directly in the template files. You should use Magento's translation files to translate to your language. You can find those files in
If your language isn't there, you probably can find your language pack somewhere on the internet (in Magento 1.9.0.1 a lot of languages were included). Translations are also available on Magento Connect.
As for the links you are trying to translate, a logical translation file to look for is
Mage_Checkout.csv
.Don't forget to edit those translation files with an editor that can save in UTF-8 encoding. I always use Wordpad for this task.