I have recently just created customized emails for Woocommerce. I have everything working except one problem. Before I was bringing/getting the "product image" I was able to load the "product price" with no problems.
However now I am getting the product image, I am having trouble getting the "product price" and orders are not processed and completed.
Here is the PHP code I am using to gather all the information to display in the email.
<?php
foreach ($order->get_items() as $theitem_id => $theitem ) {
// PRODUCT NAME
$product_name = $theitem->get_name();
// PRODUCT QUANTITY
$quantity = $theitem->get_quantity();
// LINE ITEM SUBTOTAL (Non discounted)
$item_subtotal = $theitem->get_subtotal();
$item_subtotal = number_format( $item_subtotal, 2 );
// LINE ITEM TOTAL (discounted)
$item_total = $theitem->get_total();
$item_total = number_format( $item_total, 2 );
$product_id = $theitem['product_id'];
$product = wc_get_product( $product_id );
// PRODUCT IMAGE
$prodimage = $product->get_image( array( 200, 200 ) )
// PRODUCT PRICE
$product_price = $product->get_price();
?>
I am sure I am not far away from getting this right as when I comment out the "product price" PHP code then everything works fine (without the price being gathered obviously)
Any help would be great , thanks very much