Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

4 Sessions Into One?

LEGEND ,
Apr 20, 2006 Apr 20, 2006

Copy link to clipboard

Copied


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?


TOPICS
Server side applications

Views

474
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 21, 2006 Apr 21, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2006 Apr 21, 2006

Copy link to clipboard

Copied

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.
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2006 Apr 21, 2006

Copy link to clipboard

Copied

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
%>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 21, 2006 Apr 21, 2006

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2006 Apr 21, 2006

Copy link to clipboard

Copied

I just don't think there is anything in this dim WAEC_SHIPPING. Does it need
to have quotes around it?

<%
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
%>

"Tready29483" <webforumsuser@macromedia.com> wrote in message
news:e2ao4a$ln8$1@forums.macromedia.com...
>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
>
>
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2006 Apr 21, 2006

Copy link to clipboard

Copied

I just realized that it doesn't need quotes around the dim name.

"lee" <lfairban_nospam@amep.com> wrote in message
news:e2autc$12e$1@forums.macromedia.com...
>I just don't think there is anything in this dim WAEC_SHIPPING. Does it
>need to have quotes around it?
>
> <%
> 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
> %>
>
> "Tready29483" <webforumsuser@macromedia.com> wrote in message
> news:e2ao4a$ln8$1@forums.macromedia.com...
>>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
>>
>>
>>
>
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2006 Apr 21, 2006

Copy link to clipboard

Copied


I think it's taking the last one in the list and using that one.


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 21, 2006 Apr 21, 2006

Copy link to clipboard

Copied

you seem really new to asp. May I suggest www.w3schools.com/asp read up on asp and you might find some answers.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2006 Apr 21, 2006

Copy link to clipboard

Copied

I've been working with asp for "years" and I've been through w3...it won't
help. I'm NOT a programmer nor have I had ANY formal training in ASP...
never will. I'm an artist doing programming. That's where it's at.

I do appreciate your help but I just have a tangled mess in this page that
doesn't want to work. What you layed out for me, it seems, should have
worked.

"Tready29483" <webforumsuser@macromedia.com> wrote in message
news:e2b1q0$4n3$1@forums.macromedia.com...
> you seem really new to asp. May I suggest www.w3schools.com/asp read up
> on asp and you might find some answers.


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2006 Apr 21, 2006

Copy link to clipboard

Copied


I know this looks a little different but I eliminated all but the one that
had a session that had a value "Check 1" had a value of 7.95...the others 0

<% 'Check 1
if (cStr(Session("ssflatRateUnder8")) <> "") then
Session("ssTotalShipping") = "" & cStr( Session("ssflatRateUnder8") ) & ""
end if
%>

It showed up. If the person chooses a flat rate and has under 8 products,
the ssflatRateUnder8 rule applies.

As soon as I add the other 3, below, it sets the value from "check 4"

<% 'Check 2
if (cStr(Session("ssflatRateOver8")) <> "") then
Session("ssTotalShipping") = "" & cStr( Session("ssflatRateOver8") ) & ""
end if
%>
<% 'Check 3
if (cStr(Session("WAEC_FlatRate2ndDayAir")) <> "") then
Session("ssTotalShipping") = "" & cStr( Session("ss2ndDayUnder") ) & ""
end if
%>
<% 'check 4
if (cStr(Session("ss2ndDayOver")) <> "") then
Session("ssTotalShipping") = "" & cStr( Session("ss2ndDayOver") ) & ""
end if
%>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2006 Apr 21, 2006

Copy link to clipboard

Copied

LATEST
<% 'set 1
if (cStr(WAEC_FlatRateOver8Ground()) <> "") then
Session("ssflatRateOver8") = "" & cStr(WAEC_FlatRateOver8Ground()) & ""
end if
%>
<%'set 2
if (cStr(WAEC_FlatRateUnder8Ground()) <> "") then
Session("ssflatRateUnder8") = "" & cStr(WAEC_FlatRateUnder8Ground()) & ""
end if
%>
<% 'set 3
if (cStr(WAEC_FlatRate2ndDayAir()) <> "") then
Session("ss2ndDayUnder") = "" & cStr(WAEC_FlatRate2ndDayAir()) & ""
end if
%>
<% 'set 4
if (cStr(WAEC_FlatRate2ndDayAirover100()) <> "") then
Session("ss2ndDayOver") = "" & cStr(WAEC_FlatRate2ndDayAirover100()) & ""
end if
%>
<% 'Check 1
if (cStr(Session("ssflatRateUnder8")) <> "") then
Session("ssTotalShipping") = "" & cStr( Session("ssflatRateUnder8") ) & ""
end if
%>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines