Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.9 kB
7
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();
});

add_shortcode('marketking_storelogo', function(){
	ob_start();

	$vendor_id = marketking()->get_vendor_id_in_store_url();
	
	$img = marketking()->get_store_profile_image_link($vendor_id);
	if (empty($img)){
		// show default image
		$img = MARKETKINGCORE_URL. 'includes/assets/images/store-profile.png';

	} else {
		$img = marketking()->get_resized_image($img, 'thumbnail');
	}

	?>
	<div class="marketking_elementor_store_profile_image"><img style="display:inline;" src="<?php echo esc_url($img);?>"></div>

	<?php

	return ob_get_clean();
});

add_shortcode('markekting_storename', function(){
	ob_start();

	$vendor_id = marketking()->get_vendor_id_in_store_url();
	
	$store_name = marketking()->get_store_name_display($vendor_id);

	echo $store_name;

	return ob_get_clean();
});
Leave a Comment