Skip to content

Instantly share code, notes, and snippets.

@fervous
Last active July 22, 2017 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fervous/397e0b3e2f294b53f53cfe70480f0b03 to your computer and use it in GitHub Desktop.
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.
/* 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 . '&nbsp; </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>';
}
@sarmad95
Copy link

it shows under ship from section how i can bring it over the ship from section ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment