pronamic / wp-pronamic-pay-woocommerce

WooCommerce driver for the WordPress payment processing library.
http://www.wp-pay.org/extensions/woocommerce/
6 stars 2 forks source link

Meta boxes not HPOS ready #63

Closed remcotolsma closed 1 year ago

remcotolsma commented 1 year ago

While developing https://github.com/pronamic/pronamic-order-referrer-for-woocommerce I noticed that the meta boxes implementation in this library is not yet HPOS compatible.

https://github.com/pronamic/wp-pronamic-pay-woocommerce/blob/d67e020da8f5c797a088bc4d1505f3c9f2dadb88/src/Extension.php#L134-L136

https://github.com/pronamic/wp-pronamic-pay-woocommerce/blob/d67e020da8f5c797a088bc4d1505f3c9f2dadb88/src/Extension.php#L1356-L1386

https://github.com/pronamic/pronamic-order-referrer-for-woocommerce/blob/398c4e9967759c5d001bb18c5a519b2dac9ea9aa/src/Plugin.php#L119-L148

rvdsteege commented 1 year ago
-       if ( 'shop_order' !== $post_type ) { 
-           return; 
-       } 
-
-       $order = \wc_get_order();
+       $order = \wc_get_order( $post->ID );

?

remcotolsma commented 1 year ago

Fixed in https://github.com/pronamic/wp-pronamic-pay-woocommerce/commit/ed25f45c677f3001cb43ef867feae24e31eea85c.