0

I trying to move the app/design/frontend/default/default/template/checkout/onepage/link.phtml template that has the Proceed to Checkout button into the cart.phtml template. Copy and paste gives errors :) predictably!

How can I do that using the local.xml?

The reason is, I want it in a certain location and not all the methods just that single button.

Thank you

UPDATE

Here's where I'm trying put the button in the cart.phtml

<div class="cart-collaterals">
        <div class="totals">
        <!--RIGHT HERE-->
        <?php echo $this->getChildHtml('totals'); ?>
            <?php echo $this->getChildHtml('coupon') ?>
            <?php echo $this->getChildHtml('giftcards') ?>            
            <?php if(!$this->hasError()): ?>
            <ul class="checkout-types">
            <?php foreach ($this->getMethods('methods') as $method): ?>
                <?php if ($methodHtml = $this->getMethodHtml($method)): ?>
                <li><?php echo $methodHtml; ?></li>
                <?php endif; ?>
            <?php endforeach; ?>
            </ul>
            <?php endif; ?>
            <?php echo $this->getChildHtml('checkout_cart_widget') ?>
        </div>
   </div>   
<div class="cart-additional">
   <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('cart_additional')->toHTML(); ?>
   </div>
</div>

When I just move the code for the button i.e. link.phtml into cart.phtml template like below I get a Magento error page and report (below).

<div class="cart-collaterals">
        <div class="totals">
        <!--BUTTON HERE START-->
<?php if ($this->isPossibleOnepageCheckout()):?>
<div class="checkout-button-holder">
    <button type="button" title="<?php echo $this->__('I\'m Ready to Checkout') ?>" id="button-onepage-checkout" class="button button-onepage-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';">
    <?php echo $this->__('I\'m Ready to Checkout') ?></button>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('cart_button_seals')->toHTML(); ?>
</div>
<?php endif?>
        <!--BUTTON HERE END-->
        <?php echo $this->getChildHtml('totals'); ?>
            <?php echo $this->getChildHtml('coupon') ?>
            <?php echo $this->getChildHtml('giftcards') ?>            
            <?php if(!$this->hasError()): ?>
            <ul class="checkout-types">
            <?php foreach ($this->getMethods('methods') as $method): ?>
                <?php if ($methodHtml = $this->getMethodHtml($method)): ?>
                <li><?php echo $methodHtml; ?></li>
                <?php endif; ?>
            <?php endforeach; ?>
            </ul>
            <?php endif; ?>
            <?php echo $this->getChildHtml('checkout_cart_widget') ?>
        </div>
   </div>   
   <div class="cart-additional">
      <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('cart_additional')->toHTML(); ?>
   </div>

Get error: a:5:{i:0;s:78:"Invalid method Mage_Checkout_Block_Cart::isPossibleOnepageCheckout(Array

  • Where do you want to move and why you want to move it cart.phtml. There is already a code which calls the link.phtml – Sukumar Gorai Jul 3 '18 at 12:50
  • See my update above. The reason I can't just move the code is because with it comes all other payment buttons like PayPal etc. – Freejoy Jul 3 '18 at 13:03
  • What is the error you are getting? – Sukumar Gorai Jul 3 '18 at 13:05
  • See the update again : ) – Freejoy Jul 3 '18 at 13:22
  • Are you using any extension? Because there is no such code <?php if ($this->isPossibleOnepageCheckout()):?> in default cart.phtml – Sukumar Gorai Jul 3 '18 at 14:06
-1

Try the below code in your checkout_cart_index.xml file:

<move element="checkout.cart.methods.bottom" destination="cart.summary" before="checkout.cart.summary.title"/>
  • <move element="checkout.cart.methods.bottom" destination="cart.summary" before="checkout.cart.summary.title"/> – Nitin Singhal Jan 4 at 7:21

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.