• Hello,

    Is it possible for the plugin to also include seller vat numbers on the invoice? I have a VAT ID field in my seller’s registration form using Dokan using the following in my child functions.php:

    add_filter( 'dokan_settings_form_bottom', 'extra_fields', 10, 2);
    
    function extra_fields( $current_user, $profile_info ){
    $seller_vat= isset( $profile_info['seller_vat'] ) ? $profile_info['seller_vat'] : '';
    ?>
     <div class="gregcustom dokan-form-group">
            <label class="dokan-w3 dokan-control-label" for="setting_address">
                <?php _e( 'VAT ID', 'dokan' ); ?>
            </label>
            <div class="dokan-w5">
                <input type="text" class="dokan-form-control input-md valid" name="seller_vat" id="reg_seller_vat" value="<?php echo $seller_vat; ?>" />
            </div>
        </div>
        <?php
    }
    
        //save the field value
    
    add_action( 'dokan_store_profile_saved', 'save_extra_fields', 15 );
    function save_extra_fields( $store_id ) {
        $dokan_settings = dokan_get_store_info($store_id);
        if ( isset( $_POST['seller_vat'] ) ) {
            $dokan_settings['seller_vat'] = $_POST['seller_vat'];
        }
     update_user_meta( $store_id, 'dokan_profile_settings', $dokan_settings );
    }
Viewing 1 replies (of 1 total)
  • Plugin Author Diego

    (@daigo75)

    The EU VAT Assistant doesn’t support multi-vendor solutions, and won’t inject information on the invoices automatically. To show the VAT number of a seller on the invoice, you will need to implement a custom filter to append the seller VAT number to the invoice.

    The result could be something like the following (code just for illustration purposes, nor ready-made solution):

    add_filter('some_filter_to_alter_seller_address', function($seller_address, $store_id) {
      $dokan_settings = dokan_get_store_info($store_id);
      if(!empty($dokan_settings['seller_vat'])) {
        $seller_address .= 'VAT #: ' . $dokan_settings['seller_vat'];
      }
      return $seller_address;
    }, 10, 2);

    Note: this is just an example to illustrate the concept, not functional code. The actual implementation will depend on how the invoices are generated and on the available filters and data.

    We would recommend to contact the Dokan support team, or the support team for the invoicing plugin, who should be able to guide you through the implementation.

Viewing 1 replies (of 1 total)
  • The topic ‘Including seller VAT # on invoice’ is closed to new replies.