Upgrading Jigoshop to 1.6.3 on servers with PHP below 5.3
Jigoshop is a great e-commerce plugin for WordPress. In minutes you can have a very good looking shop with lot of features. With a lot of filters and hooks or by it’s templating system, the plugin can be adapted and used with almost any theme. Because Sayontan provided Suffusion Commerce Pack for supporting Jigoshop in Suffusion, it is not surprising that Jigoshop became very popular as e-commerce solution for theme users.
The last version of Jigoshop (1.6.3) coming with one change which can break your shop:
Fix: Payable ‘pending’ orders are now ‘cancelled’ on the My Account page if any products out of stock and backorders not allowed
Solution used for this fix was a “goto” jump to the beginning of file when the conditions are met. The file affected: /jigoshop/shortcodes/my-account.php
Two little lines of code which can block the reactivation of plugin after upgrading. Why? Because GOTO not exist in PHP before 5.3 version. So, if you have on your server any 5.2.x version, you probably will break the shop by upgrading.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
function jigoshop_my_account( $atts ) { global $post, $current_user; $jigoshop_options = Jigoshop_Base::get_options(); extract(shortcode_atts(array( 'recent_orders' => 5 ), $atts)); // if any products in payable orders are found now out of stock // then the order will be set to 'cancelled' and we'll come here to start over restart: ob_start(); |