I needed to add some params to the order_data array in(v2/class-wc-api-order.php) woocommere and i've created a plugin so my changes wouldn't be overwritten by every update but i cant manage to get the id from the class?
I want $id to be the same the id i send in with my API
$id =
$order = wc_get_order( $id );
$olddata = array(
'first_name' => $order->shipping_first_name,
'last_name' => $order->shipping_last_name,
'company' => $order->shipping_company,
'address_1' => $order->shipping_address_1,
'address_2' => $order->shipping_address_2,
'city' => $order->shipping_city,
'state' => $order->shipping_state,
'postcode' => $order->shipping_postcode,
'country' => $order->shipping_country,
);
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire