Update to WooCommerce 2.0 and missing information for the product (in the front-end)

WooThemes released the new WooCommerce 2.0 recently and updating seems really charming with the new interface and other listed features.

However sometimes updating won’t be the best thing you can do if your theme is made for 1.6.

In non-technical words – if after the update some of the information is missing or is wrong when seeing it in the front-end this is most related to the theme.

The problem here is that many theme developers (even WooThemes themselves) are using the WC_Product to get the product’s data. The problem is that you can no longer create an instance of WC_Produc by post ID. This is probably related to the new function get_product() which I think is really poorly documented in their official docs for some thing to put in the new release information.

In my case for a theme made from WooThemes themselves I had:

//inside the loop
$_product = &new WC_Product( $loop->post->ID );

This would no longer work so I changed it to

$_product = get_product(  $loop->post->ID );

Which fixed it right away.

In my opinion it would be good if they could update their own existing themes to work with the new version insead of just not caring what their end-users would end up with.

Leave a comment

Your email address will not be published. Required fields are marked *

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