Skip to main content
Inspiring
April 20, 2006
Question

4 Sessions Into One?

  • April 20, 2006
  • 3 replies
  • 552 views

I have 4 sessions for shipping on my checkout page.
1. WAEC_FlatRateUnder8Ground
2. WAEC_FlatRateOver8Ground
3. WAEC_FlatRate2ndDayAir
4. WAEC_FlatRate2ndDayAirover100

They correctly display the shipping cost. I just hide all that are empty,
one will always have a value. That's where the problem comes in because I
don't know which will have a value.

I need to pull that shipping cost that is stored in one of those 4 sessions
and I need to put it into something like another session or a table in a
database. Because I don't know which Shipping Method will be used, I can't
just assign one of the four to a shipping variable.

Any ideas how I could do this?


This topic has been closed for replies.

3 replies

Inspiring
April 21, 2006
Dim WAEC_SHIPPING

Where you "Dim" Is this what is called an "application variable"?

In Dreamweaver, I just used to "Bindings" window to add an Application
Variable (if that's what it's called) but when I placed that on the page, it
was empty

<%
Dim WAEC_SHIPPING

'Check First
If Not isEmpty(WAEC_FlatRateUnder8Ground) Then
WAEC_SHIPPING = WAEC_FlatRateUnder8Ground
End If

'Check Second
If Not isEmpty(WAEC_FlatRateOver8Ground) Then
WAEC_SHIPPING = WAEC_FlatRateOver8Ground
End If


'Check Third
If Not isEmpty(WAEC_FlatRate2ndDayAir) Then
WAEC_SHIPPING = WAEC_FlatRate2ndDayAir
End If

'Check Fouth
If Not isEmpty(WAEC_FlatRate2ndDayAirover100) Then
WAEC_SHIPPING = WAEC_FlatRate2ndDayAirover100
End If
%>
<%
if (cStr(Application("WAEC_SHIPPING")) <> "") then
Session("ssTotalShipping") = "" & cStr( Application("WAEC_SHIPPING") ) &
""
end if
%>


Participant
April 21, 2006
I would make it another Session variable. You can manually edit that dreamweaver code by the way:

<%
if (cStr(Session("WAEC_FlatRateUnder8Ground")) <> "") then
Session("ssTotalShipping") = "" & cStr( Application("FlatRateUnder8Ground") ) &
""
end if
%>

make one of those for each Session that you have:

FlatRateUnder8Ground
FlatRateOver8Ground
FlatRate2ndDayAir
FlatRate2ndDayAirover100

Inspiring
April 21, 2006
I'll try that right away...Thanks!
"Tready29483" <webforumsuser@macromedia.com> wrote in message
news:e2aer8$a01$1@forums.macromedia.com...
> Is this ASP or PHP?
>
> If it ASP declare a variable names WAEC_SHIPPING and then check each
> session
> variable to see if it empty
>
> <%
> Dim WAEC_SHIPPING
>
> 'Check First
> If Not isEmpty(WAEC_FlatRateUnder8Ground) Then
> WAEC_SHIPPING = WAEC_FlatRateUnder8Ground
> End If
>
> 'Check Second
> If Not isEmpty(WAEC_FlatRateOver8Ground) Then
> WAEC_SHIPPING = WAEC_FlatRateOver8Ground
> End If
>
>
> 'Check Third
> If Not isEmpty(WAEC_FlatRate2ndDayAir) Then
> WAEC_SHIPPING = WAEC_FlatRate2ndDayAir
> End If
>
> 'Check Fouth
> If Not isEmpty(WAEC_FlatRate2ndDayAirover100) Then
> WAEC_SHIPPING = WAEC_FlatRate2ndDayAirover100
> End If
> %>
>
> I'm not sure if thats the best way, but thats how I would do it.
>


Participant
April 21, 2006
Is this ASP or PHP?

If it ASP declare a variable names WAEC_SHIPPING and then check each session variable to see if it empty

<%
Dim WAEC_SHIPPING

'Check First
If Not isEmpty(WAEC_FlatRateUnder8Ground) Then
WAEC_SHIPPING = WAEC_FlatRateUnder8Ground
End If

'Check Second
If Not isEmpty(WAEC_FlatRateOver8Ground) Then
WAEC_SHIPPING = WAEC_FlatRateOver8Ground
End If


'Check Third
If Not isEmpty(WAEC_FlatRate2ndDayAir) Then
WAEC_SHIPPING = WAEC_FlatRate2ndDayAir
End If

'Check Fouth
If Not isEmpty(WAEC_FlatRate2ndDayAirover100) Then
WAEC_SHIPPING = WAEC_FlatRate2ndDayAirover100
End If
%>

I'm not sure if thats the best way, but thats how I would do it.