Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.1 kB
2
Indexable
Never
add_shortcode('marketking_follow', function(){
	ob_start();

	$vendor_id = marketking()->get_vendor_id_in_store_url();
	
	?>
	<div class="marketking_tabclass" style="display:inline-block !important;">
	  	<?php
		  	if (defined('MARKETKINGPRO_DIR')){
			  	if (intval(get_option('marketking_enable_favorite_setting', 1)) === 1){
			  		// cannot follow self
			  		$user_id = get_current_user_id();
			  		if ($vendor_id !== $user_id && is_user_logged_in()){
			  			$follows = get_user_meta($user_id,'marketking_follows_vendor_'.$vendor_id, true);

			  			?>
			  			<button class="marketking_follow_button" value="<?php echo esc_attr($vendor_id);?>"><?php
			  				if ($follows !== 'yes'){
			  					esc_html_e('Follow','marketking-multivendor-marketplace-for-woocommerce');
			  				} else if ($follows === 'yes'){
			  					esc_html_e('Following','marketking-multivendor-marketplace-for-woocommerce');
			  				}
			  				
			  			?></button>
			  			<?php

			  			do_action('marketking_store_page_tabright', $vendor_id);

			  		}
			  	}
			}
	  	?>
	</div>
	<?php

	return ob_get_clean();
});
Leave a Comment