Skip to content

Instantly share code, notes, and snippets.

@mcjwsk
Last active August 29, 2015 14:18
Show Gist options
  • Save mcjwsk/c53d7decf2b0e77d200c to your computer and use it in GitHub Desktop.
Save mcjwsk/c53d7decf2b0e77d200c to your computer and use it in GitHub Desktop.
$attribute = Mage::getSingleton('eav/config')->getAttribute(Mage_Catalog_Model_Product::Entity, 'color');
$value = $attribute->getFrontend()->getValue($product);
$label = $attribute->getFrontend()->getLabel();
$inputType = $attribute->getFrontend()->getInputType();
$options = $attribute->getFrontend()->getSelectOptions();
$value = $options = $attribute->getFrontend()->getOption($optionId);

Custom checkout/cart total renderers

If you need use a custom total renderer in some place (onepagecheckout for example), you can change the renderer template using local.xml directives.

<reference name="checkout.onepage.review.totals">
	<block type="tax/checkout_subtotal" name="subtotal_total_renderer" template="tax/checkout/subtotal.phtml"/>
	<block type="tax/checkout_shipping" name="shipping_total_renderer" template="tax/checkout/shipping.phtml"/>
	<block type="tax/checkout_discount" name="discount_total_renderer" template="tax/checkout/discount.phtml"/>
	<block type="tax/checkout_tax" name="tax_total_renderer" template="tax/checkout/tax.phtml"/>
	<block type="tax/checkout_grandtotal" name="grand_total_total_renderer" template="tax/checkout/grandtotal.phtml"/>
</reference>

It's important to provide correct block names such us subtotal_total_renderer.

st=>start: Start
e=>end
op=>operation: My Operation
cond=>condition: Yes or No?

st->op->cond
cond(yes)->e
cond(no)->op
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment