Support » Plugin: Cost of Goods for WooCommerce » Using COGS field in order e-mails

  • Resolved toddpinil


    I recently bought and installed the Cost of Goods plugin. This works great for tracking my COGS for my orders. However, I’d like to use the COGS field for one of my order e-mails. Specifically, I’m CCing my supplier on the New Order e-mail, and would like to use the COGS prices, not the retail prices.
    Alternately, is the COGS plugin compatable with the woocommerce dropship plugin, and could I send my purchase orders (with the COGS field) that way.

    It seems the e-mail generates an $orders string, and uses a function called get_items() ??? Sorry, all of my programming experience is from “back in the day” before everything was completely OOP. I can’t even track down WHAT I want to edit, much less how to do so.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Algoritmika Ltd


    Hi @toddpinil,

    You should be able to get COG from order items like this:

    foreach ( $order->get_items() as $item_id => $item ) {
        $item_cost = wc_get_order_item_meta( $item_id, '_alg_wc_cog_item_cost' );

    Please let me know if that helped.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.