What's Here?
Members: 132,461
Replies: 471,243
Topics: 73,062
Snippets: 2,540
Tutorials: 665
Total Online: 1,374
Members: 92
Guests: 1,282
Who's Online?
Loading. Please Wait...
SpaceMan
28 Feb, 2005 - 12:52 PM
D.I.C Regular
Joined: 20 Feb, 2003
Posts: 270
i got most it t work, but one does not. baffeled. tryed so many things.
2 work, one does not.
works,
$Adult_Tickets == $Adult_coupons
$Adult_Tickets < $Adult_coupons
but the other one, have tryed greater, lesser, nothing seems to make a difference.
$Adult_coupons < $Adult_Tickets
also tryed,
$Adult_Tickets > $Adult_coupons
just need it to change the display,
if $Adult_coupons == $Adult_Tickets
display no options to add coupons
if $Adult_coupons < $Adult_Tickets
display options to add coupons
if $Adult_coupons > $Adult_Tickets
dispaly error
CODE
if ($iteminfo[title] == "Adult Ticket" && $incart[quantity][$i] > "0" ){ global $Adult_Ticket, $get_coupons, $incart, $Adult_Tickets, $Adult_coupons, $Adult_coupon, $at; for($at = 1; $at < $incart[quantity][$i]+1; $at++) $Adult_Tickets[] = $Adult_Ticket['.$at.']; $get_coupons .= "Adult_Ticket? $Adult_Tickets<br>"; } if ($iteminfo[title] == "Adult Coupon" && $incart[quantity][$i] > "0" ){ global $Adult_Ticket, $get_coupons, $incart, $Adult_Tickets, $Adult_coupons, $Adult_coupon, $ac; for($ac = 1; $ac < $incart[quantity][$i]+1; $ac++) $Adult_coupons[] = $Adult_coupon['.$ac.']; $get_coupons .= "Adult_coupons? $Adult_coupons<br>"; } if ($Adult_Tickets == $Adult_coupons){ global $Adult_Ticket, $get_coupons, $incart, $Adult_Tickets, $Adult_coupons, $Adult_coupon, $ac, $at; $get_coupons .= "Adult_Tickets = Adult_coupons<br>"; } elseif ($Adult_Tickets < $Adult_coupons){ global $Adult_Ticket, $get_coupons, $incart, $Adult_Tickets, $Adult_coupons, $Adult_coupon, $ac, $at; $get_coupons .= "Adult_Tickets < Adult_coupons<br>"; } else { if ($Adult_coupons < $Adult_Tickets){ global $Adult_Ticket, $get_coupons, $incart, $Adult_Tickets, $Adult_coupons, $Adult_coupon, $ac, $at; $get_coupons .= "Adult_coupons < Adult_Tickets<br>"; }}
This post has been edited by SpaceMan : 28 Feb, 2005 - 12:57 PM
SpaceMan
28 Feb, 2005 - 01:27 PM
D.I.C Regular
Joined: 20 Feb, 2003
Posts: 270
QUOTE(Amadeus @ Feb 28 2005, 02:21 PM)
echo the values of $Adult_Coupon and $Adult_Ticket to the screen...what are they?
depends how many in the cart.
if 2 tickets looks like,
$Adult_Tickets[2]
SpaceMan
28 Feb, 2005 - 01:34 PM
D.I.C Regular
Joined: 20 Feb, 2003
Posts: 270
QUOTE(Amadeus @ Feb 28 2005, 02:31 PM)
but the values of $Adult_Coupon and $Adult_Ticket are numbers, right? their values are not being modified somewhere?
i did just change,
for($at = 1; $at < $incart[quantity][$i]+1; $at++)
$Adult_Tickets = "$at";
display only the number, if 2 in cart, dispalys 2
does same thing, 2 work, one does not.
as far as i know , no modifaction of the numbers.
is not much to this funtion, you see most of it.
starts out,
parsecart();
for ($i = 0; $i < $cart[total_items]; $i++) {
$thisid = $incart[items][$i];
$quantity[$i] = $incart[quantity][$i];
$iteminfo = iteminfo($thisid);
i did at for adult ticket, and ac for adult coupon to keep them for getting confused else were.
This post has been edited by SpaceMan : 28 Feb, 2005 - 01:38 PM
SpaceMan
28 Feb, 2005 - 02:30 PM
D.I.C Regular
Joined: 20 Feb, 2003
Posts: 270
QUOTE(Amadeus @ Feb 28 2005, 02:53 PM)
Try
CODE
$Adult_Tickets += $at;
displays different number then actually in the cart,
wich is ok as long as the comparison between the 2 works,
but same results.
Amadeus
28 Feb, 2005 - 03:28 PM
g++ -o drink whiskey.cpp
Joined: 12 Jul, 2002
Posts: 12,173
Thanked 33 times
Dream Kudos: 25
My Contributions
Hmm...there does not seem to be a problem with the syntax...but I've relooked at your code again from up top, and you don't actually need that if statement at all...it is the only reamaining condition, so you should just be able to use the else.
CODE
if ($Adult_Tickets == $Adult_coupons){ global $Adult_Ticket, $get_coupons, $incart, $Adult_Tickets, $Adult_coupons, $Adult_coupon, $ac, $at; $get_coupons .= "Adult_Tickets = Adult_coupons<br>"; } elseif ($Adult_Tickets < $Adult_coupons){ global $Adult_Ticket, $get_coupons, $incart, $Adult_Tickets, $Adult_coupons, $Adult_coupon, $ac, $at; $get_coupons .= "Adult_Tickets < Adult_coupons<br>"; } else { global $Adult_Ticket, $get_coupons, $incart, $Adult_Tickets, $Adult_coupons, $Adult_coupon, $ac, $at; $get_coupons .= "Adult_coupons < Adult_Tickets<br>"; }
Try that.
And my apologies from before, the earlier line of code I gave you should have read
CODE
$Adult_Tickets = $at;
SpaceMan
28 Feb, 2005 - 04:04 PM
D.I.C Regular
Joined: 20 Feb, 2003
Posts: 270
QUOTE(Amadeus @ Feb 28 2005, 04:28 PM)
Hmm...there does not seem to be a problem with the syntax...but I've relooked at your code again from up top, and you don't actually need that if statement at all...it is the only reamaining condition, so you should just be able to use the else.
CODE
if ($Adult_Tickets == $Adult_coupons){ global $Adult_Ticket, $get_coupons, $incart, $Adult_Tickets, $Adult_coupons, $Adult_coupon, $ac, $at; $get_coupons .= "Adult_Tickets = Adult_coupons<br>"; } elseif ($Adult_Tickets < $Adult_coupons){ global $Adult_Ticket, $get_coupons, $incart, $Adult_Tickets, $Adult_coupons, $Adult_coupon, $ac, $at; $get_coupons .= "Adult_Tickets < Adult_coupons<br>"; } else { global $Adult_Ticket, $get_coupons, $incart, $Adult_Tickets, $Adult_coupons, $Adult_coupon, $ac, $at; $get_coupons .= "Adult_coupons < Adult_Tickets<br>"; }
Try that.
And my apologies from before, the earlier line of code I gave you should have read
CODE
$Adult_Tickets = $at;
i thot the else would do it also, but dispalyed anyway.
so tryed adding the if inside it,
still dispays it if any tickets in the cart. but have made otehr changes, will try it again.
i did change it to $Adult_Tickets = $at;
from $Adult_Tickets = "$at";
no difference it seems.
Reference Sheets
Bye Bye Ads
Free DIC T-Shirt
Related Sites
Monthly Drawing
Partners
Top Contributors
Top 10 Kudos This Month