Change _customer_user
-
Heya guys,
I am working on a solution to add B2B customer acvcounts to wordpress. To facilitate that, the main account should be able to view the orders of its employees (which are other wordpress users). I succeeded to make a table with the necessary orders on the my account page, but I am stuck on view-order page. I found out that if I would change _customer_user in wp_postmeta, I would be able to view the order.
I have tried putting the following code at the beginning of view-order.php:
global $wpdb;
$sql=”UPDATEwp_postmeta
SETmeta_value
= ‘9’ WHEREmeta_key
=4683″;
$wpdb->query($sql);The problem is that it executes after all the necessary details are loaded, so I am getting an invalid order error. Of course, in a later point, I would change 9 tot get_current_user and meta_key to order_id and meta_key. So my question is where should I put this function for it to work correctly?
Thanks.
- The topic ‘Change _customer_user’ is closed to new replies.