ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Using ProductCart
  New Posts New Posts RSS Feed - Remove 0,O,1,l from Gift Cert Generator?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

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

 Post Reply Post Reply
Author
Message
TrekLightGear View Drop Down
Newbie
Newbie


Joined: 24-April-2007
Location: Boulder, CO
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote TrekLightGear Quote  Post ReplyReply Direct Link To This Post Topic: Remove 0,O,1,l from Gift Cert Generator?
    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
Back to Top
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post 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" ) _
Back to Top
TrekLightGear View Drop Down
Newbie
Newbie


Joined: 24-April-2007
Location: Boulder, CO
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote TrekLightGear Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.