0

I am trying to create custom block in cart page, Below is the my code I have tried so many ways, Still i din't get it.

Request_Quotation.xml

<config>
<modules>
    <Request_Quotation>
        <active>true</active>
        <codePool>local</codePool>
    </Request_Quotation>
</modules>
</config>

config.xml

<!-- app/code/local/Request/Quotation/etc/config.xml -->
<?xml version="1.0"?>
<config>
  <modules>
   <Request_Quotation>
  <version>1.0</version>
</Request_Quotation>
</modules>
<global>
<blocks>
  <requestquotation>
    <class>Request_Quotation_Block</class>
  </requestquotation>
</blocks>
<models>
  <requestquotation>
    <class>Request_Quotation_Model</class>
  </requestquotation>
</models>
</global>
<frontend>
<layout>
    <updates>
        <requestquotation>
            <file>requestquotation.xml</file>
        </requestquotation>
    </updates>
</layout>
</frontend>
</config>

/theme/default/layout/requestquotation.xml

<?xml version="0.1.0">
<layout version="0.1.0">
<checkout_cart_index>
     <reference name="checkout.cart">
          <block type="requestquotation/quotation" name="requestquotation_quotation" template="requestquotation/quotation.phtml" />
     </reference>
</checkout_cart_index>
</layout>

/theme/default/template/requestquotation/quotation.phtml

<a href="#quoteform" class="get-quote"><span><span>Get a Quote</span></span></a>

In the cart.phtml I am calling the block.

$this->getBlockHtml('requestquotation_quotation');

// app/code/local/Request/Quotation/Block/Requestquotation.php

class Request_Quotation_Block_Requestquotation extends Mage_Core_Block_Template {
public function getRecentQuotation() {

   }
}

// app/code/local/Request/Quotation/Model/Requestquotation.php

class Request_Quotation_Model_Requestquotation extends Mage_Core_Model_Abstract {
public function getRecentQuotation() {

   }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.