How do I make a shortcode to display the shop name on Dokan?

Question

I’m trying to create a shortcode to display the name of the store selling the product on the single product page. However, the shortcode doesn’t show up in the single product page. I am using the Dokan Pro plugin. Here’s the code I have so far, I put it in the functions.php:

// "store name" Shortcode

add_shortcode('storename', 'shortcode_storename');

global $product, $woocommerce;
function shortcode_storename () {
    return get_shop_name ( $store_user->ID, 40);
}
0
Sean Taylor 4 days 0 Answers 4 views 0

Leave an answer