• Resolved sammzand

    (@sammzand)


    I am using dokan invoice and WooCommerce PDF Invoices & Packing Slips plugins.

    I want to show seller phone number after shop address in my invoice…

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter sammzand

    (@sammzand)

    Anyone from dokan team?

    You need to customize the dokan-invoice.php file of Dokan Invoice plugin. To get the value for the store phone you need to add the ‘phone’ key in $store_info variable.

    $store_info['phone']

    Thread Starter sammzand

    (@sammzand)

    I added this code

    * Add Phone
         * 
         * @since 1.1
         * 
         * @global type $wpo_wcpdf
         * 
         * @param type $phone
         * 
         * @return string $phone
         */
        function wpo_wcpdf_add_dokan_phone( $phone ) {
    
            global $wpo_wcpdf;
            // If parent order keep Original Store name else set seller store name
            if ( $wpo_wcpdf->export->order->post->post_parent == 0 ) {
    
                if ( function_exists( 'dokan_get_seller_ids_by' ) ) {
    
                    $seller_list = dokan_get_seller_ids_by( $wpo_wcpdf->export->order->id );
    
                } else {
    
                    $seller_list = array_unique( array_keys( dokan_get_sellers_by( $wpo_wcpdf->export->order->id ) ) );
    
                }
    
                if ( count( $seller_list ) > 1 ) {
    
                    return $phone;
    
                } else {
    
                    $seller_id  = $seller_list[0];
    
                    $store_info = dokan_get_store_info( $seller_id );
    
                    $phone = !empty( $store_info['phone'] ) ? $store_info['phone'] : __( 'store_info', 'dokan-invoice' );
    
                    return $phone . '<br /><br />Phone: ' . $phone;
                }
    
            } else {
    
                $seller_id  = $wpo_wcpdf->export->order->post->post_author;
                
                $store_info = dokan_get_store_info( $seller_id );
    
                $phone = !empty( $store_info['phone'] ) ? $store_info['phone'] : __( 'store_info', 'dokan-invoice' );
    
                return $phone . '<br /><br />Phone: ' . $phone;
            }
        }

    Now how to make add action hook after seller address?

    Thread Starter sammzand

    (@sammzand)

    Anybody?

    I have the same issue.The dokan invoice plugin is not monitored and only filter store name and address in pdf invoice and packing slips.

    Can we have some reply from the plugin author regarding seller’s ph number after seller address?

    Thread Starter sammzand

    (@sammzand)

    No idea seems dokan invoice support is no longer available..

    Rafsun Chowdhury

    (@rafsuntaskin)

    Hi,

    If you want to add phone number you can simply concat it into the $shop_address variable.There is no need for additional hooks and functions.

    @sammzand your function is wrong it won’t work like that.

    Just replace the line 334 and 346 with the following line in dokan-invoice.php file

    return $shop_address.'<br>'.$store_info['phone'];

    Thread Starter sammzand

    (@sammzand)

    fixed..You saved my dozens of hair.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘show store ph no in dokan invoice’ is closed to new replies.