• Resolved gryadn

    (@gryadn)


    Hello,

    I want to have the name of the store independently on a single product page, and when clicked, I want it to go back to the seller’s home page. Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Shafinoid

    (@shafinahmad01)

    Hi @gryadn

    If you want to show the Store Name on the Single Product Page then you will need to add a customized function then need to pass the function via the available hook.

    Though we are not supposed to provide any custom solutions as per our support policy, I’m adding a custom code that will allow you to Store Name on blow the Price of the product.

    Add the below code to your child theme’s function.php file,

    function show_storename_on_single_bellow_the_price(){
                   global $product;
            $seller = get_post_field( 'post_author', $product->get_id());
            $author  = get_user_by( 'id', $seller );
    
            $store_info = dokan_get_store_info( $author->ID );
    
            if ( !empty( $store_info['store_name'] ) ) { ?>
                <span class="details">
                        <?php printf( 'Sold by: <a href="%s">%s</a>', dokan_get_store_url( $author->ID ), $author->display_name ); ?>
                    </span>
                <?php
            }
        }
    
    add_action( 'woocommerce_single_product_summary','show_storename_on_single_bellow_the_price', 11 );

    Have a nice day!

    Thread Starter gryadn

    (@gryadn)

    Thank you so much
    sending best wishes

    Shafinoid

    (@shafinahmad01)

    Hi @gryadn

    I’m glad to be able to assist you and resolving this topic.
    However, feel free to create a new one anytime. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Showing Vendor’s name (and link to vendor’s store) on a single product page’ is closed to new replies.