WordPress.org

Ready to get started?Download WordPress

Forums

Pronamic iDEAL
[resolved] Use WC_Order::get_order_number() for WooCommerce order numbers (3 posts)

  1. Paul
    Member
    Posted 1 year ago #

    When the check payment email is sent for WooCommerce it includes the order ID prefixed with a # as the order number.

    To get the correct order number matching the order numbers in the order management this should be replaced with the WC_Order::get_order_number() method which by default would prepend the ID with the # and apply the woocommerce_order_number filter.

    This is how the new functions would look like:

    private static function get_check_payment_note( $order, $configuration ) {
    	// get_edit_post_link() will not work, has permissions check for current user
    	$edit_order_link = add_query_arg(
    		array(
    			'post'   => $order->id,
    			'action' => 'edit'
    		),
    		admin_url( 'post.php' )
    	);
    
    	$note = sprintf(
    		__( 'Check the payment of order %s in your <a href="%s">iDEAL dashboard</a> and <a href="%s">update the status of the order</a>.', 'pronamic_ideal' ),
    		$order->get_order_number(),
    		esc_attr( $configuration->getDashboardUrl() ),
    		esc_attr( $edit_order_link )
    	);
    
    	return $note;
    }
    private function mail_check_payment( $order, $note ) {
    	global $woocommerce;
    
    	// E-mail
    	$mailer = $woocommerce->mailer();
    
    	$message = $mailer->wrap_message(
    		__( 'Check iDEAL payment', 'pronamic_ideal' ),
    		$note
    	);
    
    	// Send the mail
    	woocommerce_mail(
    		get_option( 'woocommerce_new_order_email_recipient' ),
    		sprintf(
    			__( 'Check iDEAL payment for order %s', 'pronamic_ideal' ),
    			$order->get_order_number()
    		),
    		$message
    	);
    }

    http://wordpress.org/extend/plugins/pronamic-ideal/

  2. Remco Tolsma
    Member
    Plugin Author

    Posted 1 year ago #

  3. Paul
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic