Kompartibility with Kadence WooCommerce Email Designer
-
Hey people. We are using 2 plugins together for our customer.
Kadence WooCommerce Email Designer uses Mockup Order if the user don’t have any orders.
Germanized for WooCommerce tries to add a payment link to the email:
// Pay now button add_action( 'woocommerce_email_before_order_table', array( $this, 'email_pay_now_button' ), 0, 1 );
The
email_pay_now_button
function does not use an$order
, but its id ($order->get_id()
). And since the order does not exist on its own, a further call to thewc_get_order
function throws an error.Is it possible to add some checks there:
public function add_payment_link( $order_id ) { $enabled = true; if ( get_option( 'woocommerce_gzd_order_pay_now_button' ) === 'no' ) { $enabled = false; } $order = wc_get_order( $order_id ); // PLEASE add this next line if ( !$order ) return; if ( ! $order->needs_payment() ) { $enabled = false; } ...
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Kompartibility with Kadence WooCommerce Email Designer’ is closed to new replies.