1
我已經在WooCommerce創建了兩個自定義的優惠券類型的WooCommerce訂單優惠券折扣類型和數量:獲取
function custom_discount_type($discount_types) {
$discount_types['cash_back_fixed'] =__('Cash Back fixed discount', 'woocommerce');
$discount_types['cash_back_percentage'] =__('Cash Back Percentage discount', 'woocommerce');
return $discount_types;
}
add_filter('woocommerce_coupon_discount_types', 'custom_discount_type',10, 1);
我想獲得的量販式後的訂單狀態是「已完成」,是這樣的:
function wc_m_move_order_money_to_user($order_id, $old_status, $new_status){
if($order->get_used_coupons()) {
if ($coupon->type == 'cash_back_fixed'){
$coupons_amont = ???
....
}
}
}
但$coupon->type
不起作用。
如何獲取訂單中使用的優惠券類型?
如何獲得原始優惠券金額?
感謝
如何找到優惠券金額(不是訂單中使用的優惠券金額) – Gaurav
謝謝你的支持。現在刪除了重複的問題。 – Gaurav