php WC_Subscription::get_related_orders( $return_fields, $order_type ) ?> Parameters. $return_fields: (string) (optional) The columns to return, either 'all' ...
Updated: Added WooCommerce version 3+ Compatibility. It's very easy to get the order ID from subscription object. I am going to select, just like you, ...
foreach ( $this->get_related_orders( 'all', $order_type ) as $related_order_id ) {.
As WC_Subscription get_related_orders() method gives an array of order IDs, you need to use reset() function, to get the last renewal order ID ...
Since orders are a custom post type, you can use get_posts to query orders, which is a pretty standard WP query that most developers are familiar ...
How to get the product associated with a WooCommerce subscription. */. function ct_checkout_subscription_created( $subscription, $order, ...
There's also a few new methods specifically for subscription data, like $ subscription->update_dates() and $subscription->get_related_orders() .
'woocommerce- subscriptions')); } // we need to process an initial payment if ($order->get_total() > 0 ...
Clear all the caches and transient from WooCommerce. This is the technical support forum for WPML - the multilingual WordPress plugin.
Hello, Grateful for any help with this – I am not a technical expert!! When I try to do anything in WooCommerce, e.g. update a product…