I have Created a coupon programmatically using this documentation -> https://docs.woocommerce.com/document/create-a-coupon-programatically/
It's work good and generate one dynamic coupon code after complete the order. But i want to allow that coupon code only for that ordered product.
So on above code here:
update_post_meta( $new_coupon_id, 'product_ids', '' );
i want to get that order product ID using that order item id.
So any one know solutions for this then please help me.
Thanks, Ketan.