Author |
Topic |
|
Lori Titus
VP-CART New User
144 Posts |
Posted - November 22 2017 : 17:40:46
|
Just upgraded to v8. In the past, I renamed Handling to Insurance, and used HK Prog''s shipping program at checkout. He had a slight modification so that any USPS orders had handling(aka "Insurance") to the order, but UPS and pickup orders did not.
In v8, I''m using Ajax and onepagecheckout. I THINK I need to modify shophandling, but I don''t know the exact syntax to use. It should be something along the lines below, but.......anyone have any insights?
sub CalculateHandling (subtotal, total, shippingcost, handling) dim oshiphandlingtype
Handling = 0 If Instr(1,(oshiphandlingtype),"USPS")<>0 then if GetConfig("xhandlingPrice")<>"" then Handling = GetConfig("xhandlingPrice") end if if GetConfig("xhandlingbyproduct")<>"" then Calculatehandlingbyproduct handling end if end if
end sub
The Internet''s #1 supplier of honey and beeswax. |
|
diegomilito
VP-CART Expert
Argentina
779 Posts |
Posted - November 24 2017 : 01:42:20
|
maybe something like
sub CalculateHandling (subtotal, total, shippingcost, handling) if GetSess("shipmethod") = "pickup orders" or if instr(lcase(GetSess("shipmethod")),"ups") > 0 then exit sub
...... ...... ..... End Sub
Try my experience code above tell me how you get ?? diego |
|
|
diegomilito
VP-CART Expert
Argentina
779 Posts |
Posted - November 24 2017 : 01:44:13
|
sorry typo in my previous reply
try with
sub CalculateHandling (subtotal, total, shippingcost, handling) if (GetSess("shipmethod") = "pickup orders") or (instr(lcase(GetSess("shipmethod")),"ups") > 0) then exit sub
...... ...... ..... End Sub
diego |
|
|
Lori Titus
VP-CART New User
144 Posts |
Posted - November 25 2017 : 23:22:42
|
Thanks! This put me down the right path. I have multiple shiproutines that can create free shipping. (Pickup in the office, free shipping to APO, plus periodic sales where we offer "free shipping". So I was looking for something that would calculate handling only if USPS was picked as a shipping option.
I came up with:
if (shippingcost = 0) or isnull(shippingcost) or (instr(lcase(GetSess("shipmethod")),"ups") > 0) then exit sub
(I suspect there is a way to say if (instr(lcase(GetSess("shipmethod")),"usps") >0 then * * end if exit sub but I wasn''t getting the syntax quite right, it kept returning errors. I understand the logic, I''m just not a coder.)
The Internet''s #1 supplier of honey and beeswax. |
|
|
|
Topic |
|