Export parent SKU of product
-
I’m trying to add the column for the Parent SKU of the product.
I’ve tried adding this code to the Misc code area and also theme functions.php
add_filter('woe_get_order_product_value_parent_sku', function ($value, $order, $item, $product, $item_meta) { $parent_id = $product->get_parent_id(); $value = get_post_meta($parent_id , '_sku', true); return $value; }, 10, 5);
This code seems to work fine when I preview the export but not when I run it.
I getPHP Fatal error: Uncaught Error: Call to a member function get_parent_id()
I’ve looked over the forum and support website and snippets but can’t find how to do this.
Can you help?
Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Export parent SKU of product’ is closed to new replies.