Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 Adding validation for Gift Certificates
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jack208
VP-CART New User

Malaysia
116 Posts

Posted - December 10 2015 :  12:49:03  Show Profile  Reply with Quote
During our test for the Gift Certificate module, we notice there''s a very loosely implemented form of validation (just via Gift Cert Num) and while it''s probably good, we were thinking of something a little bit more robust that includes the GiftToEmail.

After all, if the buyer bought a gift certificate and sent that to [email protected], it would be good if webstore only allows [email protected] to use the gift certificate (and not just anyone who happens to know the gift certificate number).

Note: I think some implementation may not need this level of validation, where gift certificate numbers are freely exchangeable or shared with others. In that use case, I think the Gift Certificate module as-is works very well for you.

If you wanted to validate the GiftToEmail, here''s the changes you can made to have VPCart do that. It''ll also prevent anyone checking the gift certificate balance unless they are the GiftToEmail owner.

shopgiftdb.asp
sub ShopValidateGiftCertificate

''You need to add a local variable to store the current customer email
''Have added the SQL query to include matching GiftToEmail with customer email

dim strEmail
strEmail = GetSess("email")

''700 - 2010.05.24 - Enhancement: MsSQL with double bytes (utf8) issues
strSQL = "* FROM gifts where giftnumber="& sqlserverprefixn &"''" & replace(Gift,"''","") & "'' and gifttoemail=''" & strEmail & "''"

So far this works in our environment but a word of caution, you are playing with custom codes so if not sure about this, better to get VPASP Support to do this custom work for you.

If VPCart future releases can implement a toggle whether Gift Certificate should validate against (or not) the Gift To Email, that would be a great enhancement to have. :)
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00