Magento News
Magento: Add Product Option(Color, Size, Quantity, Add To Bag) to custom module
I have recently inherited a Magento module from my companies old development shop. We are currently migrating from Community 1.3 to Enterprise 1.10. One of my jobs is to migrate this module over to the new platform and I’ve been having issues. I believe it is mostly my lack of knowledge with working with Magento. Basically I’ve rebuild most of the main view of the module. But am stumped as to how to add the product options. On our Product Detail Pages the product options looks like this:
I would like to add this product option to the module I inherited. It was originally there, but there seems to be some key differences between 1.3 and 1.10 that I don’t know.
Now looking at the source code. It looks like these product options are coming from this block of code:
<fieldset class="product-options" id="product-options-wrapper">
<?php echo $this->getChildHtml('', true, true);?>
</fieldset>
<script type="text/javascript">decorateGeneric($$('#product-options-wrapper dl'), ['last']);</script>
I’ve traced this to this file: app/design/frontend/enterprise/default/template/catalog/product/view/options/wrapper.phtml
I’ve also found another module that looks like they are including it in their module via the XML code:
<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml">
<block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/>
<block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
<action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
<action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
<action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
<action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
</block>
<block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
</block>
But when I add this XML code into my xml file:
<block type="combo/product_view" name="product.view" template="combo-module/product/view.phtml">
<block type="combo/breadcrumbs" name="combo.breadcrumb" template="combo-module/breadcrumbs.phtml" />
<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml">
<block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/>
<block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
<action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
<action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
<action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
<action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
</block>
<block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
</block>
</block>
I get the following error:
Fatal error: Call to a member function getMetaTitle() on a non-object in /home/XXXX/dev.mydevsite.com/app/code/core/Mage/Catalog/Block/Product/View.php on line 48
I know this is probably a lack of knowledge on my part. But any suggestions. If I had the time to rewrite from scratch I would. But time is not on my side and I just need to get it working. Then I can go back later and either rewrite or update the code. I would greatly, GREATLY appreciate and help or insight.
Magento: Add Product Option(Color, Size, Quantity, Add To Bag) to custom module
Possibly Related Posts:
- Database query different results
- Menu highlight in magento under admin
- magento disable a banner on certain category pages or have a banner with multiple links
- Magento, using ACL for frontend. Possible?
- Magento IE-7 Fix In Windows XP
RSS Feed