Merge pull request #15208 from woocommerce/fix/15203
Missing variable in legacy API
This commit is contained in:
commit
58189cb4b5
|
@ -243,8 +243,8 @@ class WC_API_Orders extends WC_API_Resource {
|
||||||
'meta' => array_values( $item_meta ),
|
'meta' => array_values( $item_meta ),
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( in_array( 'products', $expand ) ) {
|
if ( in_array( 'products', $expand ) && is_object( $product ) ) {
|
||||||
$_product_data = WC()->api->WC_API_Products->get_product( $product_id );
|
$_product_data = WC()->api->WC_API_Products->get_product( $product->get_id() );
|
||||||
|
|
||||||
if ( isset( $_product_data['product'] ) ) {
|
if ( isset( $_product_data['product'] ) ) {
|
||||||
$line_item['product_data'] = $_product_data['product'];
|
$line_item['product_data'] = $_product_data['product'];
|
||||||
|
|
Loading…
Reference in New Issue