Viewing 1 replies (of 1 total)
  • Thread Starter mattmatt88

    (@mattmatt88)

    Found a solution. E.g. add this to your functions.php to get invoicenumbers
    NR10001
    NR10002
    NR10003

    function my_pmpro_random_code($code) {
    	global $wpdb;
    	$result = $wpdb->get_var("SELECT code FROM $wpdb->pmpro_membership_orders ORDER BY id desc LIMIT 1");
    	if ($result) {
    		$result = substr($result, 2);
    		$result = intval($result)+1;
    		$code = 'NR'.$result;
    	} else {
    		$code = 'NR10001';
    	}
    	return $code;
    }
    add_filter("pmpro_random_code", "my_pmpro_random_code");
Viewing 1 replies (of 1 total)
  • The topic ‘Create invoices numbers with a system’ is closed to new replies.