Question

Using Magento 1.9.0.1

When i am logged in as customer and placed an order, upon /checkout/onepage/success/ there is a line of text saying: Click here to print a copy of your order confirmation.

When clicking that link, it shows a (unstyled) page with the order details : /sales/order/print/order_id/3/ AND the "popup" for printing the order.

This also works the same when going in my account and viewing orders...

1) how can i prevent the contents showing on page (unstyled) so it will only show the print popup

2) what file would i need to edit to remove that print option all together from the page after placing the order: /checkout/onepage/success/

3) i also want to show that page as 1 column page would that need to be done on that same page?

Thought i might ask all these questions in 1 post as they are all closely related.

Thanks

Carlo

Was it helpful?

Solution

  1. Not sure what you mean, here. Are you referring the Google Chrome "print dialog?" - not much you can do about that one. As for preventing the printable order contents from appearing in a popup/new tab, you'd can take one approach that comes to mind.

Print Dialog Override, AJAX Method

Extend app/design/frontend/base/default/template/checkout/success.phtml -- may be different depending on your theme. Change this line:

<?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>

To this:

<?php echo $this->__('Click <a href="javascript:;" onclick="new Ajax.Request('%s', {onSuccess:function(){ ... }});">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>

The above is more like pseudo-code, and I do not advise to write it like that, but you can get the idea that you'd make an AJAX request for the printable contents, and upon its return, you can write it directly to the success page in a modal or something nice -- then prompt to print.

  1. See the template referenced in #1.

  2. "That page" -- The checkout success page? See below.

Changing the Checkout Success Template

Extend the app/design/frontend/base/default/layout/checkout.xml -- or else add the following to your local.xml

<checkout_onepage_success translate="label">
    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
</checkout_onepage_success>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top