Support » Plugin: Coupon Generator for WooCommerce » MODIFICATION KOD COUOP

  • Hello i want have codes coupons OPEN 0001 to OPEN 5000. The first I start edit code but it’s not work. Can you help me add space after the word “open”

    function wccg_get_random_coupon() {
    
    	// Generate unique coupon code
    	
    	$random_coupon = 'OPEN';
    	$length        = 4;
    	$charset       = '0123456789';
    	$count         = strlen( $charset );
    
    	while ( $length-- ) {
    		$random_coupon .= $charset[ mt_rand( 0, $count-1 ) ];
    	}
    
    	$random_coupon = implode( '', str_split( strtoupper( $random_coupon ), ) );
    
    	// Ensure coupon code is correctly formatted
    	$coupon_code = apply_filters( 'woocommerce_coupon_code', $random_coupon );
    
    	return $coupon_code;
    }
  • The topic ‘MODIFICATION KOD COUOP’ is closed to new replies.