2

I would like to give my customers the ability to print their order after a successful check out in Magento 1.8.

How can I achieve this?

2 Answers 2

1

In checkout success page, the print link has been already available for register customer by default.

In success.phtml file,there is a condition which will only work for logged in customer.

0

See this excerpt from success.phtml file, which is the key template file in order success page.

<?php if ($this->getCanViewOrder() && $this->getCanPrintOrder()) :?>
    <p>
        <?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
        <?php echo $this->getChildHtml() ?>
    </p>
<?php endif;?>

It is clear from the above code that, print link will be shown only when $this->getCanViewOrder() && $this->getCanPrintOrder() is true. In short, this will become true only when follwing conditions are met.

  • Customer is logged in state (means, it won't show for a guest checkout)
  • If the order state is a visible state.

By default, these are the visible states in Magento:

  • new
  • processing
  • complete
  • closed
  • canceled
  • holded
  • payment_review

And invisible states are:

  • pending_payment

This means, all states except pending_payment are in visible mode and most of the cases, a new order state will be either new or processing.

This makes customer logged in status vital to show print order link.

Hope that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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