1

I'm developing my first Exp:resso Store site and I'm running into an issue with the cart not updating on my local development machine. I develop all my EE sites locally using OSX's built-in apache web server but this is the first time I believe I've ever seen any issues with functionality like this. Are there any reasons why the cart wouldn't update or allow me to add new items when testing on a local environment? I've uploaded this to a staging server and the cart seems to work just fine so it's definitely something in the configuration of my local development web server. It's pretty much the default config with only a couple minor changes to ensure permissions and turn on virtual hosts.

UPDATE:

RewriteEngine On

# remove index.php
RewriteCond %{QUERY_STRING} !^(ACT=.*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

# remove www
# RewriteCond %{HTTP_HOST} ^example.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
| improve this question | | | | |
  • What does your htaccess look like? That's normally the cause when forms aren't submitting properly. – Adrian Macneil May 18 '13 at 1:02
  • See above update. It's a pretty straight forward .htaccess file that removes index.php from the URL. I've commented out the removal of www from the site since it's not ready to go live yet. Also, this is the same .htaccess file that's on the staging site and Store seems to be working there. – Stuart McCoy May 20 '13 at 12:44
  • That does sound strange and there's no reason it shouldn't work on your local setup. Do all the resources load in the browser? Take a look in the dev tools > resources, and check that all scripts have loaded. If that all checks out then check the HTTP headers of the form submission. Paste in your findings and we can see if it's sending and receiving correctly. – Ian May 20 '13 at 19:53
  • I noticed that I get a 302 error when I click the add to cart button. I also noticed that this problem seems to be limited to Safari. Firefox and Chrome appear to "ignore" the 302 and add the item to the cart but Safari chokes on it. – Stuart McCoy May 21 '13 at 19:43
2

First thing to check is the obvious - is the product out of stock? Have you definitely submitted an item_qty?

If those don't work - the best way to diagnose issues like this is to check the Network tab in your browser's developer tools. Make sure the form fields are getting submitted as you expect, and if successful you should see only a single 302 redirect to your checkout page (or wherever your return="" tag parameter points to).

Make sure there aren't any extra redirects (for example some script on your website redirecting to HTTPS, or forcing www). Especially since you have a check to force www in your htaccess, make sure you aren't posting to example.com and then immediately redirecting to www.example.com, because you will lose your form POST data in the process.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.