I would like to replace the normal label "stock available" with the value of an attribute that the customer can set for each product through control panel. Easy like this and only for simple products.
Now, i would like to do it building a specific module, with which "turn off" this feature when and if needed. Why a module?
- I want to extend (and NOT to override) the class Mage_Catalog_Block_Product_View_Type_Simple with a custom block class.
- I don't want to edit the original rwd/default/template/catalog/product/view/type/availability/default.phtml file
- I don't want to edit the product/view.phtml file changing the piece of code in which the original availability block is called (getChildHtml('product_type_availability'); ?>)
So, i want a total lazy load extension. The only think i can't succed to do is: within the layout file of my module, how can i do something like:
<?xml version="1.0"?>
<layout version="0.1.0">
<catalog_product_view>
<reference name="product.info.availability">
<block type="disponibilita/catalog_product_view_type_semplice" name="product.info.disponibilita" as="product_disponibilita" template="itserv/disponibilita/catalog/product/view/type/default.phtml"/>
</reference>
</catalog_product_view>
</layout>
I know it can't output anything by itself, but, as i've said, i don't want to edit or replace the product/view.phtml file with a getChildHtml call.
So: i know it's possible to remove via xml the product.info.availability block, but how can i replace it with my custom template (and block) without editing any core or original package/theme file?
Note: if i use output="toHtml" within the block declaration it seems to don't recognize the reference product.info.availability