• Resolved gergeda008

    (@gergeda008)


    Hello, sorry for my english im use google translate for this ??

    need a code that will add the vendors address on the single product page,
    I am already showing the vendor name on this page and it works great.

    this is the code i am using for this –

    if (current_user_can(‘editor’)){

    add_action( ‘woocommerce_single_product_summary’, ‘seller_name_on_single’, 11 );
    function seller_name_on_single(){
    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( ‘GM: [ <a1 href=”%s”>%s‘, dokan_get_store_url( $author->ID ), $author->user_firstname ); ?>
    <?php printf( ‘<a1 href=”%s”>%s‘, dokan_get_store_url( $author->ID ), $author->user_lastname ); ?>

    </span>
    <?php
    }
    }
    }

    i just want to add address field to this, i already tried to add to this code billing adrress and it works,but I cannot figure out how to add “store adrress”

    please, help ??

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello @gergeda008 ,

    There are multiple ways to get the store address in your example. The fastest and easiest will be using our built-in function dokan_get_seller_short_address() like this –

    $store_address = dokan_get_seller_short_address( $author->ID, false );
    <?php printf( 'Store Address: %s', $store_address); ?>

    You can also use the function dokan_get_seller_address() to get full address.

    You can also retrieve the address from your $store_info array –

    print_r($store_info['address']);

    I hope this is all you need to complete this customization.

    Thank you ??

    Thread Starter gergeda008

    (@gergeda008)

    Thank you so much, i was trying to figure out how to do this all day … Now everything works great!

    Thread Starter gergeda008

    (@gergeda008)

    sir, sorry if i bother you, but this is the last thing I would like to do
    with this plagin.

    i was wondering maybe i can add to this vendor “payment” information too,
    I pay vendors using the bank transfer method and if this information will displayed on the product page it would make my job much easier.

    thanks

    Hello @gergeda008 ,

    Here are the array values that you need to get all details about banks in your implementation –

    printf("<p>Account name: %s</p>", $store_info['payment']['bank']['ac_name']);
    printf("<p>Account number: %s</p>", $store_info['payment']['bank']['ac_number']);
    printf("<p>Bank name: %s</p>", $store_info['payment']['bank']['bank_name']);
    printf("<p>Bank address: %s</p>", $store_info['payment']['bank']['bank_addr']);
    printf("<p>Routing number: %s</p>", $store_info['payment']['bank']['routing_number']);
    printf("<p>IBAN: %s</p>", $store_info['payment']['bank']['iban']);
    printf("<p>SWIFT: %s</p>", $store_info['payment']['bank']['swift']);

    I hope this helps and you can always share your appreciation by rating us ??

    Thank you ??

    Thread Starter gergeda008

    (@gergeda008)

    thank you very much @RashedRipon!
    Have not seen such good support yet,
    i left my comment and wrote everything I think about your plugin.
    Very good !! Thx Rashed !

    • This reply was modified 3 years, 11 months ago by gergeda008.
    • This reply was modified 3 years, 11 months ago by gergeda008.

    Thanks a lot @gergeda008 ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘need help for displaying vendor address on the single product page’ is closed to new replies.