Created
November 20, 2018 12:49
-
-
Save trueqap/d34dbb4a2ef76229eb4051439c1d3cd2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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