Coupon Code not showing on Transaction Results Page

Home Forums WP Shop Styling Transaction Results Page Coupon Code not showing on Transaction Results Page

This topic contains 7 replies, has 2 voices, and was last updated by  Lee Brannon 2 years, 1 month ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #15075 Reply

    Lee Brannon

    Hi, I have the shop styling plugin version 2.7 running on my site. In the transaction report email the coupon code is not showing correctly. The form shows:

    Coupon code used: {coupon_code}

    instead of displaying the correct coupon code used.

    The coupon code shows correctly on the other forms. Any idea why this one isn’t working?

    Many Thanks in advance for your assistance.

    #15077 Reply


    Hi, The placeholder {coupon_code} is not a standard placeholder. Did you add the field manually to the checkout form or by a plugin?

    #15078 Reply

    Lee Brannon

    It may have been added by a plugin I guess? I’m using WPCommerce. In that case what would be the standard placeholder to display the coupon code on the transaction results page because then my issue would be solved?

    Many Thanks for the super fast reply. Great plugin, by the way.

    #15079 Reply


    Currently there is no placeholder for the coupon code, only for the coupon amount.
    Here’s a documentation how to add your own placeholder:

    #15080 Reply

    Lee Brannon

    Thanks Hannes.

    I added the custom placeholder code to the child theme function.php file but I’m not sure how to display the coupon code used on the invoice. I just have a line reading:

    Coupon Code: coupon_code (as that’s what I called the placeholder)

    Do you know the correct way to get the coupon code entered at checkout to show on the form?

    Thanks for all your help so far – I’m getting closer!

    #15081 Reply

    Lee Brannon

    Hi Hannes

    If it helps, I added the following code to the functions.php file:

    function register_my_shopstyling_placeholders($invoice_placeholders){
        $invoice_placeholders[] = array(
            'fieldvalue' => get_post_meta( $order->id, 'coupon_num', true),
            'fieldname'  => 'Coupon Code'
        return $invoice_placeholders;
    add_filter( 'shopstyling_editor_placeholders', 'register_my_shopstyling_placeholders');

    but I’m not sure if coupon_num is correct as the invoice still doesn’t show the coupon code. It just displays “Coupon Code: {}”

    Any ideas?

    Thanks, Lee

    #15082 Reply


    Hello Lee,
    The coupon code is not a post meta data, it’s in a custom table of wpsc WPSC_PURCHASE_LOGS and the column is called discount_data.

    #15083 Reply

    Lee Brannon

    Thanks Hannes. I will see if I can get the transaction report to display the coupon code. If I have some success I will let you know so that we can share with anyone else who needs it.

    Many Thanks

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Coupon Code not showing on Transaction Results Page
Your information: