예제 #1
0
<?php

if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
include_once dirname(__FILE__) . '/includes/functions.php';
if (dhwc_is_active() && !class_exists('DHWCLookbook')) {
    class DHWCLookbook
    {
        public function __construct()
        {
            if (taxonomy_exists('product_lookbook')) {
                return;
            }
            add_action('woocommerce_register_taxonomy', array($this, 'register_taxonomy'));
            if (is_admin()) {
                include_once dirname(__FILE__) . '/includes/admin.php';
            } else {
                add_shortcode('product_lookbook', array(&$this, 'product_lookbook_shortcode'));
            }
            add_filter('template_include', array($this, 'template_include'));
        }
        public function register_taxonomy()
        {
            if (taxonomy_exists('product_lookbook')) {
                return;
            }
            global $woocommerce;
            $permalinks = get_option('woocommerce_permalinks');
            $shop_page_id = woocommerce_get_page_id('shop');
예제 #2
0
<?php

if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
include_once dirname(__FILE__) . '/includes/dhwc-brand-functions.php';
if (dhwc_is_active()) {
    class DHWC_Brand
    {
        public function __construct()
        {
            if (taxonomy_exists('product_brand')) {
                return;
            }
            add_action('woocommerce_register_taxonomy', array($this, 'dhwc_init_taxonomy'));
            add_action('loop_shop_post_in', array($this, 'dhwc_loop_shop_post_in_brand'), 11);
            add_action('widgets_init', array($this, 'dhwc_widget_init'));
            if (is_admin()) {
                include_once dirname(__FILE__) . '/includes/dhwc-brand-admin.php';
            }
            add_filter('template_include', array($this, 'dhwc_template_include'));
            //add_filter('body_class',array($this,'dhwc_add_body_class'));
            if (get_option('dhwc_product_brand_show_desc') == 'yes') {
                add_action('woocommerce_archive_description', array($this, 'dhwc_show_product_brand_descs'));
            }
            add_action('woocommerce_product_meta_end', array($this, 'dhwc_add_prouduct_brand_meta'));
        }
        function dhwc_init_taxonomy()
        {
            global $woocommerce;
예제 #3
0
<?php

if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
include_once dirname(__FILE__) . '/includes/dhwc-brand-functions.php';
if (dhwc_is_active() && !class_exists('DHWC_Brand')) {
    class DHWC_Brand
    {
        public function __construct()
        {
            if (taxonomy_exists('product_brand')) {
                return;
            }
            add_action('woocommerce_register_taxonomy', array($this, 'dhwc_init_taxonomy'));
            add_action('loop_shop_post_in', array($this, 'dhwc_loop_shop_post_in_brand'), 11);
            add_action('widgets_init', array($this, 'dhwc_widget_init'));
            if (is_admin()) {
                include_once dirname(__FILE__) . '/includes/dhwc-brand-admin.php';
            } else {
                add_shortcode('dhwc_product_brands', array(&$this, 'dhwc_product_brands_shortcode'));
            }
            add_filter('template_include', array($this, 'dhwc_template_include'));
            //add_filter('body_class',array($this,'dhwc_add_body_class'));
            if (get_option('dhwc_product_brand_show_desc') == 'yes') {
                add_action('woocommerce_archive_description', array($this, 'dhwc_show_product_brand_descs'));
            }
            add_action('woocommerce_product_meta_end', array($this, 'dhwc_add_prouduct_brand_meta'));
        }
        function dhwc_init_taxonomy()
예제 #4
0
 public function init()
 {
     load_plugin_textdomain(DHVC_WOO, false, basename(DHVC_WOO_DIR) . '/languages');
     wp_register_style('dhvc-woo-chosen', DHVC_WOO_URL . 'assets/css/chosen.min.css');
     wp_register_style('dhvc-woo-font-awesome', DHVC_WOO_URL . 'assets/fonts/awesome/css/font-awesome.min.css', array(), '4.0.3');
     wp_register_style('dhvc-woo', DHVC_WOO_URL . 'assets/css/style.css');
     if (is_admin()) {
         add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_styles'));
         add_action('admin_enqueue_scripts', array(&$this, 'enqueue_scripts'));
     } else {
         add_action('wp_print_scripts', array(&$this, 'enqueue_scripts'));
         add_filter('term_link', array($this, 'term_link'), 100, 10);
         //add_action( 'template_redirect', array($this,'template_redirect'),1000);
         add_filter('template_include', array(&$this, 'template_loader'), 1000);
     }
     if (!dhwc_is_active()) {
         add_action('admin_notices', array(&$this, 'woocommerce_notice'));
         return;
     }
     if (is_admin()) {
         require_once DHVC_WOO_DIR . '/includes/admin.php';
     }
     require_once DHVC_WOO_DIR . '/includes/class.php';
     $shortcode = new DHVCWooCommerce();
     $shortcode->init();
 }