I want to use the "cost of goods" field created by the woocommerce cost of goods plugin when calculating totals on my purchase orders (which are automatically e-mailed) from the woocommerce dropship plugin.
I found the below code in this question by user2389087 for someone who wanted to text order notifications. I'm thinking I can hijack that code with a little tweaking, but I don't know where to put it.
I know the get_items()
function is used in creating the order notification e-mails, but I'm not sure what the dropship plugin uses to gather information.
function custom_woocommerce_complete_order_sms( $order_id ) {
global $woocommerce;
if ( !$order_id )
return;
$order = new WC_Order( $order_id );
$product_list = '';
$order_item = $order->get_items();
foreach( $order_item as $product ) {
$prodct_name[] = $product['name'];
}
$product_list = implode( ',\n', $prodct_name );