?AlkantarClanX12

Your IP : 216.73.216.177


Current Path : /home/rankinh/lynkandco/wp-content/plugins/nexteuv-pro/modules/woocommerce/others/search/
Upload File :
Current File : /home/rankinh/lynkandco/wp-content/plugins/nexteuv-pro/modules/woocommerce/others/search/index.php

<?php

/**
 * WooCommerce - Search Core Class
 */


if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

if( !class_exists( 'NextEuv_Shop_Others_Search' ) ) {

    class NextEuv_Shop_Others_Search {

        private static $_instance = null;

        public static function instance() {

            if ( is_null( self::$_instance ) ) {
                self::$_instance = new self();
            }

            return self::$_instance;

        }

        function __construct() {

            // Load Modules
                $this->load_modules();

            // Page Template
                add_filter ( 'theme_page_templates', array ( $this, 'module_add_new_page_template' ) );

            // Include Template
                add_filter ( 'template_include', array ( $this, 'modules_template_include' ) );

        }


        /*
        Module Paths
        */

            function module_dir_path() {

                if( nexteuv_is_file_in_theme( __FILE__ ) ) {
                    return NEXTEUV_MODULE_DIR . '/woocommerce/others/search/';
                } else {
                    return trailingslashit( plugin_dir_path( __FILE__ ) );
                }

            }

            function module_dir_url() {

                if( nexteuv_is_file_in_theme( __FILE__ ) ) {
                    return NEXTEUV_MODULE_URI . '/woocommerce/others/search/';
                } else {
                    return trailingslashit( plugin_dir_url( __FILE__ ) );
                }

            }

        /**
         * Load Modules
         */
            function load_modules() {

                if( function_exists( 'nexteuv_pro' ) ) {
                    include_once $this->module_dir_path(). 'elementor/index.php';
                }

            }

        /**
         * Page Template
         */
            function module_add_new_page_template( $templates ) {

                $templates = array_merge (
                    $templates,
                    array (
                        'tpl-product-search-listing.php' => esc_html__('Product Search Listing Template', 'nexteuv-pro')
                    )
                );

                return $templates;

            }

        /**
         * Include Template
         */
            function modules_template_include( $template ) {

                if( is_singular('page') ) {

                    global $post;
                    $id = $post->ID;
                    $file = get_post_meta( $post->ID, '_wp_page_template', true );

                    if( 'tpl-product-search-listing.php' == $file ) {
                        if( ! file_exists( get_stylesheet_directory() . '/tpl-product-search-listing.php' ) ) {
                            $template = $this->module_dir_path() . 'templates/tpl-product-search-listing.php';
                        }
                    }

                }

                return $template;

            }

    }

}

if( !function_exists('nexteuv_shop_others_search') ) {
	function nexteuv_shop_others_search() {
        $reflection = new ReflectionClass('NextEuv_Shop_Others_Search');
        return $reflection->newInstanceWithoutConstructor();
	}
}

NextEuv_Shop_Others_Search::instance();