Jump to content

Archived

This topic is now archived and is closed to further replies.

jimpottle

Possible Reset Problem

Recommended Posts

Have a site that appears to work well under v5.1.6 (my personal test server) but gets caught up in some form of a loop under v4.4.1 (the ISP server).  Not sure what is happening but for some reason I believe it is to do with resetting the session variables used with the shopping basket.  Current code (a bit dirty but there it is) is as follows:

[pre]

if ($_SESSION['cart']) {
for (reset ($_SESSION['cart']); $key = key ($_SESSION['cart']); next ($_SESSION['cart'])) {
if ($product == $_SESSION['cart'][$key][product]) {
$_SESSION['cart'][$key][qty] = $_SESSION['cart'][$key][qty] + $qty;
$new_qty = 1;
}
}
}
[/pre]

Any further information can be provided so long as I can understand what is being asked for ;-)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.