Author |
Topic |
|
jack208
VP-CART New User
Malaysia
116 Posts |
Posted - November 23 2017 : 06:22:12
|
I wanted to add some validation codes for coupons (so that''ll be some codechange in shopcoupon.asp). The validation requires a field from Customer table eg custother1.
Is there a session variable for this field that I can just use a GetSess command to pull into a local variable for comparison in shopcoupon.asp? I only need to read this field and won''t be updating it so if there''s a sess var, this should work for me.
If not, anyone know where is the SUB when VPCart reads from the customer table and sets to sess vars? I might be able to do the SetSess assignment there.
Thanks. |
|
diegomilito
VP-CART Expert
Argentina
779 Posts |
Posted - November 24 2017 : 01:50:58
|
from what my previous work i think there is no such GetSess for the custother1l i ever worked on PIN number (file shoppinformat.asp) and inside has routine very similar to what you are currently requesting
sub Pinvalidatecustomer (customerid, rc) dim rs, sql dim custother1 custother1 = "" sql = "* from customers where contactid=" & customerid Set rs = Server.CreateObject("ADODB.Recordset") rs.open sql, dbc, adOpenDynamic, adLockOptimistic if not rs.eof then custother1 = rs("custother1") if isnull(custother1) then custother1 = "" end if end if rs.close set rs = nothing if custother1 = "" then rc = 4 else rc = 0 end if end sub
how about you try to apply the same logical above into your coupon related files ?? i think there is a way from PIN logic, but i wish you good luck. diego |
|
|
jack208
VP-CART New User
Malaysia
116 Posts |
Posted - December 03 2017 : 02:05:50
|
Thanks Diego for the code share.
We decided to implement this differently ie custom the code to include CustOther1 as part of the Session variables. This way we can just use a simple GetSess to pull the field to check. And we can also now easily reference CustOther1 in other codes for other validation.
Those wanting to do this (include fields into Session vars), here''s the list of subs you need to change, and they are all found in shop$db.asp
- GetCustomerSEssionData - UpdateCustomerSessionData - LocateCustomerData - ResetCustomerSessionData
|
|
|
|
Topic |
|