Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Suggestions for future release
 Free shipping field added to products table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Superal
VP-CART Expert

Canada
542 Posts

Posted - January 28 2003 :  12:25:54  Show Profile  Reply with Quote
Add a boolean field to products for shipping costs for none or yes. This is in many other carts. Better than zero weight.

StevenWWinters
Starting Member

47 Posts

Posted - March 05 2004 :  08:16:32  Show Profile  Reply with Quote
I need to do something like this (per product "No Shipping") Has anyone written any code to do it yet, or should I start from scratch?

Thanks!

Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - March 06 2004 :  13:51:27  Show Profile  Visit devshb's Homepage  Reply with Quote
I did this, but in a bit of a bodged/temporary way because we were in a hurry and just wanted a quick fix. Ideally, you'd want to do what superal says (adding a new flag to the products table to say yes/no shipping, and then having the shipping/calc functions use that flag).

If you want a quick solution (which could easily be changed later on to use a new column), then the following might be helpful - this is what I did to force no-shipping for all products which have product codes that start with "PACK" or have a product code of "FF" - you could use similar logic, and, say, for all your non-shipping products give them a code starting with "N" (for no-shipping) and then checking the leftmost character in the same way that I'm checking the left4 characters......

Unless I've made an error, what this should be doing is checking if ALL items in the cart have no-shipping, if they do all have no-shipping, then zero is used for the shipping amt, but if any of them have NO-no-shipping, then the normal shipping amt is used....

(if you do this, make sure you take backup copies of the changed files beforehand!).....

1. in shop$db.asp, added a new function:


Function FuCheckNonShipping()
Dim i
Dim scartItem
Dim arrCart
Dim thiscode
Dim thisnoship
Dim shipflag
shipflag="N"
scartItem=GetSess("CartCount")
arrCart=GetSessA("CartArray")
for i=1 to scartItem
thiscode=arrCart(cProductCode,i)
if (Left(UCase(thiscode),4)="PACK" or UCase(thiscode)="FF") then
thisnoship="Y"
else
thisnoship="N"
shipflag="Y"
end if
next
FuCheckNonShipping=shipflag
End Function



2. in shop$db.asp in the ShopAddOrder function:

added the following lines just after:
dim newdate, newtime
dim ipaddress
....:

Dim thisshipcost
if (FuCheckNonShipping()="N") then
thisshipcost=0
else
thisshipcost=GetSess("smprice")
end if

in the same function,
change:
updatefield "oshipcost",getsess("smprice")

to:
updatefield "oshipcost",thisshipcost


3. in shopcartformat.asp:

in the CartFormat function, add the following lines just after
If Cartremove<>"" then
CartSpecialHandling
end if
.......:

if (FuCheckNonShipping()="N") then
CartShipCost=0
else
CartShipCost=GetSess("smprice")
end if

Edited by - devshb on March 06 2004 13:55:53
Go to Top of Page

StevenWWinters
Starting Member

47 Posts

Posted - March 11 2004 :  14:24:21  Show Profile  Reply with Quote
Thanks. I'll take a look at that.

Is there any reason not to just add the field???

Steven...

Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - March 11 2004 :  17:38:19  Show Profile  Visit devshb's Homepage  Reply with Quote
well, with hindsight, it would have been better to have added the field I guess. but then you'd need to change the cart-session stuff to populate the field/variable/session, and we were in a hurry so just did a quick-fix.

Go to Top of Page

support
Administrator

4679 Posts

Posted - March 11 2004 :  18:49:25  Show Profile  Visit support's Homepage  Reply with Quote
This facility will be in 5.50. Because we have over 15 shipping algorithms it is not a trivial chnage to support this in every situation.

VP-ASP Support

Go to Top of Page

StevenWWinters
Starting Member

47 Posts

Posted - March 12 2004 :  05:22:02  Show Profile  Reply with Quote
Thanks for the update. Now for the obvious: Is there any info on expected release date (quarter/year even), other changes that will be included, cost to upgrade???

Steven...

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00