@j007w
It’s good to hear that the plugin is mostly working for you. I’m working on a large update now, version 2.1, which will make the plugin translatable and also very customisable by theme/plugin developers. But this does make it a little difficult for me to release a quick fix. However, I think these can be solved with some small edits on your site.
Firstly, to print item prices without tax, find the function “star_cloudprnt_print_items()” in “order-handler.php”, and locate these two lines:
$item_total_price = floatval(wc_get_order_item_meta($item_id, "_line_total", true))
+floatval(wc_get_order_item_meta($item_id, "_line_tax", true));
Which just needs to be replaced with:
$item_total_price = floatval(wc_get_order_item_meta($item_id, "_line_total", true));
Secondly, I have not tested WooCommerce Checkout Add-on (I assume it’s this one?), and don’t have access to that plugin, but, we have recently started to keep a [registry of compatible plugins](https://github.com/star-micronics/star-cloudprnt-for-woocommerce/wiki/Plugin-Compatibility) on the projects wiki page, so appreciate the feedback.
According to the WooCommerce Checkout Add-on developer documentation, these checkout add-ons are all added as additional fees to the order, which we don’t currently support. If you would like to try adding in some support though, it should be quite easy thankfully.
You can add the following code to the function named “star_cloudprnt_print_item_totals()”, in “order-handler.php”. Place it where you would like these to show up (I guess just above the tax part that you added).
$fees = $order->get_fees();
foreach($fees as $fee) {
$value = $fee->get_total() - $fee->get_total_tax();
$ft($fee->get_name(), $value);
}
This attempts to print the fee without tax (which I guess you will prefer), but the WooCommerce documentation isn’t clear if get_total()
already includes tax or not, and my test site isn’t well set-up to check this. So you may want to play with the $value = $fee->get_total() - $fee->get_total_tax();
to print exactly the value that you need.
I’d really appreciate any feedback on these modifications, especially so that I can update our plugin compatibility page with the correct advice, and try to make sure that the 2.1 release can work for you without needing code modifications..