Open thefool opened 1 year ago
Hello @thefool Let me check this, thank you!
Hi, just checking - is there any progress on this?
Hi, according to lines 820-824
in abstract-pr-dhl-wc-order.php
it was never meant to exclude the discount price:
Later in line 862
and 879
the original product price gets set if the previous value was 0
:
I would suggest to use (line_subtotal + line_subtotal_tax) / qty
instead of line_total / qty
to solve this problem.
But we want the discounted price, if the value is bigger than 0. Changing this line would remove this szenario.
Our problem is that we have a discount of 100% on a product that has a different price than the original one, e. g.
Original Product: 99€
Adjusted Price in Order: 59€ (line_subtotal
is 59
)
Order Discount: 100% (so line_total
is 0
)
We get 99€ instead of 59€ on the CN22.
So maybe we can add another fallback after line 822
like
if ( empty( $new_item['item_value'] ) ) {
$new_item['item_value'] = ( ( $item['line_subtotal'] + $item['line_subtotal_tax'] ) / $item['qty'] );
}
and $product_variation->get_price()
is called as a last resort.
Hi, we use your plugin, and the CN22 shows the wrong values. It always shows the base price of the product in our shop, rather than the one from the current order. This means that when the price is dropped using
the CN22 always shows the original price of the product, not the one that would be on the accompanying invoice.
Could you change your plugin so that it reflects the prices of the items in the order, as they are set in the order?