Preview order retrieval is using wrong DB table
-
I am unable to use the preview feature feature in the editor of the free version (v2.6.1) as it is not pulling in recent orders from WooCommerce. The localized javascript output contains zero orders which is incorrect because there are plenty of orders to choose from.
Looking at the code, it all comes back to classes/inc/class-wecmf-email-customizer-utils.php:get_woo_orders() not returning any results. Looking at that code, it seems it is still looking for orders in the wp_posts table with a post type of ‘shop_order’. This is no longer true as orders are now contained in the wp_wc_orders table (with a post_type meta carry over as ‘shop_order_placeholder’. This enhancement was called the High Performance Order Storage and was initially released in Woo 7.1 and made default in 8.x.
More info about the change made by WooCommerce can be found here: https://developer.woo.com/2022/10/11/hpos-upgrade-faqs/
- The topic ‘Preview order retrieval is using wrong DB table’ is closed to new replies.