• Resolved adxp

    (@psychosis51)


    Hi.

    The plugin is not outputting the Gift Card Code in the ‘Order Completed’ email:
    https://ibb.co/bgXLBt6

    When we use the ‘Preview Emails’ plugin, it’s displayed, but not in the actual email sent to the customer.

    How do we resolve this?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi there,
    hope you are doing well! ??

    Could you check if the problem is solved by adding the next code in the functions.php of your active theme, please?

    if(!function_exists('show_gift_card_code_on_email')) {
        function show_gift_card_code_on_email($order_item_id, $item, $order)
        {
            $code = wc_get_order_item_meta($order_item_id, '_ywgc_gift_card_number');
    
            if (!empty($code)) {
    
                printf('<br>' . __('Gift card code: %s', 'yith-woocommerce-gift-cards'), $code);
            }
        }
    
        add_action('woocommerce_order_item_meta_start', 'show_gift_card_code_on_email', 10, 3);
    }

    Let us know any news, please.

    Have a nice day!

    Thread Starter adxp

    (@psychosis51)

    @yithemes
    Thank you for the suggestion.

    But it didn’t work I’m afraid.

    It still doesn’t output the code in the order Completed email:
    https://ibb.co/r3dtpPX

    Thread Starter adxp

    (@psychosis51)

    @yithemes Can we please have an update on this?
    The customers are ordering Gift Cards, but they do not receive them.
    This is a serious issue at the moment.

    How can we overcome this?
    Your input will be truly appreciated!

    Thread Starter adxp

    (@psychosis51)

    @yithemes
    We managed to resolve by downgrading WooCommerce to 4.3.2 and Gift Cards to 1.1.0.

    Is there an incompatibility with the latest Woo and Gift Card plugins?

    • This reply was modified 3 years, 11 months ago by adxp.
    Plugin Author YITHEMES

    (@yithemes)

    Hello there,

    hope you are doing well ??

    Sorry, there was a little error in the previous code when retrieving the gift card code. Could you try with the following one with the latest version of Gift Cards, please?

    if ( ! function_exists( 'show_gift_card_code_on_email' ) ) {
    	function show_gift_card_code_on_email( $order_item_id, $item, $orde ) {
    		$code = wc_get_order_item_meta( $order_item_id, '_ywgc_gift_card_code', true );
    
    		if ( ! empty( $code ) ) {
    			printf( '<br>' . __( 'Gift card code: %s', 'yith-woocommerce-gift-cards' ), $code[0] );
    		}
    	}
    
    	add_action( 'woocommerce_order_item_meta_start', 'show_gift_card_code_on_email', 10, 3 );
    }

    Let us know any news, please.

    Have a nice day!

    Plugin Author YITHEMES

    (@yithemes)

    Hi there,

    Due to inactivity, we will mark the topic as solved but feel free to open a new one if you have any other issues.

    If you enjoy our support, we will really appreciate if you can leave us a review and a five stars rating -> https://www.ads-software.com/support/plugin/yith-woocommerce-gift-cards/reviews/

    Many thanks and have a nice day!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Gift card code doesn’t show up in the ‘Completed Order’ email.’ is closed to new replies.