close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

NEED URGENT HELP :: Cart will sometimes not add items

Thread began 2/18/2010 1:00 pm by sam308940 | Last modified 2/22/2010 7:49 am by Ray Borduin | 1967 views | 5 replies |

sam308940

NEED URGENT HELP :: Cart will sometimes not add items

i have tried the code several ways but i get the same issue no matter what.
sometimes the cart will now show items that have been added - ie its not accepting them and displayig them in the cart view.

I do not get any error.
when clicking "Add to cart" it goes to teh view cart page, but doesnt show the item just added.

THis only happens sometimes.
other times it accepts the items.
i cannot detect any pattern - its just random.

here is a few links to show you the issue for testing:
collection.php?S=SS210
collection.php?S=SS310
collection.php?S=SS410
collection.php?S=SS510

just randomly add any combinations to the cart
some will work - some wont.
i have even tried the same combinations - (ie same item with same color and same size) and gotten different results at different times.

ANY IDEAS ON WHERE TO TROUBLESHOOT THIS?

Sign in to reply to this post

sam308940

This post has been deleted.

Jason ByrnesWebAssist

I don't see anything adding to the cart.

to start with, download the sessionTest.php file from the following thread and upload it to your server to if there host has session management configured properly:
showpost.php?p=23826&postcount=2

if the sessionTest.php test successfully, then find the following line in your add to cart pages:

php:
<?php

// WA eCart Redirect
if ($<your cart name>->redirStr != "")     {
  
header("Location: ".$<your cart name>->redirStr);
}
?>



where <your cart name> is the name of your cart object.

and change it to:

php:
<?php

// WA eCart Redirect
if ($<your cart name>->redirStr != "")     {
  
session_commit();
  
header("Location: ".$<your cart name>->redirStr);
}
?>
Sign in to reply to this post

sam308940

well i tested about 10 items and so far that code swap seems to have done the trick. out of curiousity what does the session_commit(); do? is this any indication of a server setting on my host that i should be aware of?

Sign in to reply to this post

Jason ByrnesWebAssist

session_commit() forces the session to be written to the server.


There is a php bug that occurs on some servers where sessions created just before the using the header() function to redirect to another page will not be saved. session_commit() forces the session to be saved to work around the bug.

Sign in to reply to this post

sam308940

should i be concerned that the servers havent been updated?
is this bug only on older versions?

Sign in to reply to this post

Ray BorduinWebAssist

I haven't quite tracked down what causes this to happen on some hosts. It shouldn't be necessary, but we have run into it enough to know how to fix it.

I can't say for sure if you should be concerned or what precise versions have this issue... we just don't know. I think it has something to do with the CGI version of php 4 on a windows machine. Is that what it says you are running when you view phpinfo()?

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...