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