Created
August 19, 2017 11:00
-
-
Save kilbot/0f2af68b9c672e59aedc2b9d44459108 to your computer and use it in GitHub Desktop.
Making Cost of Goods plugin compatible with the WC REST API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add the code below to your functions.php file | |
function my_custom_insert_shop_order_object( $order ) { | |
if( function_exists('wc_cog') ) { | |
$WC_COG = wc_cog(); | |
$WC_COG->set_order_cost_meta( $order->get_id() ); | |
} | |
} | |
add_action('woocommerce_rest_insert_shop_order_object', 'my_custom_insert_shop_order_object'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment