• Resolved Lori Boone

    (@pleazo)


    Hello,

    I am trying to add the shop link under the the title of the item. I am using Elementor using the following in functions.php

    /**
    * Show sold by on single product page made with Elementor
    * Add the shortcode [dokan_vendor_name] through a short-code widget on single product page
    */
    add_shortcode( ‘dokan_vendor_name’, ‘dokan_store_name_shortcode’ );
    function dokan_store_name_shortcode() {
    global $product;
    $seller = get_post_field( ‘post_author’, $product->get_id());
    $author = get_user_by( ‘id’, $seller );
    $vendor = dokan()->vendor->get( $seller );

    $store_info = dokan_get_store_info( $author->ID );

    if ( !empty( $store_info[‘store_name’] ) ) { ?>
    <span class=”details”>
    <?php printf( ‘Sold by: %s‘, $vendor->get_shop_url(), $vendor->get_shop_name() ); ?>
    </span>
    <?php
    }
    }


    after entering this code, I also add the source code [dokan_vendor_name] in elementor. However this is not working.

    Is there another way of doing this?

    Best,
    Chris

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support slash1andy

    (@slash1andy)

    Automattic Happiness Engineer

    Hey there!

    This looks like you are using functions from dokan and elementor, not using any actual WooCommerce hooks. I would recommend checking with the makers of dokan or elementor for more info, as this is not really a WooCommerce question.

    Hopefully that helps! Have a great one!

Viewing 1 replies (of 1 total)

The topic ‘Adding shop link in item page’ is closed to new replies.