forked from TeleMD/dc-woocommerce-multi-vendor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaxonomy-dc_vendor_shop.php
executable file
·69 lines (62 loc) · 1.88 KB
/
taxonomy-dc_vendor_shop.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* The Template for displaying products in a product category. Simply includes the archive template.
*
* Override this template by copying it to yourtheme/dc-product-vendor/taxonomy-dc_vendor_shop.php
*
* @author WC Marketplace
* @package WCMp/Templates
* @version 2.2.0
*/
global $WCMp;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
// Get vendor
$vendor = get_wcmp_vendor_by_term(get_queried_object()->term_id);
if(!$vendor){
// Redirect if not vendor
wp_safe_redirect(get_permalink( woocommerce_get_page_id( 'shop' ) ));
exit();
}
$is_block = get_user_meta($vendor->id, '_vendor_turn_off' , true);
if($is_block) {
get_header( 'shop' ); ?>
<?php
/**
* woocommerce_before_main_content hook
*
* @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
* @hooked woocommerce_breadcrumb - 20
*/
do_action( 'woocommerce_before_main_content' );
?>
<?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?>
<h1 class="page-title"><?php woocommerce_page_title(); ?></h1>
<?php endif; ?>
<?php do_action( 'woocommerce_archive_description' );
$block_vendor_desc = apply_filters('wcmp_blocked_vendor_text', __('Site Administrator has blocked this vendor', 'dc-woocommerce-multi-vendor'), $vendor);
?>
<p class="blocked_desc">
<?php echo esc_attr($block_vendor_desc); ?>
<p>
<?php
/**
* woocommerce_after_main_content hook
*
* @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
*/
do_action( 'woocommerce_after_main_content' );
?>
<?php
/**
* woocommerce_sidebar hook
*
* @hooked woocommerce_get_sidebar - 10
*/
do_action( 'woocommerce_sidebar' );
?>
<?php get_footer( 'shop' );
} else {
wc_get_template( 'archive-product.php' );
}