Adding shop link in item page
-
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,
ChrisThe page I need help with: [log in to see the link]
The topic ‘Adding shop link in item page’ is closed to new replies.