Do not exclude free items

This commit is contained in:
Alex P 2023-05-09 17:24:03 +03:00
parent af5d33dc78
commit 3cd9e6829b
No known key found for this signature in database
GPG key ID: 54487A734A204D71

View file

@ -110,7 +110,7 @@ class PurchaseUnitFactory {
$items = array_filter( $items = array_filter(
$this->item_factory->from_wc_order( $order ), $this->item_factory->from_wc_order( $order ),
function ( Item $item ): bool { function ( Item $item ): bool {
return $item->unit_amount()->value() > 0; return $item->unit_amount()->value() >= 0;
} }
); );
$shipping = $this->shipping_factory->from_wc_order( $order ); $shipping = $this->shipping_factory->from_wc_order( $order );
@ -166,7 +166,7 @@ class PurchaseUnitFactory {
$items = array_filter( $items = array_filter(
$this->item_factory->from_wc_cart( $cart ), $this->item_factory->from_wc_cart( $cart ),
function ( Item $item ): bool { function ( Item $item ): bool {
return $item->unit_amount()->value() > 0; return $item->unit_amount()->value() >= 0;
} }
); );