我想改變添加/完成付款變化項目meta_data上payment_completed
是somethink喜歡添加自定義字段隨機數發生變化後,爲了項目一meta_data。
我該如何做到這一點?
我不發現
public function process_payment($order_id) {
global $woocommerce;
$order = new WC_Order($order_id);
// Mark as on-hold (we're awaiting the cheque)
if ('yes' == $this->debug) {
$this->log->add('Compra', "IPN Response Loggin test");
}
$order->get_items();
if (sizeof($order->get_items()) > 0) {
foreach ($order->get_items() as $item) {
if (! $item['qty']) {
continue;
}
// Any information about function to edit meta data in item ?
}
}
$order->payment_complete();
// Reduce stock levels
$order->reduce_order_stock();
// Remove cart
$woocommerce->cart->empty_cart();
// Return thankyou redirect
return array(
'result' => 'success',
'redirect' => $this->get_return_url($order)
);
}
不爲我工作..我認爲代碼是更新產品= \ –