• Resolved niikk

    (@niikk)


    Hello,

    We want to display on the product single page all product from the same vendor. I guess we have to work with the code from vendor store, because there ar also all products displayed. So maybe you can help us to find the right code for this. ??

    Afterwards, we will hook in this code on single product pages.

    Cheers

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello @niikk,

    In Dokan we are using custom re-writes rule to create a store page and showing vendors product on the store page. I suggest you to follow this function store_query_filter which you can find in dokan-lite/includes/Rewrites.php file. Where will get the idea of how we are getting vendor-id and fetching all the products.

    Cheers!

    Thread Starter niikk

    (@niikk)

    Hi @nazmulhassann20

    Hmm, I was not able to do it. But I thinks it should not that hard right?

    Hello @niikk ,

    We already have “More products” tab on the single seller page. You can check those codes to get more details on how we are getting all products from that seller. See – \dokan-lite\includes\wc-functions.php function dokan_get_more_products_from_seller().

    Thank you ??

    Thread Starter niikk

    (@niikk)

    Hi @rur165

    First, Happy New Year! ??

    Yes I know. But we basically want to show other products from the vendor and not in a tab. So can we just copy the code there and reuse it?

    • This reply was modified 3 years, 10 months ago by niikk.

    Hello @niikk ,

    Here is my attempt to show more products in the single product page before the tab –

    add_action('woocommerce_after_single_product_summary', function() {
        echo esc_html('More products from this vendor:');
        dokan_get_more_products_from_seller( $seller_id = 0, $posts_per_page = 4 );
    });

    You can take your inspiration/idea from here and use it in your case.

    Thank you ??

    Hello @rur165 ,
    i tried your snippet code but it didnt work,can you please help me

    Hello @ranaelshenaity ,

    Can you please open a new thread & let me know exactly what you tried?

    This snippet will show the products from a seller if you put their ID number in the “$seller_id” variable.

    Thank you ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Display all product from vendor on product single page’ is closed to new replies.