function yith_ywraq_constructor()
{
    // Woocommerce installation check _________________________
    if (!function_exists('WC')) {
        function yith_ywraq_install_woocommerce_admin_notice()
        {
            ?>
            <div class="error">
                <p><?php 
            _e('YITH Woocommerce Request A Quote is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-request-a-quote');
            ?>
</p>
            </div>
        <?php 
        }
        add_action('admin_notices', 'yith_ywraq_install_woocommerce_admin_notice');
        return;
    }
    // Load YWCM text domain ___________________________________
    load_plugin_textdomain('yith-woocommerce-request-a-quote', false, dirname(plugin_basename(__FILE__)) . '/languages/');
    // Load required classes and functions
    if (!class_exists('WC_Session')) {
        include_once WC()->plugin_path() . '/includes/abstracts/abstract-wc-session.php';
    }
    require_once YITH_YWRAQ_INC . 'functions.yith-request-quote.php';
    require_once YITH_YWRAQ_INC . 'class.yith-ywraq-session.php';
    require_once YITH_YWRAQ_INC . 'class.yith-ywraq-shortcodes.php';
    require_once YITH_YWRAQ_INC . 'class.yith-request-quote.php';
    if (is_admin()) {
        require_once YITH_YWRAQ_INC . 'class.yith-request-quote-admin.php';
    } else {
        require_once YITH_YWRAQ_INC . 'class.yith-request-quote-frontend.php';
        YITH_YWRAQ_Frontend();
    }
    YITH_Request_Quote();
}
Example #2
0
        function yit_ywraq_print_button_single_page() {

            if ( defined( 'YITH_YWRAQ_VERSION' ) ) {

                $yith_request_quote = YITH_YWRAQ_Frontend();

                if ( method_exists( $yith_request_quote, 'add_button_single_page' ) ) {
                    ob_start();
                    $yith_request_quote->add_button_single_page();
                    return ob_get_clean();
                }


            }
            return '';
        }