close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Free Shipping for a particular item

Thread began 6/17/2010 2:47 pm by Armen | Last modified 6/22/2010 4:36 pm by Eric Mittman | 2047 views | 7 replies |

Armen

Free Shipping for a particular item

I'm using: DW CS4, eCart 4.5.2, VBScript/ASP/MS SQL

How do i set one particular item to free shipping? This item will be shipped free while everything else will have its shipping calculated normally based on weight. I currently have everything being calculated based on weight and need to offer free shipping on a 'special' item.

Sign in to reply to this post

Eric Mittman

If the shipping is only based on weight then you could make sure the product does not have a weight associated with it to avoid having shipping charged for it.

Sign in to reply to this post

Armen

UPS does not allow the shipping (or looking up the pricing for) an item with a weight of zero.

Sign in to reply to this post

Eric Mittman

If the only item in the cart has no weight associated with it you will have this problem. To get around this you can add in an extra condition to the shipping server behavior on your confirm page. You would want to check the total of the total weight column being greater than 0. If you can post back with the page in question minus any sensitive details I can show you an example of what I mean.

Sign in to reply to this post

Armen

<%
if (Request.ServerVariables("Request_Method") = "POST") then
'WA eCart (Copyright 2007, WebAssist)
'WA eCart UPS Shipping - UPS
Dim Shipping_SuccessURL, Shipping_FailureURL, Shipping_Packaging, Shipping_PackageIndex, Shipping_Counter, Shipping_Parameters, Shipping_SubPackage, Shipping_PackageArray
set Shipping_Parameters = new WA_eCart_UPS_Parameters
set Shipping_SubPackage = new WA_eCart_UPS_Package
Shipping_SuccessURL = ""
Shipping_FailureURL = "shipping_failure.asp"
Shipping_Packaging = 0
Shipping_PackageArray = Array()
Shipping_PackageIndex = 0
Shipping_Counter = 0
Shipping_Parameters.ShiptoCity = "" & cStr(Request.Form("shipping_city")) & ""
Shipping_Parameters.ShiptoState = "" & cStr(Request.Form("shipping_state_province")) & ""
Shipping_Parameters.ShiptoZip = "" & cStr(Request.Form("shipping_postcode")) & ""
Shipping_Parameters.ShiptoCountry = "" & cStr(Request.Form("shipping_country")) & ""
Shipping_Parameters.UserID = ""
Shipping_Parameters.Password = ""
Shipping_Parameters.AccessKey = ""
Shipping_Parameters.CarrierCode = ""
Shipping_Parameters.PickupType = ""
Shipping_Parameters.CustomerClass = ""
Shipping_Parameters.ShipperNumber = ""
Shipping_Parameters.ShipperCity = ""
Shipping_Parameters.ShipperState = ""
Shipping_Parameters.ShipperZip = ""
Shipping_Parameters.ShipperCountry = "US"
while ((Shipping_Packaging = 1 AND not WA_eCart_EOF(neoCart)) OR (Shipping_Packaging = 0 AND Shipping_Counter = 0))
if (WA_eCart_UPS_IsTrueValue("true")) then
ReDim Preserve Shipping_PackageArray(Shipping_PackageIndex+1)
set Shipping_SubPackage = new WA_eCart_UPS_Package
if (Shipping_Packaging = 1) then
Shipping_SubPackage.eCart_Quantity = WA_eCart_DisplayInfo(neoCart, "Quantity")
else
Shipping_SubPackage.eCart_Quantity = 1
end if
Shipping_SubPackage.IsPackage = "true"
Shipping_SubPackage.Quantity = "1"
Shipping_SubPackage.WeightUnits = "LBS"
Shipping_SubPackage.PackageWeight = "" & cStr(WA_eCart_DisplayInfo(neoCart, "TotalWeight")) & ""
Shipping_SubPackage.PackageType = "02"
Shipping_SubPackage.SizeUnits = "IN"
Shipping_SubPackage.PackageLength = "12"
Shipping_SubPackage.PackageWidth = "12"
Shipping_SubPackage.PackageHeight = "8"
'Special Services
set Shipping_PackageArray(Shipping_PackageIndex) = Shipping_SubPackage
Shipping_PackageIndex = Shipping_PackageIndex+1
end if
Shipping_Counter = Shipping_Counter + 1
if (Shipping_Packaging = 1) then
set neoCart = WA_eCart_MoveNext(neoCart)
end if
wend
if (Shipping_Packaging = 1) then
set neoCart = WA_eCart_MoveFirst(neoCart)
end if
Shipping_Result = WA_eCart_UPS_GetRateQuote(neoCart, Shipping_Parameters, Shipping_PackageArray)
if (Shipping_Result) then
if (Shipping_SuccessURL <> "") then
neoCart_redirStr = Shipping_SuccessURL
end if
elseif (Shipping_FailureURL <> "") then
Response.Redirect(Shipping_FailureURL)
end if
elseif (cStr(Session("neoCart_UPS_Success")) = "") then
WA_eCart_UPS_SetSessionDefaults(neoCart)
end if
%>
<%
if (Request.ServerVariables("Request_Method") = "POST") then
Session("eCartCheckoutForm_shipping_country") = "" & cStr(Request.Form("shipping_country")) & ""
end if
%>
<%


if (Request.ServerVariables("Request_Method") = "POST") then
Session("eCartCheckoutForm_shipping_postcode") = "" & cStr(Request.Form("shipping_postcode")) & ""
end if
%>
<%



if (Request.ServerVariables("Request_Method") = "POST") then
Session("eCartCheckoutForm_shipping_state_province") = "" & cStr(Request.Form("shipping_state_province")) & ""
end if
%>

Sign in to reply to this post

Eric Mittman

In the code that you posted you will want to add an if statement around the shipping quote server behavior like this:

<%
if (WA_eCart_TotalColumn(neoCart, "TotalWeight") > 0) then
%>
<%
if (Request.ServerVariables("Request_Method") = "POST") then
***server behavior code here***
end if
%>
<%
end if
%>
Sign in to reply to this post

Armen

I added the code and it works when the only item in the cart is the one with the free shipping (item weight of zero). When I add another item to the cart and and attempt to checkout, I get an error message from the UPS quote: No Packages to Ship

Sign in to reply to this post

Eric Mittman

The code that I added should only skip over the server behavior if there are no items with a weight in the cart. If you are getting an error it means that the server behavior is being triggered so it seems that there might be another issue occurring in the server behavior. Have you tried this out with a few different items by themselves and together to see if you get this same result?

If you are getting it regularly then you should add in the USPS full request and full response to your failure page that you are getting to. These should be available to you in the bindings tab, just drag and drop them onto the page. If you have any trouble with the info that you get post back with the details so we can look into it with you.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...