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
Sean@WMS View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers
Avatar

Joined: 26-April-2009
Location: United States
Status: Offline
Points: 103
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sean@WMS 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" ) _
Web Merchant Services
Add-Ons | Stores
Design, Development, Hosting, SEO...
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
Sean@WMS View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers
Avatar

Joined: 26-April-2009
Location: United States
Status: Offline
Points: 103
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sean@WMS 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.
Web Merchant Services
Add-Ons | Stores
Design, Development, Hosting, SEO...
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.152 seconds.