Jigoshop 1.8 and Suffusion
Jigoshop is a great e-commerce plugin which I successfully used for our e-shops. With the help of Suffusion Commerce Pack, Jigoshop is integrated seamlessly in Suffusion. Just install and activate the plugin, then the output of Jigoshop is wrapped right in the markup of Suffusion.
However, there is a problem. If you want to use [sale_products] Jigoshop shortcode will notice that the markup of Sales page is broken and sidebars are displayed below the content. If you don’t display the sales page and use only the pages generated automatically by Jigoshop OR you use NO SIDEBARS template you will not notice any breakage, all pages are rendered as expected in Suffusion.
The problem was detected by an user of Suffusion forum while using Jigoshop 1.8, but my thought is that the problem is older, the same structure of files is present in Jigoshop 1.7.3 (from what I can check because usually I upgrade all themes/plugins to the newer versions ).
Looking into loop-on_sale.php and loop-shop.php (those 2 templates are used to display the same things – products) can see a difference. In the loop-shop file (which is displayed correctly) ob_start(); is called after the line if ( ! isset( $columns ) || ! $columns ) $columns = apply_filters( ‘loop_shop_columns’, 3 ); , but in the loop-on_sale, ob_start(); is called before the similar line.
1 2 3 4 5 6 7 8 9 10 11 12 |
global $columns, $per_page; do_action('jigoshop_before_shop_loop'); $loop = 0; if ( ! isset( $columns ) || ! $columns ) $columns = apply_filters( 'loop_shop_columns', 3 ); //only start output buffering if there are products to list if ( have_posts() ) { ob_start(); } |
1 2 3 4 5 6 7 8 9 |
global $columns, $per_page, $jigoshop_sale_products, $post; ob_start(); do_action('jigoshop_before_shop_loop'); $loop = 0; if (!isset($columns) || !$columns) $columns = apply_filters('loop_shop_columns', 4); |
So, on the loop-on_sale template I moved the call to ob_start() after the “if” line as is showed below and all things start to works as expected.
1 2 3 4 5 6 7 8 9 |
global $columns, $per_page, $jigoshop_sale_products, $post; do_action('jigoshop_before_shop_loop'); $loop = 0; if (!isset($columns) || !$columns) $columns = apply_filters('loop_shop_columns', 4); ob_start(); |
For protection against further upgrades of Jigoshop which can break again the template, I copied the new file in my child theme folder (here can read more about child themes). You can download the new file from here: Download changed loop-on_sale.php
For not seeing all products on the Sales page when you don’t have any product on sale need to apply the solution provided by Jeff on Jigoshop forum. Can download init.php modified according with Jeff’s directions from here: Download changed init.php and replace init.php from jigoshop/shortcodes folder.
For having themed Jigoshop pages on your Suffusion site see my post about Themed Jigoshop 1.8.
[…] With the last update of Jigoshop I observed some malfunctions. One of them was the malfunction of Sales Template and was treated in my previous post about Jigoshop 1.8. and Suffusion. […]