Upgrading Jigoshop to 1.6.3 on servers with PHP below 5.3

Apr 202013
 
 Posted by on 20/04/2013 How-To's Tagged with: ,  Add comments

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.

jigoshop

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. 

Of course, the best solution is to ask your host to upgrade php to 5.3 version. But when this isn’t possibile there are some easy solution to continue to use Jigoshop on lower versions (down to 5.2.4, as minimum requirement).

The fix suggested on the Jigoshop forum is very simple, just comment out the marked lines (33 and 87). Also, can replace “my-account.php” file from server with same file from version 1.6.2 (available on Jigoshop forum, in the topic linked above).

But the best solution come from WordPress forum. Instead of using the new GOTO instruction, available only in PHP 5.3. wrap the desired code in a function, in the old PHP manner.

The changes are highlighted above in lines 33-37 and 95. With these changes can benefit by the new feature introduced in 1.6.3, without breaking the plugin on old servers. Can download the file from here: Download patched my_account.php

Finally, any method you use is good – your shop will works again, and probably the Jigoshop team will address this issue in the next update.

UPDATE 23.04.2013. As expected, Jigowatt solved this problem. From today is available 1.6.4 version of Jigoshop which addressed the issue. Enjoy!

https://drafie-design.nl/upgrading-jigoshop-to-1-6-3-on-servers-with-php-below-5-3/trackback/Trackback URI:  

Ciprian

Experienced web developer and graphic designer. Former consultant for Suffusion theme and former moderator on Suffusion Support forum. I teach others while learning myself.

Google+ Profile

    Google+ Page

 Leave a Reply

(Your comment will be published. To contact me privately, use the contact form.)

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  2 Responses to “Upgrading Jigoshop to 1.6.3 on servers with PHP below 5.3”

Comments (2)
  1. Thank You, Florin. On your site I’ve discovered and solved the problem.
    But, as you can see, the issue was solved quickly by the Jigowatt team, as expected.

     
  2. Even useful. Nice article and thanks!