WC Lovers

WooCommerce Frontend Manager - Multivendor marketplace vendor dashboard

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Vendor Data on Order Metadata #125134
    john.kaufmann
    Participant

    Thank you for that, that is a problem. However the wcfm_get_vendor_store_address_by_vendor( $vendor_id ); function is returning empty still. What is the appropriate way to get the vendor’s address from this hook?

    in reply to: Vendor Data on Order Metadata #124376
    john.kaufmann
    Participant

    Thank you that was helpful, definitely pulling me in the right direction!

    However I’m still having trouble figuring out where things are stored. I’ve store it like so:

    wcfm_update_user_meta( $vendor_id, 'wcfm_vendor_VAT_id', $wcfm_settings_form['wcfm_vendor_VAT_id'] );

    
    add_action( 'woocommerce_checkout_create_order_line_item', 'wcfm_add_vendor_order_line_item_meta', 10, 4 );
    function wcfm_add_vendor_order_line_item_meta( $item, $cart_item_key, $values, $order ) {
      $product = $values['data'];
      if ( $product ) {
        $product_id = $product->is_type( 'variation' ) ? $product->get_parent_id() : $product->get_id();
        $vendor_id = wcfm_get_vendor_id_by_post( $product_id );
        $vendor_data = wcfm_get_vendor_store_address_by_vendor( $vendor_id );
        if ( $vendor_id ) {
          debug_to_stdout($vendor_data);
          $_wcfm_vendor_VAT_id = wcfm_get_user_meta( $vendor_id, 'wcfm_vendor_VAT_id', true );
          if ( ! empty( $vat_id ) ) {
              $item->update_meta_data( '_wcfm_vendor_vat_id', $_wcfm_vendor_VAT_id );
              $item->update_meta_data( '_wcfm_vendor_address', $vendor_data );
          }
        }
      }
    }
    
    add_filter( 'woocommerce_order_item_display_meta_key', function( $display_key, $meta = '' ) {
      if( $display_key == '_wcfm_vendor_vat_id' ) {
        $display_key = __( 'VAT ID' );
      }
      if( $display_key == '_wcfm_vendor_address' ) {
        $display_key = __( 'VENDOR ADDRESS' );
      }
      return $display_key;
    }, 50, 2 );
    

    With that being said, this is what I’ve altered your code to. It’s showing up empty for address though..

    in reply to: Filter Order Export Values on orderslist (and others) #118782
    john.kaufmann
    Participant

    I know, but I am running a multi-vendor store. So am I expected to tell all of my vendors they have to disable an excel setting before exporting? That seems unreasonable and prone to error. What if that command is something malicious?

    Are there no quick fixes to this problem?

    in reply to: Filter Order Export Values on orderslist (and others) #115997
    john.kaufmann
    Participant

    Ah okay, I see what you’re saying. My apologies. The address that is listed is able to be submitted through the system making it valid. The problem is when exported to excel, it is interpreted as a command and will run on opening excel.

    If you could help me understand how to filter those values out, or not allow them as addresses in the first place. That would be very helpful. Thank you in advance!

    in reply to: Filter Order Export Values on orderslist (and others) #115115
    john.kaufmann
    Participant

    Yes it is. This is possible in the current system

    in reply to: Filter Order Export Values on orderslist (and others) #114366
    john.kaufmann
    Participant

    Any update on this?

Viewing 6 posts - 1 through 6 (of 6 total)