Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
add_action('woocommerce_order_status_processing', 'wc_szamlazz_on_order_processing');
function wc_szamlazz_on_order_processing($order_id) {
 
  //Fizetési mód lekérése
  $order = new WC_Order($order_id);
  $payment_method = $order->get_payment_method();
 
  //Ha paypal-el lett fizetve és még nincs hozzá számla, csináljon egyet
  if(($payment_method == 'paypal' || $payment_method == 'barion') && !get_post_meta($order_id,'_wc_szamlazz',true)) {
    global $wc_szamlazz;
    $wc_szamlazz->generate_invoice($order_id);
    $wc_szamlazz->generate_invoice_complete($order_id);
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.