Skip to content

Commit

Permalink
added order received page output
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbreen committed Feb 1, 2016
1 parent 8e2aa6c commit dc5a00d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,10 @@
printf('<div class="clear"></div><h4 style="clear: both">%s</h4><div class="address">%s</div>', $order_details_label, $s);
});

// TODO add to order received page
add_action('woocommerce_thankyou', function ($order_id) use ($fields) {
foreach ($fields as $field => $def)
if ($value = get_post_meta($order_id, $field, TRUE))
$s .= sprintf('<tr><th>%s:</th><td>%s<td/></tr>', esc_html($def['label']), esc_html($value));
if ($s)
printf('<table class="shop_table order_details">%s</table>', $s);
},5);

0 comments on commit dc5a00d

Please sign in to comment.