HowTo: customize the checkout pages
Actually, this HowTo does not just apply to checkout pages, but is a general principle in ZenMagick. Still, a lot of e-commerce systems include much simpler checkout pages to make the process as simple as possible and therefore to increase the conversion rate.
There are two fundamentally different ways of customizing the layout of individual pages.
- Custom layouts
Custom layouts are a basic feature in ZenMagick and implemented in theZMThemeInfoclass. This means changes will apply to individual themes only. (Strictly speaking this is not quite true, as a theme might inherit those theme settings under the right circumstances)
In yourZMThemeInfoclass all you need to do is to add some lines like this:
This will make ZenMagick look for a layout file named checkout_layout.php in the themes content folder for the configured pages. The downside is that you’ll have to add a line for each page you want to change, but usually this should be simple enough.$this->setLayout('checkout_shipping', 'checkout_layout'); $this->setLayout('checkout_billing', 'checkout_layout'); $this->setLayout('checkout_confirm', 'checkout_layout'); ... - Programmatically
The alternative involves a couple lines of real PHP in either the global or the theme’s local.php file. It’s also a bit more limited as it will just disable the sideboxes.
Here is what you would need to add:
if (zm_is_checkout_page(true)) { $zm_layout->setRightColEnabled(false); }
This will hide the right hand side column and, depending on the HTML/CSS give the page content more space.
The same can, of course, be done with the left hand column, too.
There is no strict rule which way to go. A lot depends on the amount of customization required. If it is just about hiding the columns, #2 would perhaps be better as most of the layout file would be just duplicated code and be prone to the classic cut&paste errors.
On the other hand, if the checkout pages are supposed to be rather different (different crumbtrail or funky Ajax thingies springs to mind) , a custom layout file might be best.
