Print Page | Close Window

Remove 0,O,1,l from Gift Cert Generator?

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Using ProductCart
Forum Description: Running your store with ProductCart
URL: https://forum.productcart.com/forum_posts.asp?TID=5113
Printed Date: 29-March-2024 at 8:42am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Remove 0,O,1,l from Gift Cert Generator?
Posted By: TrekLightGear
Subject: Remove 0,O,1,l from Gift Cert Generator?
Date Posted: 30-April-2012 at 1:15pm
Hi -

I thought I remembered a post on this a long while back but have been unable to find the answer in the forum or Wiki.  I'd like to continue using ProductCart's built-in Gift Certificate code generator but I want to prevent it from including commonly confused characters like 0,O and 1,l.   

Can anyone tell me the easiest way to modify DefaultGiftCode.asp to prevent these characters from being included in the random generator?

Thanks!


-------------
Seth Haber



Replies:
Posted By: Guests
Date Posted: 04-May-2012 at 10:38pm
You should be able to simply find:
    CharacterSetArray = Array( _
      Array( 10, "abcdefghijklmnopqrstuvwxyz" ), _
      Array( 5, "0123456789" ) _
and change that to:
   CharacterSetArray = Array( _
      Array( 10, "abcdefghijkmnpqrstuvwxyz" ), _
      Array( 5, "23456789" ) _


Posted By: TrekLightGear
Date Posted: 07-May-2012 at 4:19pm
Thanks Sean.  I'm on v4.1a SP2 still and my code appears differently:

'--- Start Generating Gift Code - This is just SAMPLE CODE
                Tn1=""
                For w=1 to CodeStrLen
                    Randomize
                    myC=Fix(3*Rnd)
                    Select Case myC
                        Case 0:
                        Randomize
                        Tn1=Tn1 & Chr(Fix(26*Rnd)+65)
                        Case 1:
                        Randomize
                        Tn1=Tn1 & Cstr(Fix(10*Rnd))
                        Case 2:
                        Randomize
                        Tn1=Tn1 & Chr(Fix(26*Rnd)+97)       
                    End Select
                Next
'--- Finish Generating GiftCode   

'--- END OF GIFT CERTIFICATE CODE GERNERATOR

Thoughts?


-------------
Seth Haber


Posted By: Guests
Date Posted: 07-May-2012 at 10:00pm
I see.

The code here is much friendlier in 4.5.

PM me and I'll get you ironed out on this.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net