Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support anjitha21

    (@anjitha21)

    Hi @emmaswl

    We will check if it is possible to do via customization.

    Could you please let us know whether you’re using the default WooCommerce coupon functionality or a third-party plugin to generate the coupon codes?

    Looking forward for your reply.

    Thread Starter emmaswl

    (@emmaswl)

    Hi there, I am using both but primarily I need it to show the default WooCommerce coupons

    Thanks,
    Emma

    Plugin Support anjitha21

    (@anjitha21)

    Hi @emmaswl

    Thank you for the information.

    You can use the below filter to show the coupon code in delivery notes:

    add_filter( 'wcdn_order_info_fields', function( $fields, $order ) {
    $coupons = $order->get_coupon_codes();

    if ( ! empty( $coupons ) ) {
    $fields['coupon_code'] = array(
    'label' => __( 'Coupon', 'woocommerce-delivery-notes' ),
    'value' => implode( ', ', $coupons ),
    );
    }

    return $fields;
    }, 10, 2 );

    Please add this filter in your theme’s function.php file or via Code Snippets plugin.

    Let us know if there are any further issues.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.