I am writing a business extension (pdf printing) for the smart coupons.
Now I need a relation from the generated coupon (of the order) and the order item.
For example, which order item has generated the coupon?
Is there a way to get the order item_id
from the coupon?
Is use this code to get the coupons:
$coupons = get_post_meta($order_id, 'sc_coupon_receiver_details', true));
Thank you very much
I have found a solution, but i had to put the code inside "woocommerce-smart-coupons.php" file.
Line 379: Extend the Filter Variables
Line 4783: Extend the Variable with the $item_id
Line 4816: Get the $item_id from the details and refer it to the "generate_smart_coupon" method
Line 5194: Change the Method and extend the variables
Line 5212: Extend the filter method to
Line 5307: Store the $item_id in the post_meta