Magento News

 

Custom footer text for each page/product

by Mark (Posted Wed, 12 May 2010 15:24:05 GMT)
Just tried to have a go at it again but to no avail.

What I have done, using your first method:

1 – Added a textarea attribute to products called “footer_text”.
2 – In layout/catalog.xml, added the footer reference to catalog_product_view section, like so:

Code:

<!--
Product view
-->
    <catalog_product_view>
        <!-- Mage_Catalog -->
        <reference name="root">
        </reference>
        <reference name="head">
            <action method="addJs"><script>varien/product.js

            js_csscalendar/calendar-win2k-1.css<!--can_load_calendar_js-->
            jscalendar/calendar.js<!--can_load_calendar_js-->
            jscalendar/calendar-setup.js<!--can_load_calendar_js-->
        
        
            
                
                
                

                
                    descriptioncatalog/product_view_descriptioncatalog/product/view/description.phtml
                    additionalcatalog/product_view_attributescatalog/product/view/attributes.phtml
                    upsell_productscatalog/product_list_upsellcatalog/product/list/upsell.phtml
                
                   
                
                
                
                

                
                    
                    
                        textcatalog/product_view_options_type_textcatalog/product/view/options/type/text.phtml
                        filecatalog/product_view_options_type_filecatalog/product/view/options/type/file.phtml
                        selectcatalog/product_view_options_type_selectcatalog/product/view/options/type/select.phtml
                        datecatalog/product_view_options_type_datecatalog/product/view/options/type/date.phtml
                    
                    
                
                
                    product.tierprices
                    
                    product.info.addtocart
                

                
                    alias_in_layoutcontainer1
                    options_containerproduct
                    product.info.options.wrapper
                    product.info.options.wrapper.bottom
                
                
                    alias_in_layoutcontainer2
                    options_containerproduct
                    product.info.options.wrapper
                    product.info.options.wrapper.bottom
                
                container1ifEquals0alias_in_layoutoptions_container
                container2ifEquals0alias_in_layoutoptions_container
            
        
        
            5
            upsell5
        
        
            
        
        
      
        
    
<!--
Additional block dependant on product type
-->

3 – Then in template/page/html/footer.phtml, added

Code:

<?php echo $this->getChildHtml('product.custom.footer.text'); ?>

like so:

Code:

    <?php echo $this->getChildHtml('store_switcher') ?>

    <?php echo $this->getChildHtml('cms_footer_links') ?>
    <?php echo $this->getChildHtml('footer_links') ?>
    <?php echo $this->getChildHtml('newsletter') ?>

<?php echo $this->getCopyright() ?>

<?php echo $this->getChildHtml('footer_text', false) ?>
<?php echo $this
->getChildHtml('product.custom.footer.text'); ?>

4 – Then created a file called footer-text.phtml inside templates/catalog/product/view with the following code:

Code:

<?php $_product = Mage::registry('product') ?>
<?php if 
($_product): ?>
    <?php $allowedHtmlValues = '

'; // Leave this empty if you want ALL html to be removed ?>
  

<?php else: ?>
  

     Default footer text can go here.
  

<?php endif; ?>

Have I done anything wrong with the above as I still cannot seem to get it to work?



http://magento-forum.co.uk/viewtopic.php?f=5&t=127#p891

Magento Forum

Possibly Related Posts:


 

Leave a Reply