enquiry-quotation-for-woocommerce
Last commit date
admin
1 year ago
includes
1 year ago
languages
1 year ago
public
1 year ago
LICENSE.txt
1 year ago
README.txt
1 year ago
index.php
1 year ago
pisol-enquiry-quotation-woocommerce.php
1 year ago
uninstall.php
1 year ago
wpml-config.xml
1 year ago
pisol-enquiry-quotation-woocommerce.php
134 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * The plugin bootstrap file |
| 5 | * |
| 6 | * This file is read by WordPress to generate the plugin information in the plugin |
| 7 | * admin area. This file also includes all of the dependencies used by the plugin, |
| 8 | * registers the activation and deactivation functions, and defines a function |
| 9 | * that starts the plugin. |
| 10 | * |
| 11 | * @link piwebsolution.com |
| 12 | * @since 2.2.33.30 |
| 13 | * @package Pisol_Enquiry_Quotation_Woocommerce |
| 14 | * |
| 15 | * @wordpress-plugin |
| 16 | * Plugin Name: Enquiry Quotation for WooCommerce |
| 17 | * Plugin URI: piwebsolution.com |
| 18 | * Description: Product enquiry and quotation plugin for WooCommerce that can save enquiry and email the enquiry as well |
| 19 | * Version: 2.2.33.30 |
| 20 | * Author: PI Websolution |
| 21 | * Author URI: https://www.piwebsolution.com/faq-for-woocommerce-product-enquiry-quotation/ |
| 22 | * License: GPL-2.0+ |
| 23 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 24 | * Text Domain: pisol-enquiry-quotation-woocommerce |
| 25 | * Domain Path: /languages |
| 26 | * WC tested up to: 9.0.2 |
| 27 | */ |
| 28 | |
| 29 | // If this file is called directly, abort. |
| 30 | if ( ! defined( 'WPINC' ) ) { |
| 31 | die; |
| 32 | } |
| 33 | |
| 34 | include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 35 | |
| 36 | if(!is_plugin_active( 'woocommerce/woocommerce.php')){ |
| 37 | function pi_eqw_free_notification_my_error_notice() { |
| 38 | ?> |
| 39 | <div class="error notice"> |
| 40 | <p><?php _e( 'Please Install and Activate WooCommerce plugin, without that this plugin cant work', 'pisol-enquiry-quotation-woocommerce' ); ?></p> |
| 41 | </div> |
| 42 | <?php |
| 43 | } |
| 44 | add_action( 'admin_notices', 'pi_eqw_free_notification_my_error_notice' ); |
| 45 | deactivate_plugins(plugin_basename(__FILE__)); |
| 46 | return; |
| 47 | } |
| 48 | |
| 49 | if(is_plugin_active( 'enquiry-quotation-for-woocommerce-pro/pisol-enquiry-quotation-woocommerce.php')){ |
| 50 | function pi_eqw_notification_my_pro_notice() { |
| 51 | ?> |
| 52 | <div class="error notice"> |
| 53 | <p><?php _e( 'You have the PRO version of Enquiry plugin active, deactivate it then you can use free version', 'pisol-enquiry-quotation-woocommerce'); ?></p> |
| 54 | </div> |
| 55 | <?php |
| 56 | } |
| 57 | add_action( 'admin_notices', 'pi_eqw_notification_my_pro_notice' ); |
| 58 | deactivate_plugins(plugin_basename(__FILE__)); |
| 59 | return; |
| 60 | }else{ |
| 61 | |
| 62 | /** |
| 63 | * Declare compatible with HPOS new order table |
| 64 | */ |
| 65 | add_action( 'before_woocommerce_init', function() { |
| 66 | if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { |
| 67 | \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); |
| 68 | } |
| 69 | } ); |
| 70 | |
| 71 | /** |
| 72 | * Currently plugin version. |
| 73 | * Start at version 2.2.33.30 and use SemVer - https://semver.org |
| 74 | * Rename this for your plugin and update it as you release new versions. |
| 75 | */ |
| 76 | define( 'PISOL_ENQUIRY_QUOTATION_WOOCOMMERCE_VERSION', '2.2.33.30' ); |
| 77 | define( 'PI_EQW_PRICE', '$25' ); |
| 78 | define( 'PI_EQW_BUY_URL', 'https://www.piwebsolution.com/product/enquiry-quotation-for-woocommerce-pro/' ); |
| 79 | define( 'PI_EQW_DELETE_SETTING', false); |
| 80 | |
| 81 | /** |
| 82 | * The code that runs during plugin activation. |
| 83 | * This action is documented in includes/class-pisol-enquiry-quotation-woocommerce-activator.php |
| 84 | */ |
| 85 | function activate_pisol_enquiry_quotation_woocommerce() { |
| 86 | require_once plugin_dir_path( __FILE__ ) . 'includes/class-pisol-enquiry-quotation-woocommerce-activator.php'; |
| 87 | Pisol_Enquiry_Quotation_Woocommerce_Activator::activate(); |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * The code that runs during plugin deactivation. |
| 92 | * This action is documented in includes/class-pisol-enquiry-quotation-woocommerce-deactivator.php |
| 93 | */ |
| 94 | function deactivate_pisol_enquiry_quotation_woocommerce() { |
| 95 | require_once plugin_dir_path( __FILE__ ) . 'includes/class-pisol-enquiry-quotation-woocommerce-deactivator.php'; |
| 96 | Pisol_Enquiry_Quotation_Woocommerce_Deactivator::deactivate(); |
| 97 | } |
| 98 | |
| 99 | register_activation_hook( __FILE__, 'activate_pisol_enquiry_quotation_woocommerce' ); |
| 100 | register_deactivation_hook( __FILE__, 'deactivate_pisol_enquiry_quotation_woocommerce' ); |
| 101 | |
| 102 | /** |
| 103 | * The core plugin class that is used to define internationalization, |
| 104 | * admin-specific hooks, and public-facing site hooks. |
| 105 | */ |
| 106 | require plugin_dir_path( __FILE__ ) . 'includes/class-pisol-enquiry-quotation-woocommerce.php'; |
| 107 | |
| 108 | function pisol_eqw_plugin_link( $links ) { |
| 109 | $links = array_merge( array( |
| 110 | '<a href="' . esc_url( admin_url( '/admin.php?page=pisol-enquiry-quote' ) ) . '">' . __( 'Settings', 'pisol-enquiry-quotation-woocommerce' ) . '</a>', |
| 111 | '<a style="color:#0a9a3e; font-weight:bold;" target="_blank" href="' . esc_url(PI_EQW_BUY_URL) . '">' . __( 'Buy PRO Version','pisol-enquiry-quotation-woocommerce' ) . '</a>' |
| 112 | ), $links ); |
| 113 | return $links; |
| 114 | } |
| 115 | add_action( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'pisol_eqw_plugin_link' ); |
| 116 | |
| 117 | /** |
| 118 | * Begins execution of the plugin. |
| 119 | * |
| 120 | * Since everything within the plugin is registered via hooks, |
| 121 | * then kicking off the plugin from this point in the file does |
| 122 | * not affect the page life cycle. |
| 123 | * |
| 124 | * @since 1.0.0 |
| 125 | */ |
| 126 | function run_pisol_enquiry_quotation_woocommerce() { |
| 127 | |
| 128 | $plugin = new Pisol_Enquiry_Quotation_Woocommerce(); |
| 129 | $plugin->run(); |
| 130 | |
| 131 | } |
| 132 | run_pisol_enquiry_quotation_woocommerce(); |
| 133 | |
| 134 | } |