Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author MWSGD

    (@mwsgd)

    Unfortunately, it is not possible without customization. I can recommend this to development but if it is urgent, please contact us directly via email: [email protected]

    Thread Starter PaulH

    (@paulhuckstepp)

    I think i’ve found a quick way of adding it in myself:

    add_action( 'jigoshop_after_email_order_info', 'add_coupon_code_email', 10000, 1 );
    function add_coupon_code_email( $orderId ) {
    	$orderData = get_post_meta( $orderId, 'order_data', true );
    	$discounts = @$orderData->order_discount_coupons;
    	$codes = "";
    	foreach($discounts  as $discount){
    		$codes .= @$discount->code . ", ";
    	}
    	echo "Discount Code Used: $codes". PHP_EOL. PHP_EOL;
    }

    The @ are to prevent errors showing up for the moment as the site is live. Not ideal I know but the client wants the information in the order email as they don’t want to log into the admin to check on the order!

    @paulhuckstepp

    Yes, this will work as well, but I would propose you do proper checks instead of using silence operator ??

    Marking as resolved.

    Thread Starter PaulH

    (@paulhuckstepp)

    So, is my code correct? It doesn’t look like it is working and as this is a live site I can’t debug it as well as I’d like.

    The main thing I want to check is that the parameter $orderId will be passed through using the hook as I think it is.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Coupon code in admin order email’ is closed to new replies.