Magento - Proceed to Checkout button location in theme
Asked Answered
B

5

6

I am looking to track down the file (and it's location) that generates the "Proceed to Checkout" button in the Magento cart.

Try adding a product to the cart, and then proceeding to the cart. The "Proceed to Checkout" button is on the right hand side of the cart.

I am using a hacked-about variation of the blank theme, if that makes any difference.

Thanks in advance for your help.

Ballroom answered 27/7, 2012 at 14:19 Comment(1)
3 answers at exactly the same time ;-)Magnetize
M
9

The code that produces the Proceed to Checkout link is in templates/checkout/onepage/link.phtml

By default the block for it is in checkout.xml;

            <block type="core/text_list" name="checkout.cart.methods" as="methods" translate="label">
                <label>Payment Methods After Checkout Button</label>
                <block type="checkout/onepage_link" name="checkout.cart.methods.onepage" template="checkout/onepage/link.phtml"/>
                <block type="checkout/multishipping_link" name="checkout.cart.methods.multishipping" template="checkout/multishipping/link.phtml"/>
            </block>
Magnetize answered 27/7, 2012 at 14:28 Comment(2)
Chosen as best answer due to thoroughness, though all other answers are correct. Thanks all, it was driving me mad trying to find it.Ballroom
Excellent - sanity preserved......for the moment. Magento's next hair tearing scenario is surely not far off!Magnetize
N
3
app/design/frontend/your_package/your_theme/template/checkout/onepage/link.phtml
Newsstand answered 27/7, 2012 at 14:29 Comment(0)
F
2

The "Proceed to Checkout" button that leads to the onepage checkout, is generated with this template : checkout/onepage/link.phtml.

You should be able to know what buttons are added with which templates by looking at the checkout_cart_index handle of the checkout.xml layout file. The block named checkout.cart.methods contains all the buttons, and the two base checkout buttons should be added to it directly in the same file.

Franklinfranklinite answered 27/7, 2012 at 14:29 Comment(0)
O
2

Go to System -> Configuration -> Developer change a Current Configuration Scope to some of your websites or stores than go to Debug section - and change Template Path Hints setting to "Yes". Now, on frontend, you'll see an full path to your template file on a filesystem for every block that rendered, so now you can see where your template (that renders a link) exists.

Ointment answered 27/7, 2012 at 14:33 Comment(0)
L
1

Open this path in your root directory

/app/design/frontend/base/default/template/checkout/onepage/link.phtml

find this code

<?php if ($this->isPossibleOnepageCheckout()):?>
    <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Proceed to Checkout')) ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';"><span><span><?php echo $this->__('Proceed to Checkout') ?></span></span></button>
<?php endif?>
Logo answered 27/11, 2015 at 7:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.