After struggling the whole week to create an simple extension for a project of mine, I thought I finished and covered everything. Turns out I was wrong. The thing that I cannot make it work properly is related to the frontend layout. I wanted to add a custom block to the layout inside the "add to cart" area. In order to do this I added the following xml code inside my extension's layout file (after searching docs and testing an entire day):
<layout> <catalog_product_view> <reference name="product.info.options.wrapper.bottom"> <block type="catalog/product_view" name="my.foobar" before="addtocart" template="catalog/product/view/foobar.phtml"/> <action method="append"> <block>my.foobar</block> </action> </reference> </catalog_product_view> </layout>
I thought this was it. That this will add my block to all products above the "add to cart" button area. As you can see I used "product.info.options.wrapper.bottom" as reference. The block appeared where I wanted to, I was happy. My mistake was that I tested on a product page of a configurable product. Today I saw that the "product.info.options.wrapper.bottom" block is not visible on all types of products, making my block to also not be displayed on all products, for instance on a simple product page (unfortunately). I tried different other blocks as a reference, but everything was in vain. I don't know why the original layout puts the "add to cart" container in different parts of the product sidebar. This causes my layout change not to work for all types of products.
Right now I don't know what to add/modify. Can anyone help me with this ?
edit: Here is an image to better reflect the area where I want my block to be positioned