I need some help retrieving coupon codes from an order. We’re using coupon codes and they’re working just fine…functionally there are no issues.
However, I’ve having great difficulty with figuring out how to display the coupon code that was used, on the Order Status page. The code used is shown on the Cart, Checkout, and Admin/Edit screens but not on Order Status. And somehow I can’t figure this out.
The item sold is a download link and in /plugins/marketpress/common/class-mp-order.php we added a 2nd link to an extra info page. I want to append the coupon code used to that URL…so something like the following (replacing the TEST123 with the dynamic coupon code):
echo '<a href=“/my_custom_page.php?coupon=TEST123” target="_blank">View Coupon Details</a>';
Most of what I’ve found takes the coupon code as a parameter, but that’s the value I want to get back. I can’t seem to even find where the coupon is retrieved for the screens where I see it displayed. Any ideas or examples to help point me in the right direction?
Thanks in advance!
WordPress: Version 4.9.4
Marketpress: Version 3.2.8
Theme: bFastMag Pro: Version 2.0.0