diff --git a/monero/include/monero_payments.php b/monero/include/monero_payments.php index e507a59..16dedb0 100644 --- a/monero/include/monero_payments.php +++ b/monero/include/monero_payments.php @@ -213,7 +213,22 @@ class Monero_Gateway extends WC_Payment_Gateway } return false; } - + + public function is_virtual_in_cart($order_id) + { + $order = wc_get_order( $order_id ); + $items = $order->get_items(); + + foreach ( $items as $item ) { + $product = new WC_Product( $item['product_id'] ); + if ( $product->is_virtual() ) { + return true; + } + } + + return false; + } + public function instruction($order_id) { $order = wc_get_order($order_id); @@ -233,6 +248,9 @@ class Monero_Gateway extends WC_Payment_Gateway // Seems that we can't connect with daemon, then set array_integrated_address, little hack $array_integrated_address["integrated_address"] = $address; } + if($this->is_virtual_in_cart($order_id) == true){ + echo "test"; + } $message = $this->verify_payment($payment_id, $amount_xmr2, $order); if ($this->confirmed) { $color = "006400"; @@ -240,6 +258,7 @@ class Monero_Gateway extends WC_Payment_Gateway $color = "DC143C"; } echo "