Changeset 3318321
- Timestamp:
- 06/26/2025 02:41:15 PM (8 months ago)
- Location:
- invoice-generator/trunk
- Files:
-
- 3 edited
-
includes/woo-integration.php (modified) (2 diffs)
-
invoice-generator.php (modified) (3 diffs)
-
readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
invoice-generator/trunk/includes/woo-integration.php
r3318161 r3318321 1 1 <?php 2 2 3 3 add_action('woocommerce_order_status_completed', 'ingen_generate_invoice_for_order'); 4 4 add_action('woocommerce_admin_order_data_after_order_details', 'ingen_display_invoice_pdf_link'); 5 5 add_action('woocommerce_thankyou', 'ingen_generate_invoice_and_show_link_on_thankyou', 10, 1); … … 117 117 } 118 118 } 119 -
invoice-generator/trunk/invoice-generator.php
r3318161 r3318321 4 4 * Plugin URI: https://oplugins.com 5 5 * Description: Generate invoices and download them as PDFs without a database. 6 * Version: 1.0. 76 * Version: 1.0.8 7 7 * Requires at least: 5.2 8 8 * Requires PHP: 7.0 … … 17 17 18 18 require_once INGEN_DIR_PATH . 'includes/generate-invoice-pdf-from-data.php'; 19 require_once INGEN_DIR_PATH . 'includes/woo-integration.php'; 19 20 if (get_option('ingen_enable_woo', true)) { 21 require_once INGEN_DIR_PATH . 'includes/woo-integration.php'; 22 add_action('woocommerce_order_status_completed', 'ingen_generate_invoice_for_order'); 23 } 24 20 25 21 26 add_action('admin_menu', 'ingen_add_admin_menu'); 22 27 add_action('admin_enqueue_scripts', 'ingen_enqueue_assets'); 23 28 add_action('wp_ajax_ingen_generate_pdf', 'ingen_generate_pdf'); 24 add_action(' woocommerce_order_status_completed', 'ingen_generate_invoice_for_order');29 add_action('admin_init', 'ingen_register_settings'); 25 30 26 31 27 32 function ingen_add_admin_menu() { 28 33 add_menu_page('Invoice Generator', 'Invoice Generator', 'manage_options', 'invoice-generator', 'ingen_render_page'); 34 add_submenu_page('invoice-generator', 'Settings', 'Settings', 'manage_options', 'invoice-generator-settings', 'ingen_settings_page'); 29 35 } 30 36 … … 517 523 <?php 518 524 } 525 526 function ingen_register_settings() { 527 register_setting( 528 'ingen_settings_group', 529 'ingen_enable_woo', 530 [ 531 'sanitize_callback' => 'ingen_sanitize_checkbox', 532 'default' => true, 533 ] 534 ); 535 536 add_settings_section( 537 'ingen_main_section', 538 esc_html__('Settings', 'invoice-generator'), 539 '__return_false', 540 'invoice-generator-settings' 541 ); 542 543 add_settings_field( 544 'ingen_enable_woo', 545 esc_html__('WooCommerce Integration', 'invoice-generator'), 546 'ingen_enable_woo_render', 547 'invoice-generator-settings', 548 'ingen_main_section' 549 ); 550 } 551 552 function ingen_enable_woo_render() { 553 $enabled = get_option('ingen_enable_woo', true); 554 ?> 555 <label for="ingen_enable_woo"> 556 <input type="checkbox" 557 id="ingen_enable_woo" 558 name="ingen_enable_woo" 559 value="1" 560 <?php echo checked(1, $enabled, false); ?> /> 561 <?php esc_html_e('Enable automatic invoice generation in WooCommerce', 'invoice-generator'); ?> 562 </label> 563 <?php 564 } 565 566 function ingen_settings_page() { 567 ?> 568 <div class="wrap"> 569 <h1><?php esc_html_e('Invoice Generator Settings', 'invoice-generator'); ?></h1> 570 <form method="post" action="options.php"> 571 <?php 572 settings_fields('ingen_settings_group'); 573 do_settings_sections('invoice-generator-settings'); 574 submit_button(); 575 ?> 576 </form> 577 </div> 578 <?php 579 } 580 581 function ingen_sanitize_checkbox($input) { 582 return $input === '1' ? 1 : 0; 583 } -
invoice-generator/trunk/readme.txt
r3318161 r3318321 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.0 7 Stable tag: 1.0. 77 Stable tag: 1.0.8 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Generate beautiful PDF invoices from the WordPress admin panel — and with full WooCommerce integration! No database needed — all data is handled in-browser oron the fly.11 Generate beautiful PDF invoices from WP admin — with optional WooCommerce integration. No database needed, all done on the fly. 12 12 13 13 == Description == … … 15 15 **Simple Invoice Generator** is a lightweight, easy-to-use WordPress plugin for generating PDF invoices. It also includes powerful **WooCommerce support**, allowing automatic invoice generation when customers complete an order. 16 16 17 🎉 ** In 1.0.7 —WooCommerce Integration!**17 🎉 **WooCommerce Integration!** 18 18 Automatically generate and attach a PDF invoice when a WooCommerce order is placed (e.g. after checkout or when an order is marked as completed). 19 You can also view and download the generated invoice directly from the order admin screen. 19 You can **enable or disable automatic invoice generation** from the plugin settings page with a simple checkbox. 20 21 Also you can view and download the generated invoice directly from the order admin screen. 20 22 21 23 ### Core features: … … 50 52 - The generated invoice uses the order’s billing data, products, prices, currency, and tax details. 51 53 54 🛠️ **Controlling Automatic Invoice Generation** 55 You can toggle the automatic generation of invoices for WooCommerce orders on or off in the plugin settings: 56 57 1. Go to **Invoice Generator > Settings** in the WordPress admin menu. 58 2. Find the **WooCommerce Integration** checkbox. 59 3. Check it to enable automatic invoice generation, or uncheck to disable. 60 4. Save changes. 61 62 This gives you full control to disable invoice generation if you want to handle invoices manually or with another system. 63 64 52 65 == Frequently Asked Questions == 53 66 … … 57 70 = Is WooCommerce required? = 58 71 No, WooCommerce is optional. But if WooCommerce is active, the plugin will auto-enable invoice generation for orders. 72 73 = Can I disable automatic invoice generation for WooCommerce orders? = 74 Yes! From version 1.0.8 onward, you can toggle this feature in the plugin's Settings page using the WooCommerce Integration checkbox. 75 59 76 60 77 == Screenshots == … … 70 87 71 88 == Changelog == 89 90 = 1.0.8 = 91 * Added option to enable/disable automatic invoice generation for WooCommerce orders via plugin settings 72 92 73 93 = 1.0.7 =
Note: See TracChangeset
for help on using the changeset viewer.