• Resolved nat@cry

    (@natcry)


    Hello, Great plugin which is helping us capture Gift Aid on PayPal checkouts. Is there a way to add the yes/no to the emails sent to customers and us as a vendor?

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Anonymous User 13665966

    (@anonymized-13665966)

    Hello!

    I suspect you may have stumbled upon a bug in the plugin, as it supports adding a simple Gift Aid status message in the order emails.

    Could you confirm your WordPress, WooCommerce and Gift Aid for WooCommerce versions for me?

    Thanks,
    Dave

    Thread Starter nat@cry

    (@natcry)

    Hi Dave

    Wordpress: 4.7.2
    Woocommerce: 2.6.14
    Gift aid for Woocommerce: 1.2.4

    We are using custom templates for the emails, would this affect it?

    Kind regards
    Nat

    Anonymous User 13665966

    (@anonymized-13665966)

    Hey Nat,

    That could be the problem. If you’re overriding the template and it doesn’t have a do_action( 'woocommerce_email_before_order_table' ); in it then the Gift Aid status won’t be added.

    Could you paste that template in as code here, or send me an email with it in a text file attachment to [email protected]?

    Thanks,
    Dave

    Thread Starter nat@cry

    (@natcry)

    Hi Dave
    I think that is in there (admin email below)

    <?php
    /**
     * Admin new order email
     *
     * @author WooThemes
     * @package WooCommerce/Templates/Emails/HTML
     * @version 2.0.0
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly
    }
    
    ?>
    
    <?php do_action( 'woocommerce_email_header', $email_heading ); ?>
    
    <p><?php printf( __( 'You have received an order from %s. The order is as follows:', 'woocommerce' ), $order->billing_first_name . ' ' . $order->billing_last_name ); ?></p>
    
    <?php do_action( 'woocommerce_email_before_order_table', $order, true, false ); ?>
    
    <h2><a href="<?php echo admin_url( 'post.php?post=' . $order->id . '&action=edit' ); ?>"><?php printf( __( 'Order #%s', 'woocommerce'), $order->get_order_number() ); ?></a> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( wc_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2>
    
    <table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
    	<thead>
    		<tr>
    			<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php _e( 'Product', 'woocommerce' ); ?></th>
    			<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php _e( 'Quantity', 'woocommerce' ); ?></th>
    			<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php _e( 'Price', 'woocommerce' ); ?></th>
    		</tr>
    	</thead>
    	<tbody>
    		<?php echo $order->email_order_items_table( false, true ); ?>
    	</tbody>
    	<tfoot>
    		<?php
    			if ( $totals = $order->get_order_item_totals() ) {
    				$i = 0;
    				foreach ( $totals as $total ) {
    					$i++;
    					?><tr>
    						<th scope="row" colspan="2" style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
    						<td style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
    					</tr><?php
    				}
    			}
    		?>
    	</tfoot>
    </table>
    
    <?php do_action( 'woocommerce_email_after_order_table', $order, true, false ); ?>
    
    <?php do_action( 'woocommerce_email_order_meta', $order, true, false ); ?>
    
    <?php do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text ); ?>
    
    <?php do_action( 'woocommerce_email_footer' ); ?>
    

    Thanks
    Nat

    Anonymous User 13665966

    (@anonymized-13665966)

    Thanks Nat. Leave it with me and I’ll get back to you today/tomorrow!

    Thread Starter nat@cry

    (@natcry)

    Fantastic, thank you so much for this Dave!

    Thread Starter nat@cry

    (@natcry)

    Hi Dave

    Any update on the email?
    Kind regards
    Nat

    Anonymous User 13665966

    (@anonymized-13665966)

    Hi @nat,

    I’m so sorry, I thought I’d replied to this weeks ago!

    The plugin is adding the line to both the customer and admin mail fine after testing locally and on a live server, so I’m not too sure about this.

    I’ve actually just completed a full re-factor of the plugin behind the scenes and I’ll be pushing the newly refactored version over the next few days. I’ll use your custom template that you pasted above to see if I can replicate.

    Cheers,
    Dave

    Anonymous User 13665966

    (@anonymized-13665966)

    Hi @natcry,

    I’ve tested the latest version of the plugin with your template, and it’s not adding Gift Aid so it’s definitely the template override causing this issue.

    WooCommerce 2.5.0 introduced a newer version of that template, so I recommend that you update the template to use the newer version. Any custom code that you’ve added to the template probably needs debugging as well.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Gift Aid in the emails’ is closed to new replies.