MultivendorX
-
AuthorPosts
-
-
July 18, 2024 at 6:20 PM #221757dennisParticipant
Hey!
In the class-mvx-order.php you are on line 580 and 581 trying to set:
‘_customer_ip_address’
‘_customer_user_agent’Through update_meta_data function on the WC_Order object.
Problem is, that this is internal fields, and therefore should be set with set_customer_ip_address and set_customer_user_agent.
This is making my whole checkout break, so the customers can’t go payment, since I get the “is_internal_meta_key” error.
Can you fix it?
-
July 18, 2024 at 7:34 PM #221763MVX Support NinjaKeymaster
Hi @dennis, sorry to hear that you have faced this issue.
However can you please let us know how can we recreate the same on our end, so we can try to recreate the same and assist you with the solution.
-
July 21, 2024 at 5:37 PM #221815dennisParticipant
You need to just look in the class-mvx.php on the mentioned lines 🙂
The problem is, that you don’t check if HPOS is enabled.
IF HPOS is enabled, you should use the built-in WooCommerce functions for setting the two variables.
Because it is an internal key it can not be set by the update_meta_data function anymore 🙂So this is the current code, but you should do something like this:
// Add vendor order meta data
$order_meta = apply_filters(‘mvx_vendor_order_metas’, array(
‘_payment_method’,
‘_payment_method_title’,
‘_customer_user’,
‘_prices_include_tax’,
‘_order_currency’,
// ‘_order_key’,
‘_customer_ip_address’,
‘_customer_user_agent’,
));
foreach ($order_meta as $key) {
if($MVX->hpos_is_enabled){
if($key == ‘_customer_ip_address’){
$vendor_order->set_customer_ip_address( $order->get_customer_ip_address() );
} else if($key == ‘_customer_user_agent’){
$vendor_order->set_customer_user_agent( $order->get_customer_user_agent() );
} else {
$vendor_order->update_meta_data($key, $order->get_meta( $key, true));
}
} else {
update_post_meta($vendor_order->get_id(), $key, get_post_meta($order->get_id(), $key, true));
}
$vendor_order->save();
} -
July 21, 2024 at 9:21 PM #221816Sangita Support SquadKeymaster
Hi there, Thanks for sharing the details with us. Let me share this with the dev team and once I hear back from them I will keep you posted accordingly.
Thanks for your understanding and cooperation.
-
-
AuthorPosts
Please LOGIN to reply to this topic