Forum Replies Created
- AuthorPosts
- john.kaufmannParticipant
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?john.kaufmannParticipantThank 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..
April 13, 2020 at 7:53 pm in reply to: Filter Order Export Values on orderslist (and others) #118782john.kaufmannParticipantI 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?
john.kaufmannParticipantAh 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!
john.kaufmannParticipantYes it is. This is possible in the current system
March 31, 2020 at 11:30 pm in reply to: Filter Order Export Values on orderslist (and others) #114366john.kaufmannParticipantAny update on this?
- AuthorPosts