Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Invalid method Mage_Core_Block_Template::canPrint
 
Irulusug
Jr. Member
 
Total Posts:  3
Joined:  2008-04-21
 

Hi all.

I´ve got small problem with Magento 1.0.19700. After placing the order, I recieve the following error message:

Invalid method Mage_Core_Block_Template::canPrint(Array
(
)
)
Trace:
#0 [internal function]: Varien_Object->__call('canPrint', Array)
#1 /var/www/magento/app/design/frontend/default/default/template/checkout/success.phtml(29): Mage_Core_Block_Template->canPrint()
#2 /var/www/magento/app/code/core/Mage/Core/Block/Template.php(131): include('/var/www/magent...')
#3 /var/www/magento/app/code/core/Mage/Core/Block/Template.php(163): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#4 /var/www/magento/app/code/core/Mage/Core/Block/Template.php(180): Mage_Core_Block_Template->renderView()
#5 /var/www/magento/app/code/core/Mage/Core/Block/Abstract.php(554): Mage_Core_Block_Template->_toHtml()
#6 /var/www/magento/app/code/core/Mage/Core/Block/Text/List.php(37): Mage_Core_Block_Abstract->toHtml()
#7 /var/www/magento/app/code/core/Mage/Core/Block/Abstract.php(554): Mage_Core_Block_Text_List->_toHtml()
#8 /var/www/magento/app/code/core/Mage/Core/Block/Abstract.php(431): Mage_Core_Block_Abstract->toHtml()
#9 /var/www/magento/app/code/core/Mage/Core/Block/Abstract.php(408): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#10 /var/www/magento/app/design/frontend/default/default/template/page/2columns-right.phtml(50): Mage_Core_Block_Abstract->getChildHtml('content')
#11 /var/www/magento/app/code/core/Mage/Core/Block/Template.php(131): include('/var/www/magent...')
#12 /var/www/magento/app/code/core/Mage/Core/Block/Template.php(163): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#13 /var/www/magento/app/code/core/Mage/Core/Block/Template.php(180): Mage_Core_Block_Template->renderView()
#14 /var/www/magento/app/code/core/Mage/Core/Block/Abstract.php(554): Mage_Core_Block_Template->_toHtml()
#15 /var/www/magento/app/code/core/Mage/Core/Model/Layout.php(505): Mage_Core_Block_Abstract->toHtml()
#16 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(319): Mage_Core_Model_Layout->getOutput()
#17 /var/www/magento/app/code/core/Mage/Checkout/controllers/OnepageController.php(151): Mage_Core_Controller_Varien_Action->renderLayout()
#18 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(342): Mage_Checkout_OnepageController->successAction()
#19 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(159): Mage_Core_Controller_Varien_Action->dispatch('success')
#20 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(146): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#21 /var/www/magento/app/Mage.php(427): Mage_Core_Controller_Varien_Front->dispatch()
#22 /var/www/magento/index.php(40): Mage::run('default')
#23 {main}

Any ideas?

thanks for your help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
till
Member
 
Total Posts:  58
Joined:  2007-12-17
 

Me too. ;-(

Btw, I received my order email. And the order is registered (in the admin).

I was checking out as guest user (didn’t register).

 
Magento Community Magento Community
Magento Community
Magento Community
 
ArthurDent
Sr. Member
 
Total Posts:  86
Joined:  2008-05-06
 

Hi!

Same problem here, too. It happes with check out as guest and check out as registered customer also.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dcase
Jr. Member
 
Total Posts:  7
Joined:  2008-03-29
 

has anyone addressed this? i’m getting reports of this error on my production site and need to resolve it asap.

since this is causing customers to make duplicate orders on my site (they think their order failed), I submitted a bug report on it. if anyone has found a solution already, please share.

http://www.magentocommerce.com/bug-tracking/issue?issue=1981

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Please edit app/design/frontend/default/default/checkout/success.phtml:

// REMOVE THESE LINES:
    <?php if ($this->canPrint()) :?>
    <?php 
echo $this->__('Click <a href="%s" target="_blank">here to print</a> a copy of your order confirmation.'$this->getPrintUrl()) ?>
    <?php 
endif;?>
I will post more information after I’ll find out what went wrong.
 
Magento Community Magento Community
Magento Community
Magento Community
 
dcase
Jr. Member
 
Total Posts:  7
Joined:  2008-03-29
 

thank you, moshe

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Ok, you can restore lines in success.phtml file and update layout/checkout.xml :

// find on approx. line 324 inside handle <checkout_onepage_success>
<block type="core/template" name="checkout.success" template="checkout/success.phtml"/>

// replace with:
<block type="checkout/onepage_success" name="checkout.success" template="checkout/success.phtml"/>
 
Magento Community Magento Community
Magento Community
Magento Community
 
dcase
Jr. Member
 
Total Posts:  7
Joined:  2008-03-29
 

thank you for the quick resolution. i noticed on a more recent install that the type was already set to “checkout/onepage_success”. when i run MagentoConnect updates, do the layouts in the default theme not get updated?

thanks again.

 
Magento Community Magento Community
Magento Community
Magento Community
 
till
Member
 
Total Posts:  58
Joined:  2007-12-17
 

Thanks for following up for us! Really appreciate it!

 
Magento Community Magento Community
Magento Community
Magento Community
 
papaya74
Jr. Member
 
Total Posts:  1
Joined:  2008-05-26
 

Hello dear magentos,

i also get the “Invalid method Mage_Core_Block_Template::canPrint” error, BUT

a) i have Magento Version 1.0.19870.1 installed
b) i have the T&C;extension installed (for german laws..)
c) SSL enabled checkout…

d)
i come to this thread because of the checkout problem here:
http://www.magentocommerce.com/boards/viewthread/7108/P15/

e)
i fixed it as “stefan” from “m_zentrale” described:

<frontend>
<
secure_url>
<
termsandconditions_onepage>/termsandconditions/onepage</termsandconditions_onepage>
</
secure_url>

f) finally i landed in this thread and tried to fix the code in layout/checkout.xml, BUT it’s already there !
There is nothing to fix, but the problem still exists !

g) ==> IT IS WORKING with editing app/design/frontend/default/default/template/checkout/success.phtml:

// REMOVE THESE LINES:
    <?php if ($this->canPrint()) :?>
    <?php 
echo $this->__('Click <a href="%s" target="_blank">here to print</a> a copy of your order confirmation.'$this->getPrintUrl()) ?>
    <?php 
endif;?>

Any help will be highly appreciated wink
Printing would be nice as well, isn’t it ?!

Thanks & best regards,

Harry

 
Magento Community Magento Community
Magento Community
Magento Community
 
JoshBelke
Member
 
Total Posts:  64
Joined:  2008-02-12
NY, NY
 

a) i have Magento Version 1.0.19870.1 installed
f) finally i landed in this thread and tried to fix the code in layout/checkout.xml, BUT it’s already there !
There is nothing to fix, but the problem still exists !
g) ==> IT IS WORKING with editing app/design/frontend/default/default/template/checkout/success.phtml:
Ditto.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lenny2
Sr. Member
 
Total Posts:  171
Joined:  2008-05-21
München
 

Any new information about the Invalid method Mage_Core_Block_Template::canPrint(Array problem?
It would be nice to give the customer possibility to print his/her order at the end of order process…

 
Magento Community Magento Community
Magento Community
Magento Community
 
jampoil
Jr. Member
 
Total Posts:  2
Joined:  2008-06-05
 

When using the Terms & Conditions-Addon you have to go to default/layout/termsandconditions.xml and change last block to something like this:

<checkout_onepage_success>
        <
reference name="root">
            <
action method="setTemplate"><template>page/2columns-right.phtml</template></action>
        </
reference>
        <
reference name="content">
            <
block type="checkout/onepage_success" name="checkout.success" template="checkout/success.phtml"/>
        </
reference>
</
checkout_onepage_success>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Lenny2
Sr. Member
 
Total Posts:  171
Joined:  2008-05-21
München
 

I changed the code but still get the error message....

 
Magento Community Magento Community
Magento Community
Magento Community
 
jampoil
Jr. Member
 
Total Posts:  2
Joined:  2008-06-05
 

hmmm ... it worked for me. Have a look if there are other block type="core/XXX" in combination with checkout. I guess Magento moved the type from core to checkout but this wasn’t carried over to the Terms & Condition package.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mike222
Member
 
Total Posts:  41
Joined:  2008-04-07
Austria
 

As usual clearing the cache was the solution for me after following the suggestions above.

Thanks,

Mike

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2