PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
woocommerce-pdf-vouchers
/
includes
/
compatibility
<?php // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; /** * WC Marketplace Class. To enhance compatibility with WC Marketplace plugin. * * @package WooCommerce - PDF Vouchers * @since 3.8.2 */ class WOO_Vou_WC_Marketplace { public function __construct() { } /** * Modify WC Marketplace Role Array * * Handle to modify settings array * * @package WooCommerce - PDF Vouchers * @since 3.8.2 */ public function woo_vou_wcmp_settings( $settings ) { array_push($settings,array( 'name' => esc_html__( 'WC Marketplace Settings', 'woovoucher' ), 'type' => 'title', 'desc' => '', 'id' => 'vou_wcmp_settings' ), array( 'id' => 'vou_enable_auto_integrate_wcmp_vendor', 'name' => esc_html__( 'Auto Integrate vendor with PDF Voucher', 'woovoucher' ), 'desc' => esc_html__( 'Auto Integrate vendor with PDF Voucher', 'woovoucher' ), 'type' => 'checkbox', 'desc_tip' => '<p class="description">' . esc_html__( 'Check this box if you want to integrate WCMp Vendors with PDF Vouchers.', 'woovoucher' ) . '</p>', 'default' => 'yes' ), array( 'id' => 'vou_enable_wcmp_vendor_acess_pdf_vou_meta', 'name' => esc_html__( 'Enable Access to PDF Vouchers tab', 'woovoucher' ), 'desc' => esc_html__( 'Enable Access to PDF Vouchers tab', 'woovoucher' ), 'type' => 'checkbox', 'desc_tip' => '<p class="description">' . esc_html__( 'Check this box if you want to allow vendors to access PDF Vouchers on add/edit product page on frontend and backend.', 'woovoucher' ) . '</p>', 'default' => 'yes' ), array( 'type' => 'sectionend', 'id' => 'vou_wcmp_settings' )); return $settings; } /** * Handles to hide PDF Vouchers tab * * Function handles to hide PDF Vouchers tab on product add/edit page * for vendor when WC Marketplace is activated * * @package WooCommerce - PDF Vouchers * @since 3.3.1 */ public function woo_vou_wcmp_remove_pdf_vou_tab() { global $woo_vou_admin_meta; $user_id = get_current_user_id(); // Get current user $vou_wcmp_vendor_acess_pdf_vou_meta = get_option('vou_enable_wcmp_vendor_acess_pdf_vou_meta'); // Get global option // If WCMp class exists and if option is not empty and set to yes if ( is_user_wcmp_vendor($user_id) && (!empty($vou_wcmp_vendor_acess_pdf_vou_meta) && $vou_wcmp_vendor_acess_pdf_vou_meta == 'no' )) { // Remove PDF Vouchers tab remove_action('woocommerce_product_write_panel_tabs', array($woo_vou_admin_meta, 'woo_vou_product_write_panel_tab')); } } /** * Modify Vendor Role Array * * Handle to modify vendor role array * * @package WooCommerce - PDF Vouchers * @since 3.8.2 */ public function woo_vou_wcmp_append_voucher_role( $woo_vou_roles ) { // Get global options $vou_enable_auto_integrate_wcmp_vendor = get_option('vou_enable_auto_integrate_wcmp_vendor'); // add WC Marketplace as a vendor if( empty( $vou_enable_auto_integrate_wcmp_vendor ) || $vou_enable_auto_integrate_wcmp_vendor == 'yes' ) { $woo_vou_roles[] = 'dc_vendor'; } return $woo_vou_roles; } /** * Adding Hooks * * Adding proper hooks for Vendor. * * @package WooCommerce - PDF Vouchers * @since 3.8.2 */ public function add_hooks(){ // Append the settings array add_filter( 'woo_vou_misc_settings', array( $this, 'woo_vou_wcmp_settings' ) ); // Append the pdf voucher role add_filter( 'woo_vou_edit_vendor_role', array($this, 'woo_vou_wcmp_append_voucher_role' ) ); // remove metabox in products when WC Marketplace is active add_action('admin_init', array($this, 'woo_vou_wcmp_remove_pdf_vou_tab')); } }
[+]
..
[-] class-woo-vou-your-price.php
[edit]
[-] class-woo-vou-wedevs-dokan.php
[edit]
[-] class-woo-vou-order-sms.php
[edit]
[-] class-woo-vou-booking.php
[edit]
[-] class-woo-vou-qtranslate-x.php
[edit]
[-] class-woo-vou-wpml.php
[edit]
[-] class-woo-vou-vendor-pro.php
[edit]
[-] class-woo-vou-eml.php
[edit]
[-] class-woo-vou-vendor.php
[edit]
[-] class-woo-vou-wcmp.php
[edit]
[-] class-woo-vou-bundles.php
[edit]
[-] class-woo-vou-currency-switcher.php
[edit]