We've seen that the print style for existing Magento themes is often not to the same standard as the styling for the computer screen and other mediums. Before starting our theme's print stylesheet, it's important to take note of some good practices in creating print stylesheets, as well as the limitations of print stylesheets.
Many options that may be defined within the print stylesheet, such as whether or not to print images within the page, can be overwritten. This means that even with the best intentions when writing our store's print stylesheet, it will never be ideal for every browser and for every customer.
We just need to decide what information will be displayed when each page in our store is printed, and what information we wouldn't want to print.
There is no reliable way to disable the print preview feature of a browser; quite rightly, as it should remain a choice of the web site's visitor.
One well-documented quirk of print stylesheets occurs in some Gecko-based browsers. When a long div
element is floated with CSS, these browsers tend to ignore any content that is not printed on the first page where the div
element occurs.
This can be quite easily bypassed with the addition of float: none
to the relevant div
tags in our store's print stylesheet.
The primary content of each page should be printed. For most pages on our Magento store, this will include information such as the price and description of a product, as well as photographs of it.
It's a good idea to include your store's logo and its name. If the printed page of your store is lost and found weeks, or even months later, then these will make it easier to recognize that page.
It's okay to print promotional graphics such as callouts, so long as they don't get in the way of the primary content of the page being printed. Generally, this means that it's better to make sure callout graphics are printed below or perhaps alongside the details of the product.
Bear in mind that some customers will print just the page that they want, which may mean that they don't see the promotional graphics when printed, and as mentioned, some visitors may even have disabled images from printing.
As we saw in the sample print stylesheets that we looked at earlier, there is also a lot that we can hide to lower the amount of content our store's customers need to print. This includes: