Skip to main content
edited title
Link
brentwpeterson
  • 6.1k
  • 8
  • 44
  • 81

Problem with template magentoMagento Templates

edited body; edited title
Source Link
Sander Mangel
  • 37.5k
  • 5
  • 80
  • 148

Problem with tamplatetemplate magento

When iI use this code in layout Everything is good

<PRODUCT_TYPE_bundle>
    <reference name="head">
        <action method="addItem"><type>skin_js</type><name>js/chocolatebox/chocolatebox.js</name></action>
        <action method="addItem"><type>js_css</type><stylesheet>chocolatebox/css/style.css</stylesheet></action>
    </reference>
    <reference name="product.info">
    <action method="setTemplate">
        <template>chocolatebox/chocolatebox.phtml</template>
    </action>
</reference>
</PRODUCT_TYPE_bundle>

But I want to apply to my template using blocks. When i doing this my template is destroying

<?php
class Chocolate_Box_Block_Catalog_Product_View extends Mage_Catalog_Block_Product_View
{

    public function _beforeToHtml(){
//       /die();
       $this->setTemplate("chocolatebox/chocolatebox.phtml");
    }
}

config

<blocks>
        <chocolatebox>
            <class>Chocolate_Box_Block</class>
        </chocolatebox>
        <bundle>
            <rewrite>
                <catalog_product_view_type_bundle_option_radio>Chocolate_Box_Block_Catalog_Product_View_Type_Bundle_Option_Radio</catalog_product_view_type_bundle_option_radio>
            </rewrite>
        </bundle>
        <catalog>
            <rewrite>
                <product_view>Chocolate_Box_Block_Catalog_Product_View</product_view>
            </rewrite>
        </catalog>
    </blocks>

Problem with tamplate magento

When i use this code in layout Everything is good

<PRODUCT_TYPE_bundle>
    <reference name="head">
        <action method="addItem"><type>skin_js</type><name>js/chocolatebox/chocolatebox.js</name></action>
        <action method="addItem"><type>js_css</type><stylesheet>chocolatebox/css/style.css</stylesheet></action>
    </reference>
    <reference name="product.info">
    <action method="setTemplate">
        <template>chocolatebox/chocolatebox.phtml</template>
    </action>
</reference>
</PRODUCT_TYPE_bundle>

But I want to apply to my template using blocks. When i doing this my template is destroying

<?php
class Chocolate_Box_Block_Catalog_Product_View extends Mage_Catalog_Block_Product_View
{

    public function _beforeToHtml(){
//       /die();
       $this->setTemplate("chocolatebox/chocolatebox.phtml");
    }
}

config

<blocks>
        <chocolatebox>
            <class>Chocolate_Box_Block</class>
        </chocolatebox>
        <bundle>
            <rewrite>
                <catalog_product_view_type_bundle_option_radio>Chocolate_Box_Block_Catalog_Product_View_Type_Bundle_Option_Radio</catalog_product_view_type_bundle_option_radio>
            </rewrite>
        </bundle>
        <catalog>
            <rewrite>
                <product_view>Chocolate_Box_Block_Catalog_Product_View</product_view>
            </rewrite>
        </catalog>
    </blocks>

Problem with template magento

When I use this code in layout Everything is good

<PRODUCT_TYPE_bundle>
    <reference name="head">
        <action method="addItem"><type>skin_js</type><name>js/chocolatebox/chocolatebox.js</name></action>
        <action method="addItem"><type>js_css</type><stylesheet>chocolatebox/css/style.css</stylesheet></action>
    </reference>
    <reference name="product.info">
    <action method="setTemplate">
        <template>chocolatebox/chocolatebox.phtml</template>
    </action>
</reference>
</PRODUCT_TYPE_bundle>

But I want to apply to my template using blocks. When i doing this my template is destroying

<?php
class Chocolate_Box_Block_Catalog_Product_View extends Mage_Catalog_Block_Product_View
{

    public function _beforeToHtml(){
//       /die();
       $this->setTemplate("chocolatebox/chocolatebox.phtml");
    }
}

config

<blocks>
        <chocolatebox>
            <class>Chocolate_Box_Block</class>
        </chocolatebox>
        <bundle>
            <rewrite>
                <catalog_product_view_type_bundle_option_radio>Chocolate_Box_Block_Catalog_Product_View_Type_Bundle_Option_Radio</catalog_product_view_type_bundle_option_radio>
            </rewrite>
        </bundle>
        <catalog>
            <rewrite>
                <product_view>Chocolate_Box_Block_Catalog_Product_View</product_view>
            </rewrite>
        </catalog>
    </blocks>
added 40 characters in body; edited tags
Source Link
Marius
  • 198.5k
  • 55
  • 424
  • 833

When i use this code in layout Everything is good

<PRODUCT_TYPE_bundle>
    <reference name="head">
        <action method="addItem"><type>skin_js</type><name>js/chocolatebox/chocolatebox.js</name></action>
        <action method="addItem"><type>js_css</type><stylesheet>chocolatebox/css/style.css</stylesheet></action>
    </reference>
    <reference name="product.info">
    <action method="setTemplate">
        <template>chocolatebox/chocolatebox.phtml</template>
    </action>
</reference>
</PRODUCT_TYPE_bundle>

But I want to apply to my template using blocks. When i doing this my template is destroying

setTemplate("chocolatebox/chocolatebox.phtml"); }
<?php
class Chocolate_Box_Block_Catalog_Product_View extends Mage_Catalog_Block_Product_View
{

    public function _beforeToHtml(){
//       /die();
       $this->setTemplate("chocolatebox/chocolatebox.phtml");
    }
}
} config Chocolate_Box_Block Chocolate_Box_Block_Catalog_Product_View_Type_Bundle_Option_Radio Chocolate_Box_Block_Catalog_Product_View

config

<blocks>
        <chocolatebox>
            <class>Chocolate_Box_Block</class>
        </chocolatebox>
        <bundle>
            <rewrite>
                <catalog_product_view_type_bundle_option_radio>Chocolate_Box_Block_Catalog_Product_View_Type_Bundle_Option_Radio</catalog_product_view_type_bundle_option_radio>
            </rewrite>
        </bundle>
        <catalog>
            <rewrite>
                <product_view>Chocolate_Box_Block_Catalog_Product_View</product_view>
            </rewrite>
        </catalog>
    </blocks>

When i use this code in layout Everything is good

<PRODUCT_TYPE_bundle>
    <reference name="head">
        <action method="addItem"><type>skin_js</type><name>js/chocolatebox/chocolatebox.js</name></action>
        <action method="addItem"><type>js_css</type><stylesheet>chocolatebox/css/style.css</stylesheet></action>
    </reference>
    <reference name="product.info">
    <action method="setTemplate">
        <template>chocolatebox/chocolatebox.phtml</template>
    </action>
</reference>
</PRODUCT_TYPE_bundle>

But I want to apply to my template using blocks. When i doing this my template is destroying

setTemplate("chocolatebox/chocolatebox.phtml"); } } config Chocolate_Box_Block Chocolate_Box_Block_Catalog_Product_View_Type_Bundle_Option_Radio Chocolate_Box_Block_Catalog_Product_View

When i use this code in layout Everything is good

<PRODUCT_TYPE_bundle>
    <reference name="head">
        <action method="addItem"><type>skin_js</type><name>js/chocolatebox/chocolatebox.js</name></action>
        <action method="addItem"><type>js_css</type><stylesheet>chocolatebox/css/style.css</stylesheet></action>
    </reference>
    <reference name="product.info">
    <action method="setTemplate">
        <template>chocolatebox/chocolatebox.phtml</template>
    </action>
</reference>
</PRODUCT_TYPE_bundle>

But I want to apply to my template using blocks. When i doing this my template is destroying

<?php
class Chocolate_Box_Block_Catalog_Product_View extends Mage_Catalog_Block_Product_View
{

    public function _beforeToHtml(){
//       /die();
       $this->setTemplate("chocolatebox/chocolatebox.phtml");
    }
}

config

<blocks>
        <chocolatebox>
            <class>Chocolate_Box_Block</class>
        </chocolatebox>
        <bundle>
            <rewrite>
                <catalog_product_view_type_bundle_option_radio>Chocolate_Box_Block_Catalog_Product_View_Type_Bundle_Option_Radio</catalog_product_view_type_bundle_option_radio>
            </rewrite>
        </bundle>
        <catalog>
            <rewrite>
                <product_view>Chocolate_Box_Block_Catalog_Product_View</product_view>
            </rewrite>
        </catalog>
    </blocks>
Source Link
Loading