Jump to content

Possible Reset Problem


jimpottle

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 ;-)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.