0

I have implemented a module to have a custom input product option type (following this tutorial)

This module defines 2 different template for the frontend :

  • one for the catalog view
  • another one used both for the shopping cart, the "view order" page of the client account/oderhistory and invoice. This template uses product option customview possibility.

I would like to define a special template for the "order view" page / invoice? Is it possible?

my layout files is : (app/design/frontend/rwd/default/layout/custoptiontype.xml)

<?xml version="1.0"?>
<layout version="0.1.0">
<catalog_product_view>
    <reference name="product.info.options">
        <action method="addOptionRenderer">
            <type>filesstate</type>
            <block>custoptiontype/catalog_product_view_options_type_filesstate</block>
            <template>custoptiontype/catalog/product/view/options/type/filesstate.phtml</template>
        </action>
    </reference>
</catalog_product_view>
</layout>

the called class

<?php
class Mine_Custoptiontype_Block_Catalog_Product_View_Options_Type_Filesstate
        extends Mage_Catalog_Block_Product_View_Options_Abstract
{
}
?>

the catalog template is defined by app/design/frontend/base/default/template/custoptiontype/catalog/product/view/options/type/filesstate.phtml

Regarding the second template (option customview), the template is in app/design/frontend/base/default/template/custoptiontype/options/customview/filesstate.phtml

called by

<?php
class Mine_Custoptiontype_Model_Catalog_Product_Option_Type_Filesstatetype
    extends Mage_Catalog_Model_Product_Option_Type_Default
{
    public function isCustomizedView()
    {
        return true;
    }

    public function getCustomizedView($optionInfo)
    {
        $customizeBlock = new Mine_Custoptiontype_Block_Options_Type_Customview_Filesstate();
        $customizeBlock->setInfo($optionInfo);
        return $customizeBlock->toHtml();
    }
}
?>

with

<?php
class Mine_Custoptiontype_Block_Options_Type_Customview_Filesstate
    extends Mage_Core_Block_Template
{
    protected $_template = 'custoptiontype/options/customview/filesstate.phtml';
}
?>

thank you for your help,

Alex

1 Answer 1

1

It looks to me like you will have to override the renderer templates, I see no hook into the rendering of the options there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.