HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/hanode/public_html/wp-content/themes/kingstore/lib/wc-vendor-hook.php
<?php 
/*
	* Name: WC Vendor Hook
	* Develop: SmartAddons
*/

/*
** Wrapper for dashboard
*/
add_action( 'wcvendors_before_dashboard', 'kingstore_wrapper_before_vendor_dashboard' );
add_action( 'wcvendors_after_dashboard', 'kingstore_wrapper_after_vendor_dashboard' );
function kingstore_wrapper_before_vendor_dashboard(){
	echo '<div class="vendor-dashboard-wrapper">';
}

function kingstore_wrapper_after_vendor_dashboard(){
	echo '</div>';
}

add_action( 'wp', 'kingstore_wcvendor_hook' );
function kingstore_wcvendor_hook(){
	$wc_prd_vendor_options 	= get_option( 'wc_prd_vendor_options' ); 
	$pro_store_header		= ( isset( $wc_prd_vendor_options[ 'vendor_store_header_type' ] ) ) ? $wc_prd_vendor_options[ 'vendor_store_header_type' ] : ''; 
	if( 'pro' !== $pro_store_header ) {
		remove_action( 'woocommerce_before_main_content', array( 'WCV_Vendor_Shop', 'shop_description' ), 30 );
		add_action( 'woocommerce_archive_description', array( 'WCV_Vendor_Shop', 'shop_description' ), 10 );
	}else{
		if( WCV_Vendors::is_vendor_page() ) {
			add_action( 'woocommerce_before_main_content', 'kingstore_vendor_breadcrumb', 9 );
			remove_action( 'woocommerce_before_main_content', 'kingstore_banner_listing', 10 );
		}
	}
	if( WCV_Vendors::is_vendor_page() ) {
		add_action( 'woocommerce_before_main_content', 'kingstore_vendor_breadcrumb', 9 );
	}
}

function kingstore_vendor_breadcrumb(){
?>
	<div class="kingstore_breadcrumbs">
		<div class="container">
			<div class="breadcrumbs custom-font theme-clearfix">
				<span><?php esc_html_e( 'Yến Minh Hoàng - ', 'kingstore' ) ?></span><label><?php esc_html_e( 'Sức khỏe cho mọi nhà', 'kingstore' ) ?></label>
			</div>
		</div>
	</div>
<?php 
}

// Add sold by to product loop before add to cart
if ( WC_Vendors::$pv_options->get_option( 'sold_by' ) ) { 
	remove_action( 'woocommerce_after_shop_loop_item', array('WCV_Vendor_Shop', 'template_loop_sold_by'), 9 );
	add_action( 'woocommerce_single_product_summary', array('WCV_Vendor_Shop', 'template_loop_sold_by'), 55 );
	add_action( 'woocommerce_single_product_summary', 'topdeal_soldby_wrapper_start', 51 );
	add_action( 'woocommerce_single_product_summary', 'topdeal_soldby_wrapper_end', 56 );
	function topdeal_soldby_wrapper_start(){
		echo '<div class="wc-soldby-start">';
	}
	
	function topdeal_soldby_wrapper_end(){
		echo '</div>';
	}
} 

/*
** Add wrapper sold by
*/
add_filter( 'wcvendors_sold_by_in_loop', 'kingstore_custom_soldby' );
function kingstore_custom_soldby( $sold_by_label ){
	return '<span>' . $sold_by_label . '</span>';
}