Changeset 2470479
- Timestamp:
- 02/07/2021 07:16:22 PM (5 years ago)
- Location:
- apollo/trunk
- Files:
-
- 2 edited
-
apollo.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
apollo/trunk/apollo.php
r2452319 r2470479 4 4 * Plugin URI: https://wordpress.org/plugins/apollo 5 5 * Description: Manually or automatically generate invoices and send PDFs as attachments for WooCommerce orders. 6 * Version: 1.1.1 66 * Version: 1.1.17 7 7 * Author: Studio404 8 8 * Text Domain: apollo 9 9 * Domain Path: /languages 10 * WC tested up to: 4.6.210 * WC tested up to: 5.6.1 11 11 * WC requires at least: 3.0 12 12 */ … … 14 14 defined( 'ABSPATH' ) or exit; 15 15 16 define( 'APOLLO_VERSION', '1.1.1 6' );16 define( 'APOLLO_VERSION', '1.1.17' ); 17 17 18 18 function apollo_load_plugin() { … … 145 145 $attachments[] = Apollo_invoice::getPdf($invoice['id'], $invoice['number'], 'invoice'); 146 146 update_post_meta( $order->get_id(), 'apollo_invoice_sent', true ); 147 148 } else if (!$invoice_id && ($order->get_payment_method() === 'paypal' || $order->get_payment_method() === 'stripe') && !$auto_invoice) { 149 // if not auto sending still create the invoice in case paypal or stripe 150 $invoice = Apollo_invoice::create($order->get_id(), 'invoice'); 147 151 } 148 152 … … 181 185 $auto_create_cod = (bool) get_option('apollo_general_settings')['apollo_cod-invoice']; 182 186 187 $payment_method = $order->get_payment_method(); 188 183 189 $payment_type = 'apollo_payment-'.$order->get_payment_method(); 184 190 $payment_enabled = isset(get_option('apollo_general_settings')[$payment_type]) ? (bool) get_option('apollo_general_settings')[$payment_type] : false; … … 186 192 $order_paid = get_post_meta( $order->get_id(), '_date_paid', true); 187 193 194 $email = new WC_Email_Customer_Completed_Order(); 195 196 // If paid online and order completed email enabled then skip creating invoice 197 // as it will be created in attachment hook to prevent double issuing in case both 198 // hooks get processed at the same time 199 if (($payment_method === 'paypal' || $payment_method === 'stripe') && $email->is_enabled()) { 200 return; 201 } 202 188 203 // create invoice for bank transfer orders, when order status is set to completed 189 if(($ order->get_payment_method()=== 'bacs') || ($payment_enabled && $order_paid !== '')) {204 if(($payment_method === 'bacs') || ($payment_enabled && $order_paid !== '')) { 190 205 Apollo_invoice::create($order_id, 'invoice'); 191 } else if ($ order->get_payment_method()=== 'cod' && $auto_create_cod) {206 } else if ($payment_method === 'cod' && $auto_create_cod) { 192 207 Apollo_invoice::create($order_id, 'invoice'); 193 208 } -
apollo/trunk/readme.txt
r2452319 r2470479 5 5 Requires PHP: 5.6.3 6 6 Stable tag: trunk 7 Tested up to: 5. 4.17 Tested up to: 5.6.1 8 8 9 9 == Description == … … 85 85 86 86 == Changelog == 87 = 1.1.16 - January 8, 2020 = 87 = 1.1.17 - February 7, 2021 = 88 89 - Fixed: Online payment double invoice bug 90 91 = 1.1.16 - January 8, 2021 = 88 92 89 93 - Added: Role shop_manager permissions to plugin 90 94 91 = 1.1.15 - January 8, 202 0=95 = 1.1.15 - January 8, 2021 = 92 96 93 97 - Added: Support for subscription renewal orders 94 98 95 = 1.1.14 - January 2, 202 0=99 = 1.1.14 - January 2, 2021 = 96 100 97 101 - Fixed: PDF file path bug
Note: See TracChangeset
for help on using the changeset viewer.