/** * Constructor. * * @version 2.3.0 */ function __construct() { $this->id = 'checkout_custom_fields'; $this->short_desc = __('Checkout Custom Fields', 'woocommerce-jetpack'); $this->desc = __('Add custom fields to WooCommerce checkout page.', 'woocommerce-jetpack'); parent::__construct(); if ($this->is_enabled()) { add_filter('woocommerce_checkout_fields', array($this, 'add_custom_checkout_fields'), PHP_INT_MAX); add_action('woocommerce_admin_billing_fields', array($this, 'add_custom_billing_fields_to_admin_order_display'), PHP_INT_MAX); add_action('woocommerce_admin_shipping_fields', array($this, 'add_custom_shipping_fields_to_admin_order_display'), PHP_INT_MAX); add_action('woocommerce_admin_shipping_fields', array($this, 'add_custom_order_and_account_fields_to_admin_order_display'), PHP_INT_MAX); add_action('woocommerce_order_details_after_order_table', array($this, 'add_custom_fields_to_order_display'), PHP_INT_MAX); add_action('woocommerce_email_after_order_table', array($this, 'add_custom_fields_to_emails'), PHP_INT_MAX, 2); add_filter('woo_ce_order_fields', array($this, 'add_custom_fields_to_store_exporter')); add_filter('woo_ce_order', array($this, 'add_custom_fields_to_store_exporter_order'), PHP_INT_MAX, 2); add_action('woocommerce_checkout_update_order_meta', array($this, 'update_custom_checkout_fields_order_meta')); /* add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // add_action( 'wp_head', array( $this, 'add_datepicker_script' ) ); add_action( 'init', array( $this, 'register_script' ) ); */ // add_action( 'woocommerce_order_formatted_shipping_address', array( $this, 'add_custom_shipping_fields_to_formatted_address' ), PHP_INT_MAX, 2 ); // add_filter( 'woocommerce_form_field_' . 'number', array( $this, 'woocommerce_form_field_type_number' ), PHP_INT_MAX, 4 ); add_filter('woocommerce_form_field_' . 'text', array($this, 'woocommerce_form_field_type_number'), PHP_INT_MAX, 4); } }
/** * Constructor. * * @version 2.5.2 */ public function __construct() { $this->id = 'pdf_invoicing_numbering'; $this->parent_id = 'pdf_invoicing'; $this->short_desc = __('Numbering', 'woocommerce-jetpack'); parent::__construct('submodule'); }
/** * Constructor. * * @version 2.5.0 * @since 2.4.8 */ function __construct() { $this->id = 'product_open_pricing'; $this->short_desc = __('Product Open Pricing (Name Your Price)', 'woocommerce-jetpack'); $this->desc = __('Let your WooCommerce store customers enter price for the product manually.', 'woocommerce-jetpack'); $this->link = 'http://booster.io/features/woocommerce-product-open-pricing-name-your-price/'; parent::__construct(); if ($this->is_enabled()) { add_action('add_meta_boxes', array($this, 'add_meta_box')); add_action('save_post_product', array($this, 'save_meta_box'), PHP_INT_MAX, 2); add_filter('woocommerce_get_price', array($this, 'get_open_price'), PHP_INT_MAX, 2); add_filter('woocommerce_get_price_html', array($this, 'hide_original_price'), PHP_INT_MAX, 2); add_filter('woocommerce_get_variation_price_html', array($this, 'hide_original_price'), PHP_INT_MAX, 2); add_filter('woocommerce_is_sold_individually', array($this, 'hide_quantity_input_field'), PHP_INT_MAX, 2); add_filter('woocommerce_is_purchasable', array($this, 'is_purchasable'), PHP_INT_MAX, 2); add_filter('woocommerce_product_supports', array($this, 'disable_add_to_cart_ajax'), PHP_INT_MAX, 3); add_filter('woocommerce_product_add_to_cart_url', array($this, 'add_to_cart_url'), PHP_INT_MAX, 2); add_filter('woocommerce_product_add_to_cart_text', array($this, 'add_to_cart_text'), PHP_INT_MAX, 2); add_action('woocommerce_before_add_to_cart_button', array($this, 'add_open_price_input_field_to_frontend'), PHP_INT_MAX); add_filter('woocommerce_add_to_cart_validation', array($this, 'validate_open_price_on_add_to_cart'), PHP_INT_MAX, 2); add_filter('woocommerce_add_cart_item_data', array($this, 'add_open_price_to_cart_item_data'), PHP_INT_MAX, 3); add_filter('woocommerce_add_cart_item', array($this, 'add_open_price_to_cart_item'), PHP_INT_MAX, 2); add_filter('woocommerce_get_cart_item_from_session', array($this, 'get_cart_item_open_price_from_session'), PHP_INT_MAX, 3); add_filter('wcj_save_meta_box_value', array($this, 'save_meta_box_value'), PHP_INT_MAX, 3); add_action('admin_notices', array($this, 'admin_notices')); } }
/** * Constructor. * * @version 2.5.8 */ function __construct() { $this->id = 'shipping'; $this->short_desc = __('Shipping', 'woocommerce-jetpack'); $this->desc = __('Add multiple custom shipping methods to WooCommerce.', 'woocommerce-jetpack') . ' ' . __('Add descriptions and icons to shipping methods on frontend.', 'woocommerce-jetpack') . ' ' . __('Hide WooCommerce shipping when free is available.', 'woocommerce-jetpack'); $this->link = 'http://booster.io/features/woocommerce-shipping/'; parent::__construct(); add_action('init', array($this, 'add_settings_hook')); if ($this->is_enabled()) { // Custom Shipping include_once 'shipping/class-wc-shipping-wcj-custom.php'; if ('yes' === get_option('wcj_shipping_custom_shipping_w_zones_enabled', 'no')) { include_once 'shipping/class-wc-shipping-wcj-custom-with-shipping-zones.php'; } // Hide if free is available if ('yes' === get_option('wcj_shipping_hide_if_free_available_all', 'no')) { add_filter('woocommerce_package_rates', array($this, 'hide_shipping_when_free_is_available'), 10, 2); } add_filter('woocommerce_shipping_settings', array($this, 'add_hide_shipping_if_free_available_fields'), 100); // Shipping Descriptions if ('yes' === get_option('wcj_shipping_description_enabled', 'no')) { add_filter('woocommerce_cart_shipping_method_full_label', array($this, 'shipping_description'), PHP_INT_MAX, 2); } // Shipping Icons if ('yes' === get_option('wcj_shipping_icons_enabled', 'no')) { add_filter('woocommerce_cart_shipping_method_full_label', array($this, 'shipping_icon'), PHP_INT_MAX, 2); } } }
/** * Constructor. * * @version 2.3.9 */ public function __construct() { $this->id = 'price_by_country'; $this->short_desc = __('Prices and Currencies by Country', 'woocommerce-jetpack'); $this->desc = __('Change WooCommerce product price and currency automatically by customer\'s country.', 'woocommerce-jetpack'); parent::__construct(); global $wcj_notice; $wcj_notice = ''; if ($this->is_enabled()) { if (!is_admin()) { // || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { // Frontend include_once 'price-by-country/class-wcj-price-by-country-core.php'; } if (is_admin()) { // Backend include_once 'price-by-country/class-wcj-price-by-country-reports.php'; if ('yes' === get_option('wcj_price_by_country_local_enabled')) { include_once 'price-by-country/class-wcj-price-by-country-local.php'; } } } if (is_admin()) { include_once 'price-by-country/class-wcj-price-by-country-group-generator.php'; } }
/** * Constructor. * * @version 2.5.7 */ public function __construct() { $this->id = 'pdf_invoicing'; $this->short_desc = __('PDF Invoicing', 'woocommerce-jetpack'); $this->section_title = __('General', 'woocommerce-jetpack'); $this->desc = __('WooCommerce Invoices, Proforma Invoices, Credit Notes and Packing Slips.', 'woocommerce-jetpack'); $this->link = 'http://booster.io/features/woocommerce-pdf-invoicing-and-packing-slips/'; parent::__construct(); $this->add_tools(array('renumerate_invoices' => array('title' => __('Invoices Renumerate', 'woocommerce-jetpack'), 'desc' => __('Tool renumerates all invoices, proforma invoices, credit notes and packing slips.', 'woocommerce-jetpack')), 'invoices_report' => array('title' => __('Invoices Report', 'woocommerce-jetpack'), 'desc' => __('Invoices Monthly Reports.', 'woocommerce-jetpack')))); if ($this->is_enabled()) { add_action('init', array($this, 'catch_args')); add_action('init', array($this, 'generate_pdf_on_init')); // Bulk actions add_action('admin_footer-edit.php', array($this, 'bulk_actions_pdfs_admin_footer')); add_action('load-edit.php', array($this, 'bulk_actions_pdfs')); add_action('admin_notices', array($this, 'bulk_actions_pdfs_notices')); $this->the_pdf_invoicing_report_tool = (include_once 'pdf-invoices/class-wcj-pdf-invoicing-report-tool.php'); $invoice_types = wcj_get_enabled_invoice_types(); foreach ($invoice_types as $invoice_type) { $the_hook = get_option('wcj_invoicing_' . $invoice_type['id'] . '_create_on', 'woocommerce_new_order'); if ('disabled' != $the_hook && 'manual' != $the_hook && '' != $the_hook) { add_action($the_hook, array($this, 'create_' . $invoice_type['id'])); if ('woocommerce_new_order' === $the_hook) { add_action('woocommerce_api_create_order', array($this, 'create_' . $invoice_type['id'])); add_action('woocommerce_cli_create_order', array($this, 'create_' . $invoice_type['id'])); add_action('kco_before_confirm_order', array($this, 'create_' . $invoice_type['id'])); add_action('woocommerce_checkout_order_processed', array($this, 'create_' . $invoice_type['id'])); } } } } }
/** * Constructor. * * @version 2.5.0 */ public function __construct() { $this->id = 'price_labels'; $this->short_desc = __('Custom Price Labels', 'woocommerce-jetpack'); $this->desc = __('Create any custom price label for any WooCommerce product.', 'woocommerce-jetpack'); $this->link = 'http://booster.io/features/woocommerce-custom-price-labels/'; parent::__construct(); $this->add_tools(array('migrate_from_custom_price_labels' => array('title' => __('Migrate from Custom Price Labels (Pro)', 'woocommerce-jetpack'), 'desc' => __('Tool lets you copy all the data (that is labels) from Custom Price labels (Pro) plugin to Booster.', 'woocommerce-jetpack'), 'deprecated' => true)), array('tools_dashboard_hook_priority' => PHP_INT_MAX)); // Custom Price Labels - fields array $this->custom_tab_group_name = 'wcj_price_labels'; // for compatibility with Custom Price Label Pro plugin should use 'simple_is_custom_pricing_label' $this->custom_tab_sections = array('_instead', '_before', '_between', '_after'); $this->custom_tab_sections_titles = array('_instead' => __('Instead of the price', 'woocommerce-jetpack'), '_before' => __('Before the price', 'woocommerce-jetpack'), '_between' => __('Between regular and sale prices', 'woocommerce-jetpack'), '_after' => __('After the price', 'woocommerce-jetpack')); $this->custom_tab_section_variations = array('_text', '_enabled', '_home', '_products', '_single', '_page', '_cart', '_variable', '_variation'); $this->custom_tab_section_variations_titles = array('_text' => '', '_enabled' => __('Enable', 'woocommerce-jetpack'), '_home' => __('Hide on home page', 'woocommerce-jetpack'), '_products' => __('Hide on products page', 'woocommerce-jetpack'), '_single' => __('Hide on single', 'woocommerce-jetpack'), '_page' => __('Hide on all pages', 'woocommerce-jetpack'), '_cart' => __('Hide on cart page only', 'woocommerce-jetpack'), '_variable' => __('Hide for main price', 'woocommerce-jetpack'), '_variation' => __('Hide for all variations', 'woocommerce-jetpack')); add_action('init', array($this, 'add_settings_hook')); if ($this->is_enabled()) { if ('yes' === get_option('wcj_local_price_labels_enabled', 'yes')) { // Meta box (admin) add_action('add_meta_boxes', array($this, 'add_price_label_meta_box')); add_action('save_post_product', array($this, 'save_custom_price_labels'), 999, 2); } // Prices Hooks $this->prices_filters = array('woocommerce_cart_item_price', 'woocommerce_composite_sale_price_html', 'woocommerce_composite_price_html', 'woocommerce_composite_empty_price_html', 'woocommerce_composite_free_sale_price_html', 'woocommerce_composite_free_price_html', 'woocommerce_get_price_html', 'woocommerce_empty_price_html', 'woocommerce_free_price_html', 'woocommerce_free_sale_price_html', 'woocommerce_price_html', 'woocommerce_sale_price_html', 'woocommerce_grouped_price_html', 'woocommerce_variable_empty_price_html', 'woocommerce_variable_free_price_html', 'woocommerce_variable_free_sale_price_html', 'woocommerce_variable_price_html', 'woocommerce_variable_sale_price_html', 'woocommerce_variation_empty_price_html', 'woocommerce_variation_free_price_html', 'woocommerce_variation_price_html', 'woocommerce_variation_sale_price_html', 'woocommerce_subscriptions_product_price_string', 'woocommerce_variable_subscription_price_html'); foreach ($this->prices_filters as $the_filter) { add_filter($the_filter, array($this, 'custom_price'), 100, 2); } } }
/** * Constructor. * * @version 2.5.5 * @todo products per page - position priority for every hook; post or get. */ public function __construct() { $this->id = 'product_listings'; $this->short_desc = __('Product Listings', 'woocommerce-jetpack'); $this->desc = __('Change WooCommerce display options for shop and category pages: show/hide categories count, exclude categories, show/hide empty categories. Add "products per page" selector.', 'woocommerce-jetpack'); $this->link = 'http://booster.io/features/woocommerce-product-listings/'; parent::__construct(); add_action('init', array($this, 'add_settings_hook')); if ($this->is_enabled()) { // Exclude and Hide Empty add_filter('woocommerce_product_subcategories_args', array($this, 'filter_subcategories'), 100); add_filter('woocommerce_product_subcategories_hide_empty', array($this, 'filter_subcategories_show_empty'), 100); // Hide Count if ('yes' === get_option('wcj_product_listings_hide_cats_count_on_shop') || 'yes' === get_option('wcj_product_listings_hide_cats_count_on_archive')) { add_filter('woocommerce_subcategory_count_html', array($this, 'remove_subcategory_count'), 100); } // Products per Page if ('yes' === get_option('wcj_products_per_page_enabled', 'no')) { add_filter('loop_shop_per_page', array($this, 'set_products_per_page_number'), PHP_INT_MAX); $position_hooks = get_option('wcj_products_per_page_position', array('woocommerce_before_shop_loop')); foreach ($position_hooks as $position_hook) { add_action($position_hook, array($this, 'add_products_per_page_form'), get_option('wcj_products_per_page_position_priority', 40)); } } // Settings to "WooCommerce > Settings > Products > Product Listings" // add_filter( 'woocommerce_product_settings', array( $this, 'add_fields_to_woocommerce_settings' ), 100 ); // Tax Incl./Excl. by product/category add_filter('option_woocommerce_tax_display_shop', array($this, 'tax_display'), PHP_INT_MAX); } }
/** * Constructor. * * @version 2.4.0 */ function __construct() { $this->id = 'currency'; $this->short_desc = __('Currencies', 'woocommerce-jetpack'); $this->desc = __('Add all world currencies to your WooCommerce store; change currency symbol.', 'woocommerce-jetpack'); parent::__construct(); $currencies = (include 'currencies/wcj-currencies.php'); foreach ($currencies as $data) { $this->currency_symbols[$data['code']] = $data['symbol']; $this->currency_names[$data['code']] = $data['name']; } $custom_currency_total_number = apply_filters('wcj_get_option_filter', 1, get_option('wcj_currency_custom_currency_total_number', 1)); for ($i = 1; $i <= $custom_currency_total_number; $i++) { $custom_currency_code = get_option('wcj_currency_custom_currency_code_' . $i); $custom_currency_name = get_option('wcj_currency_custom_currency_name_' . $i); $custom_currency_symbol = get_option('wcj_currency_custom_currency_symbol_' . $i); if ('' != $custom_currency_code && '' != $custom_currency_name && '' != $custom_currency_symbol) { $this->currency_names[$custom_currency_code] = $custom_currency_name; $this->currency_symbols[$custom_currency_code] = $custom_currency_symbol; } } if ($this->is_enabled()) { add_filter('woocommerce_currencies', array($this, 'add_all_currencies'), 100); add_filter('woocommerce_currency_symbol', array($this, 'add_currency_symbol'), 100, 2); add_filter('woocommerce_general_settings', array($this, 'add_edit_currency_symbol_field'), 100); } }
/** * Constructor. * * @version 2.5.2 * @since 2.5.2 */ function __construct() { $this->id = 'currency_per_product'; $this->short_desc = __('Currency per Product', 'woocommerce-jetpack'); $this->desc = __('Display prices for WooCommerce products in different currencies.', 'woocommerce-jetpack'); $this->link = 'http://booster.io/features/woocommerce-currency-per-product/'; parent::__construct(); add_action('init', array($this, 'add_settings_hook')); if ($this->is_enabled()) { add_action('add_meta_boxes', array($this, 'add_meta_box')); add_action('save_post_product', array($this, 'save_meta_box'), PHP_INT_MAX, 2); //if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { // Currency code and symbol add_filter('woocommerce_currency_symbol', array($this, 'change_currency_symbol'), PHP_INT_MAX, 2); add_filter('woocommerce_currency', array($this, 'change_currency_code'), PHP_INT_MAX); // Add to cart add_filter('woocommerce_add_cart_item_data', array($this, 'add_cart_item_data'), PHP_INT_MAX, 3); add_filter('woocommerce_add_cart_item', array($this, 'add_cart_item'), PHP_INT_MAX, 2); add_filter('woocommerce_get_cart_item_from_session', array($this, 'get_cart_item_from_session'), PHP_INT_MAX, 3); // Price add_filter('woocommerce_get_price', array($this, 'change_price'), PHP_INT_MAX, 2); // Grouped add_filter('woocommerce_grouped_price_html', array($this, 'grouped_price_html'), PHP_INT_MAX, 2); //} } }
/** * Constructor. * * @version 2.5.5 * @since 2.4.5 */ function __construct() { $this->id = 'checkout_files_upload'; $this->short_desc = __('Checkout Files Upload', 'woocommerce-jetpack'); $this->desc = __('Let customers upload files on (or after) WooCommerce checkout.', 'woocommerce-jetpack'); $this->link = 'http://booster.io/features/woocommerce-checkout-files-upload/'; parent::__construct(); if ($this->is_enabled()) { add_action('add_meta_boxes', array($this, 'add_file_admin_order_meta_box')); add_action('init', array($this, 'process_checkout_files_upload')); $total_number = apply_filters('booster_get_option', 1, get_option('wcj_checkout_files_upload_total_number', 1)); for ($i = 1; $i <= $total_number; $i++) { if ('disable' != ($the_hook = get_option('wcj_checkout_files_upload_hook_' . $i, 'woocommerce_before_checkout_form'))) { add_action($the_hook, array($this, 'add_files_upload_form_to_checkout_frontend'), get_option('wcj_checkout_files_upload_hook_priority_' . $i, 10)); } if ('yes' === get_option('wcj_checkout_files_upload_add_to_thankyou_' . $i, 'no')) { add_action('woocommerce_thankyou', array($this, 'add_files_upload_form_to_thankyou_and_myaccount_page'), PHP_INT_MAX, 1); } if ('yes' === get_option('wcj_checkout_files_upload_add_to_myaccount_' . $i, 'no')) { add_action('woocommerce_view_order', array($this, 'add_files_upload_form_to_thankyou_and_myaccount_page'), PHP_INT_MAX, 1); } } add_action('woocommerce_checkout_order_processed', array($this, 'add_files_to_order'), PHP_INT_MAX, 2); add_action('woocommerce_after_checkout_validation', array($this, 'validate_on_checkout')); add_action('woocommerce_order_details_after_order_table', array($this, 'add_files_to_order_display'), PHP_INT_MAX); add_action('woocommerce_email_after_order_table', array($this, 'add_files_to_order_display'), PHP_INT_MAX); add_filter('woocommerce_email_attachments', array($this, 'add_files_to_email_attachments'), PHP_INT_MAX, 3); } }
/** * Constructor. * * @version 2.2.6 */ function __construct() { $this->id = 'product_images'; $this->short_desc = __('Product Images', 'woocommerce-jetpack'); $this->desc = __('Customize WooCommerce products images, thumbnails and sale flashes.', 'woocommerce-jetpack'); parent::__construct(); if ($this->is_enabled()) { // Product Image & Thumbnails if ('yes' === get_option('wcj_product_images_and_thumbnails_enabled', 'no')) { // Single if ('yes' === get_option('wcj_product_images_and_thumbnails_hide_on_single', 'no')) { add_action('init', array($this, 'product_images_and_thumbnails_hide_on_single'), PHP_INT_MAX); } else { add_filter('woocommerce_single_product_image_html', array($this, 'customize_single_product_image_html'), PHP_INT_MAX, 2); add_filter('woocommerce_single_product_image_thumbnail_html', array($this, 'customize_single_product_image_thumbnail_html')); } // Archives add_action('woocommerce_before_shop_loop_item', array($this, 'product_images_hide_on_archive')); add_action('woocommerce_before_shop_loop_item_title', array($this, 'customize_archive_product_image_html'), 10); // Single Product Thumbnails Columns Number add_filter('woocommerce_product_thumbnails_columns', array($this, 'change_product_thumbnails_columns_number')); } add_action('add_meta_boxes', array($this, 'add_meta_box')); add_action('save_post_product', array($this, 'save_meta_box'), PHP_INT_MAX, 2); // Sale flash if ('yes' === get_option('wcj_product_images_sale_flash_enabled', 'no')) { add_filter('woocommerce_sale_flash', array($this, 'customize_sale_flash'), PHP_INT_MAX, 3); } } }
/** * Constructor. * * @version 2.3.10 */ function __construct() { $this->id = 'eu_vat_number'; $this->short_desc = __('EU VAT Number', 'woocommerce-jetpack'); $this->desc = __('Collect and validate EU VAT numbers on WooCommerce checkout. Automatically disable VAT for valid numbers.', 'woocommerce-jetpack'); parent::__construct(); $this->add_tools(array('eu_countries_vat_rates' => array('title' => __('EU Countries VAT Rates', 'woocommerce-jetpack'), 'desc' => __('Add all EU countries VAT standard rates to WooCommerce.', 'woocommerce-jetpack')))); if ($this->is_enabled()) { /* if ( ! session_id() ) { session_start(); } */ // add_action( 'init', 'session_start' ); add_action('init', array($this, 'start_session')); add_filter('woocommerce_checkout_fields', array($this, 'add_eu_vat_number_checkout_field_to_frontend'), PHP_INT_MAX); add_filter('woocommerce_admin_billing_fields', array($this, 'add_billing_eu_vat_number_field_to_admin_order_display'), PHP_INT_MAX); add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts')); // add_filter( 'woocommerce_form_field_text', array( $this, 'add_eu_vat_verify_button' ), PHP_INT_MAX, 4 ); add_action('init', array($this, 'wcj_validate_eu_vat_number')); add_filter('woocommerce_matched_rates', array($this, 'maybe_exclude_vat'), PHP_INT_MAX, 2); add_action('woocommerce_after_checkout_validation', array($this, 'checkout_validate_vat'), PHP_INT_MAX); add_action('woocommerce_checkout_update_order_meta', array($this, 'update_eu_vat_number_checkout_field_order_meta')); add_filter('woocommerce_customer_meta_fields', array($this, 'add_eu_vat_number_customer_meta_field')); add_filter('default_checkout_billing_eu_vat_number', array($this, 'add_default_checkout_billing_eu_vat_number'), PHP_INT_MAX, 2); $this->eu_countries_vat_rates_tool = (include_once 'tools/class-wcj-eu-countries-vat-rates-tool.php'); } }
/** * Constructor. * * @version 2.5.8 */ public function __construct() { $this->id = 'general'; $this->short_desc = __('General', 'woocommerce-jetpack'); $this->desc = __('Separate custom CSS for front and back end. Shortcodes in WordPress text widgets. Custom roles tool.', 'woocommerce-jetpack'); $this->link = 'http://booster.io/features/woocommerce-booster-general-tools/'; parent::__construct(); $this->add_tools(array('products_atts' => array('title' => __('Products Atts', 'woocommerce-jetpack'), 'desc' => __('All Products and All Attributes.', 'woocommerce-jetpack')), 'custom_roles' => array('title' => __('Add/Manage Custom Roles', 'woocommerce-jetpack'), 'tab_title' => __('Custom Roles', 'woocommerce-jetpack'), 'desc' => __('Manage Custom Roles.', 'woocommerce-jetpack')))); if ($this->is_enabled()) { if ('yes' === get_option('wcj_product_revisions_enabled', 'no')) { add_filter('woocommerce_register_post_type_product', array($this, 'enable_product_revisions')); } if ('yes' === get_option('wcj_general_shortcodes_in_text_widgets_enabled')) { add_filter('widget_text', 'do_shortcode'); } if ('' != get_option('wcj_general_custom_css')) { add_action('wp_head', array($this, 'hook_custom_css')); } if ('' != get_option('wcj_general_custom_admin_css')) { add_action('admin_head', array($this, 'hook_custom_admin_css')); } if ('yes' === get_option('wcj_paypal_email_per_product_enabled', 'no')) { add_action('add_meta_boxes', array($this, 'add_meta_box')); add_action('save_post_product', array($this, 'save_meta_box'), PHP_INT_MAX, 2); add_filter('woocommerce_payment_gateways', array($this, 'maybe_change_paypal_email')); } if ('yes' === get_option('wcj_session_expiration_section_enabled', 'no')) { add_filter('wc_session_expiring', array($this, 'change_session_expiring'), PHP_INT_MAX); add_filter('wc_session_expiration', array($this, 'change_session_expiration'), PHP_INT_MAX); } } }
/** * Constructor. * * @version 2.5.2 * @since 2.4.8 */ function __construct() { $this->id = 'multicurrency_base_price'; $this->short_desc = __('Multicurrency Product Base Price', 'woocommerce-jetpack'); $this->desc = __('Enter prices for WooCommerce products in different currencies.', 'woocommerce-jetpack'); $this->link = 'http://booster.io/features/woocommerce-multicurrency-product-base-price/'; parent::__construct(); add_action('init', array($this, 'add_settings_hook')); if ($this->is_enabled()) { add_action('add_meta_boxes', array($this, 'add_meta_box')); add_action('save_post_product', array($this, 'save_meta_box'), PHP_INT_MAX, 2); add_filter('woocommerce_currency_symbol', array($this, 'change_currency_symbol_on_product_edit'), PHP_INT_MAX, 2); if (!is_admin() || defined('DOING_AJAX') && DOING_AJAX) { // Prices add_filter('woocommerce_get_price', array($this, 'change_price_by_currency'), PHP_INT_MAX - 10, 2); add_filter('woocommerce_get_sale_price', array($this, 'change_price_by_currency'), PHP_INT_MAX - 10, 2); add_filter('woocommerce_get_regular_price', array($this, 'change_price_by_currency'), PHP_INT_MAX - 10, 2); // Variations add_filter('woocommerce_variation_prices_price', array($this, 'change_price_by_currency'), PHP_INT_MAX - 10, 2); add_filter('woocommerce_variation_prices_regular_price', array($this, 'change_price_by_currency'), PHP_INT_MAX - 10, 2); add_filter('woocommerce_variation_prices_sale_price', array($this, 'change_price_by_currency'), PHP_INT_MAX - 10, 2); add_filter('woocommerce_get_variation_prices_hash', array($this, 'get_variation_prices_hash'), PHP_INT_MAX - 10, 3); // Grouped products add_filter('woocommerce_get_price_including_tax', array($this, 'change_price_by_currency_grouped'), PHP_INT_MAX - 10, 3); add_filter('woocommerce_get_price_excluding_tax', array($this, 'change_price_by_currency_grouped'), PHP_INT_MAX - 10, 3); } /* if ( is_admin() ) { include_once( 'reports/class-wcj-currency-reports.php' ); } */ } }
/** * Constructor. * * @version 2.5.8 */ public function __construct() { $this->id = 'admin_tools'; $this->short_desc = __('Admin Tools', 'woocommerce-jetpack'); $this->desc = __('Booster for WooCommerce debug and log tools.', 'woocommerce-jetpack'); $this->link = 'http://booster.io/features/woocommerce-booster-admin-tools/'; parent::__construct(); $this->add_tools(array('admin_tools' => array('title' => __('Admin Tools', 'woocommerce-jetpack'), 'desc' => __('Log.', 'woocommerce-jetpack'), 'tab_title' => __('Log', 'woocommerce-jetpack')))); $this->current_php_memory_limit = ''; if ($this->is_enabled()) { // PHP Memory Limit if (0 != ($php_memory_limit = get_option('wcj_admin_tools_php_memory_limit', 0))) { ini_set('memory_limit', $php_memory_limit . 'M'); } $this->current_php_memory_limit = sprintf(' ' . __('Current PHP memory limit: %s.', 'woocommerce-jetpack'), ini_get('memory_limit')); // Order Meta if ('yes' === get_option('wcj_admin_tools_show_order_meta_enabled', 'no')) { add_action('add_meta_boxes', array($this, 'add_order_meta_meta_box')); } // Product Meta if ('yes' === get_option('wcj_admin_tools_show_product_meta_enabled', 'no')) { add_action('add_meta_boxes', array($this, 'add_product_meta_meta_box')); } } }
/** * Constructor. * * @version 2.3.7 */ public function __construct() { $this->id = 'price_labels'; $this->short_desc = __('Custom Price Labels', 'woocommerce-jetpack'); $this->desc = __('Create any custom price label for any WooCommerce product.', 'woocommerce-jetpack'); parent::__construct(); // Custom Price Labels - fields array $this->custom_tab_group_name = 'wcj_price_labels'; // for compatibility with Custom Price Label Pro plugin should use 'simple_is_custom_pricing_label' $this->custom_tab_sections = array('_instead', '_before', '_between', '_after'); $this->custom_tab_sections_titles = array('_instead' => __('Instead of the price', 'woocommerce-jetpack'), '_before' => __('Before the price', 'woocommerce-jetpack'), '_between' => __('Between regular and sale prices', 'woocommerce-jetpack'), '_after' => __('After the price', 'woocommerce-jetpack')); $this->custom_tab_section_variations = array('_text', '_enabled', '_home', '_products', '_single', '_page', '_cart', '_variable', '_variation'); $this->custom_tab_section_variations_titles = array('_text' => '', '_enabled' => __('Enable', 'woocommerce-jetpack'), '_home' => __('Hide on home page', 'woocommerce-jetpack'), '_products' => __('Hide on products page', 'woocommerce-jetpack'), '_single' => __('Hide on single', 'woocommerce-jetpack'), '_page' => __('Hide on all pages', 'woocommerce-jetpack'), '_cart' => __('Hide on cart page only', 'woocommerce-jetpack'), '_variable' => __('Hide for main price', 'woocommerce-jetpack'), '_variation' => __('Hide for all variations', 'woocommerce-jetpack')); add_action('init', array($this, 'add_settings_hook')); if ($this->is_enabled()) { if (is_admin()) { if ('yes' === get_option('wcj_migrate_from_custom_price_labels_enabled')) { // "Migrate from Custom Price Labels (Pro)" tool add_filter('wcj_tools_tabs', array($this, 'add_migrate_from_custom_price_labels_tool_tab'), 100); add_action('wcj_tools_migrate_from_custom_price_labels', array($this, 'create_migrate_from_custom_price_labels_tool_tab'), 100); } } if ('yes' === get_option('wcj_local_price_labels_enabled')) { // Meta box (admin) add_action('add_meta_boxes', array($this, 'add_price_label_meta_box')); add_action('save_post_product', array($this, 'save_custom_price_labels'), 999, 2); } // Prices Hooks $this->prices_filters = array('woocommerce_cart_item_price', 'woocommerce_composite_sale_price_html', 'woocommerce_composite_price_html', 'woocommerce_composite_empty_price_html', 'woocommerce_composite_free_sale_price_html', 'woocommerce_composite_free_price_html', 'woocommerce_get_price_html', 'woocommerce_empty_price_html', 'woocommerce_free_price_html', 'woocommerce_free_sale_price_html', 'woocommerce_price_html', 'woocommerce_sale_price_html', 'woocommerce_grouped_price_html', 'woocommerce_variable_empty_price_html', 'woocommerce_variable_free_price_html', 'woocommerce_variable_free_sale_price_html', 'woocommerce_variable_price_html', 'woocommerce_variable_sale_price_html', 'woocommerce_variation_empty_price_html', 'woocommerce_variation_free_price_html', 'woocommerce_variation_price_html', 'woocommerce_variation_sale_price_html'); foreach ($this->prices_filters as $the_filter) { add_filter($the_filter, array($this, 'custom_price'), 100, 2); } } add_action('wcj_tools_dashboard', array($this, 'add_migrate_tool_info_to_tools_dashboard'), 1000); }
/** * Constructor. * * @version 2.3.0 */ public function __construct() { $this->id = 'pdf_invoicing'; $this->short_desc = __('PDF Invoicing', 'woocommerce-jetpack'); $this->section_title = __('General', 'woocommerce-jetpack'); $this->desc = __('WooCommerce Invoices, Proforma Invoices, Credit Notes and Packing Slips.', 'woocommerce-jetpack'); parent::__construct(); if ($this->is_enabled()) { include_once 'pdf-invoices/class-wcj-pdf-invoicing-renumerate-tool.php'; include_once 'pdf-invoices/class-wcj-pdf-invoicing-report-tool.php'; add_action('init', array($this, 'catch_args')); add_action('init', array($this, 'generate_pdf_on_init')); // define ( 'K_PATH_IMAGES', $_SERVER['DOCUMENT_ROOT'] ); $invoice_types = wcj_get_enabled_invoice_types(); foreach ($invoice_types as $invoice_type) { $the_hook = get_option('wcj_invoicing_' . $invoice_type['id'] . '_create_on', 'woocommerce_new_order'); if ('disabled' != $the_hook && 'manual' != $the_hook && '' != $the_hook) { add_action($the_hook, array($this, 'create_' . $invoice_type['id'])); } } /* $this->meta_box_screen = 'shop_order'; $this->meta_box_context = 'side'; $this->meta_box_priority = 'default'; add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) ); */ } }
/** * Constructor. * * @version 2.3.7 */ public function __construct() { $this->id = 'orders'; $this->short_desc = __('Orders', 'woocommerce-jetpack'); $this->desc = __('Minimum WooCommerce order amount; orders auto-complete; custom admin order list columns.', 'woocommerce-jetpack'); parent::__construct(); if ($this->is_enabled()) { if (get_option('wcj_order_minimum_amount') > 0) { add_action('woocommerce_checkout_process', array($this, 'order_minimum_amount')); add_action('woocommerce_before_cart', array($this, 'order_minimum_amount')); if ('yes' === get_option('wcj_order_minimum_amount_stop_from_seeing_checkout')) { add_action('wp', array($this, 'stop_from_seeing_checkout'), 100); // add_action( 'template_redirect', array( $this, 'stop_from_seeing_checkout' ), 100 ); } } if ('yes' === get_option('wcj_order_auto_complete_enabled')) { add_action('woocommerce_thankyou', array($this, 'auto_complete_order')); } if ('yes' === get_option('wcj_orders_list_custom_columns_country', 'no')) { // Country column add_filter('manage_edit-shop_order_columns', array($this, 'add_order_column'), PHP_INT_MAX); add_action('manage_shop_order_posts_custom_column', array($this, 'render_order_columns'), PHP_INT_MAX); // Country filtering add_action('restrict_manage_posts', array($this, 'restrict_manage_posts')); add_filter('parse_query', array($this, 'orders_by_country_admin_filter_query')); } } }
/** * Constructor. * * @version 2.5.0 * @since 2.5.0 */ function __construct() { $this->id = 'product_price_by_formula'; $this->short_desc = __('Product Price by Formula', 'woocommerce-jetpack'); $this->desc = __('Set formula for automatic WooCommerce product price calculation.', 'woocommerce-jetpack'); $this->link = 'http://booster.io/features/woocommerce-product-price-formula/'; parent::__construct(); if ($this->is_enabled()) { require_once wcj_plugin_path() . '/includes/lib/PHPMathParser/Math.php'; add_action('add_meta_boxes', array($this, 'add_meta_box')); add_action('save_post_product', array($this, 'save_meta_box'), PHP_INT_MAX, 2); if (!is_admin() || defined('DOING_AJAX') && DOING_AJAX) { // Prices add_filter('woocommerce_get_price', array($this, 'change_price_by_formula'), PHP_INT_MAX - 100, 2); add_filter('woocommerce_get_sale_price', array($this, 'change_price_by_formula'), PHP_INT_MAX - 100, 2); add_filter('woocommerce_get_regular_price', array($this, 'change_price_by_formula'), PHP_INT_MAX - 100, 2); // Variations add_filter('woocommerce_variation_prices_price', array($this, 'change_price_by_formula'), PHP_INT_MAX - 100, 2); add_filter('woocommerce_variation_prices_regular_price', array($this, 'change_price_by_formula'), PHP_INT_MAX - 100, 2); add_filter('woocommerce_variation_prices_sale_price', array($this, 'change_price_by_formula'), PHP_INT_MAX - 100, 2); add_filter('woocommerce_get_variation_prices_hash', array($this, 'get_variation_prices_hash'), PHP_INT_MAX - 100, 3); // Grouped products add_filter('woocommerce_get_price_including_tax', array($this, 'change_price_by_formula_grouped'), PHP_INT_MAX - 100, 3); add_filter('woocommerce_get_price_excluding_tax', array($this, 'change_price_by_formula_grouped'), PHP_INT_MAX - 100, 3); } add_filter('wcj_save_meta_box_value', array($this, 'save_meta_box_value'), PHP_INT_MAX, 3); add_action('admin_notices', array($this, 'admin_notices')); } }
/** * Constructor. * * @version 2.3.0 */ public function __construct() { $this->id = 'pdf_invoicing_header'; $this->parent_id = 'pdf_invoicing'; $this->short_desc = __('Header', 'woocommerce-jetpack'); $this->desc = ''; parent::__construct('submodule'); }
/** * Constructor. * * @version 2.3.7 */ function __construct() { $this->id = 'pdf_invoicing_templates'; $this->parent_id = 'pdf_invoicing'; $this->short_desc = __('Templates', 'woocommerce-jetpack'); $this->desc = ''; parent::__construct('submodule'); }
/** * Constructor. * * @version 2.3.10 */ public function __construct() { $this->id = 'admin_tools'; $this->short_desc = __('Admin Tools', 'woocommerce-jetpack'); $this->desc = __('Booster for WooCommerce debug and log tools.', 'woocommerce-jetpack'); parent::__construct(); $this->add_tools(array('admin_tools' => array('title' => __('Admin Tools', 'woocommerce-jetpack'), 'desc' => __('Log.', 'woocommerce-jetpack'), 'tab_title' => __('Log', 'woocommerce-jetpack')))); }
/** * Constructor. * * @version 2.3.10 */ public function __construct() { $this->id = 'bulk_price_converter'; $this->short_desc = __('Bulk Price Converter', 'woocommerce-jetpack'); $this->desc = __('Multiply all WooCommerce products prices by set value.', 'woocommerce-jetpack'); parent::__construct(); $this->add_tools(array('bulk_price_converter' => array('title' => __('Bulk Price Converter', 'woocommerce-jetpack'), 'desc' => __('Bulk Price Converter Tool.', 'woocommerce-jetpack')))); }
/** * Constructor. * * @version 2.3.10 */ public function __construct() { $this->id = 'old_slugs'; $this->short_desc = __('Old Slugs', 'woocommerce-jetpack'); $this->desc = __('Remove old WooCommerce products slugs.', 'woocommerce-jetpack'); parent::__construct(); $this->add_tools(array('old_slugs' => array('title' => __('Remove Old Slugs', 'woocommerce-jetpack'), 'desc' => __('Tool removes old slugs/permalinks from database.', 'woocommerce-jetpack')))); }
/** * Constructor. * * @version 2.4.0 */ function __construct() { $this->id = 'pdf_invoicing_page'; $this->parent_id = 'pdf_invoicing'; $this->short_desc = __('Page Settings', 'woocommerce-jetpack'); $this->desc = ''; parent::__construct('submodule'); }
/** * Constructor. * * @version 2.3.0 */ public function __construct() { $this->id = 'pdf_invoicing_numbering'; $this->parent_id = 'pdf_invoicing'; $this->short_desc = __('Numbering', 'woocommerce-jetpack'); $this->desc = ''; parent::__construct('submodule'); $this->add_tools(array('renumerate_invoices' => __('Renumerate Invoices', 'woocommerce-jetpack'))); }
/** * Constructor. */ function __construct() { $this->id = 'wpml'; $this->short_desc = __('WPML', 'woocommerce-jetpack'); $this->desc = __('Booster for WooCommerce basic WPML support.', 'woocommerce-jetpack'); parent::__construct(); if ($this->is_enabled()) { add_action('woojetpack_after_settings_save', array($this, 'create_wpml_xml_file')); } }
/** * Constructor. */ function __construct() { $this->id = 'address_formats'; $this->short_desc = __('Address Formats', 'woocommerce-jetpack'); $this->desc = __('Set address format in WooCommerce orders on per country basis. Force base country display.', 'woocommerce-jetpack'); parent::__construct(); if ($this->is_enabled()) { add_filter('woocommerce_localisation_address_formats', array($this, 'customize_address_formats'), PHP_INT_MAX); add_filter('woocommerce_formatted_address_force_country_display', array($this, 'customize_force_country_display'), PHP_INT_MAX); } }
/** * Constructor. * * @version 2.4.8 */ public function __construct() { $this->id = 'more_button_labels'; $this->short_desc = __('More Button Labels', 'woocommerce-jetpack'); $this->desc = __('Set WooCommerce "Place order" button label.', 'woocommerce-jetpack'); $this->link = 'http://booster.io/features/woocommerce-more-button-labels/'; parent::__construct(); if ($this->is_enabled()) { add_filter('woocommerce_order_button_text', array($this, 'set_order_button_text')); } }