Last active
July 22, 2017 13:44
-
-
Save fervous/397e0b3e2f294b53f53cfe70480f0b03 to your computer and use it in GitHub Desktop.
Seller / Store / Vendor information META BOX on product page. WC Vendors Pro. Seller Info Meta Box.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* seller-info-meta Styles are needed for style.css file... see other GIST titled SELLER INFO META BOX CSS */ | |
/* Remove sold by on single product pages */ | |
remove_action( 'woocommerce_product_meta_start', array( 'WCV_Vendor_Cart', 'sold_by_meta' ), 10, 2 ); | |
/* Add new action with the information box to the product meta */ | |
add_action('woocommerce_product_meta_start', 'custom_woocommerce_product_meta_start_infobox'); | |
function custom_woocommerce_product_meta_start_infobox() { | |
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) ); | |
$vendor_id = get_the_author_meta('ID'); | |
$store_url = WCVendors_Pro_Vendor_Controller::get_vendor_store_url( $vendor_id ); | |
$shop_name = get_user_meta( $vendor_id, 'pv_shop_name', true ); | |
$sold_by = '<a href="'.$store_url.'">'.$shop_name.'</a>'; | |
$store_icon_src = wp_get_attachment_image_src( get_user_meta( $vendor_id, '_wcv_store_icon_id', true ), array( 35, 35) ); | |
$store_icon = ''; | |
if ( is_array( $store_icon_src ) ) { | |
$store_icon = '<img src="'. $store_icon_src[0].'" alt="" class="store-icon" />'; | |
} | |
echo '<div id="seller-info-meta"><span style="font-size:1.10em;font-weight:bold;">Seller Information</span><br><span style="font-size:.85em;color:#aaa;line-height:2em;">Sold By: '.$sold_by.'<br>Visit Store: <br><a href="'.$store_url.'">' . $store_icon . ' </span><span style="font-size:1em;line-height:2em;">'. $sold_by.'</a></span><br>'; | |
if ( ! WCVendors_Pro::get_option( 'ratings_management_cap' ) ) echo WCVendors_Pro_Ratings_Controller::ratings_link( $vendor_id, true ).'</div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it shows under ship from section how i can bring it over the ship from section ?