0
votes

I'm trying to rewrite sales order print block. to retrieve store vat number. But the field for the vat number is blank. this works fine when I create my function on the core.

here is my config.xml app/code/local/Company/Sales/Block/etc/config.xml

<config>
    <global>
        <blocks>
            <sales>
                <rewrite>
                    <order_print>Invent_Sales_Block_Order_Print</order_print>
                </rewrite>
            </sales>
        </blocks>
    </global>
</config>

and here is my print.php

app/code/local/Company/Sales/Block/Order/Print.php class Invent_Sales_Block_Order_Print extends Mage_Sales_Block_Order_Print

 public function getVatNumber()
    {
        $storeVAT = Mage::getStoreConfig("general/store_information/merchant_vat_number");

        return $storeVAT;
    }

here is my print.phtml

app/design/frontend/theme/package/template/sales/order/print.phtml

<?php echo "VAT Number:".' '.$this->getVatNumber(); ?>

Your help would be appreciated. Thanks

1

1 Answers

0
votes

I manged to fix this. I misplaced the etc directory. I placed in inside Block, instead of making it to be on the same level.

Thank you