Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_shortcode('wcfm_vendor_info', function ($attr) {
- global $WCFMmp;
- if ( ! wcfm_is_store_page() ||
- ! $WCFMmp->wcfmmp_vendor->is_vendor_sold_by()
- ) return;
- ob_start();
- $wcfm_store_url = wcfm_get_option( 'wcfm_store_url', 'store' );
- $store_name = apply_filters( 'wcfmmp_store_query_var', get_query_var( $wcfm_store_url ) );
- if ( ! empty( $store_name ) ) {
- $store_user = get_user_by( 'slug', $store_name );
- $store_id = $store_user->ID;
- if( apply_filters( 'wcfmmp_is_allow_archive_sold_by_advanced', false ) ) {
- $WCFMmp->template->get_template( 'sold-by/wcfmmp-view-sold-by-advanced.php', array( 'vendor_id' => $store_id ) );
- } else {
- $WCFMmp->template->get_template( 'sold-by/wcfmmp-view-sold-by-simple.php', array( 'vendor_id' => $store_id ) );
- }
- }
- return ob_get_clean();
- }, 50 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement