So when you click on a product, you get taken to the cart page, in my layouts I have a sidebar included before the content, so i can get a two column layout.
I want the proceed to checkout button to be in the sidebar and not the content area with all the products, buttons etc..
This is what my sidebar include/block looks like:
<aside class="checkout-process">
<div class="totals">
<?
echo $this->getChildHtml('totals');
if(!$this->hasError())
{
?>
<ul class="checkout-types">
<?
foreach ($this->getMethods('top_methods') as $method)
{
if ($methodHtml = $this->getMethodHtml($method))
{
?>
<li><?= $methodHtml; ?></li>
<?
}
}
?>
</ul>
<?
}
?>
</div>
</aside>
However When I tried this, i got an error saying that
Warning: Invalid argument supplied for foreach() in /httpdocs/app/design/frontend/choice/default/template/page/html/checkout_process.phtml on line 12
I've spend the past 3 hours searching through google and stack overflow, but i've come up dry, could anyone explain what i need to do to move this button into another block? or direct me to a tutorial that will help?
Best Answer
Create a new instance of
Mage_Checkout_Block_Cart
as e.g.custom_methods
, assign that as the child of your column parent (e.g. "right"), and then set thecheckout.cart.top_methods
block as a child of your block:Then in your
custom/template.phtml
, do the following: