Your Cart is Currently Empty Easy Digital Downloads
Easy Digital Downloads has a native shopping cart system that allows store visitors to add multiple items to their shopping carts before checking out. However, there are a number of host, site, and browser configurations that can break this functionality and cause the cart to appear empty at checkout.
Below is a list known reasons why your shopping cart may appear empty at checkout and what you can do about it.
Caching Plugins
Caching plugins are the most common culprit because they are so widely used. Their purpose is simple – caching plugins speed up load times for your website by storing certain website data for easy access when requested by the browser. While this is a great way to make your site fast and reduce server traffic, it must be used carefully.
Your site's checkout page should not be cached. Why? Because the information on that page needs to change frequently. Adding items to the cart, removing them, calculating cart totals, and all other functions of the checkout page need to reflect the actual state of the page data every time it is loaded. Otherwise, you can (and most likely will) receive unexpected results when it's time to checkout.
If you are using a plugin such as
W3 Total Cache, WP Super Cache, or another similar plugin, you must configure it to avoid caching on the checkout page.
If you are using Varnish as a caching layer, you may want to
read this document on configuring Varnish for use with Easy Digital Downloads.
Web Host Caching
Though less common, server-side caching can be just as big of a problem for your shopping cart system. Many web hosts offer caching services that you opt into and configure yourself. Others, such as
WP Engine, practice aggressive caching whether you ask for it or not.
WP Engine Customers:
If you host your site on WP Engine, you may encounter some issues with empty carts when visiting the checkout page. This is due to aggressive page caching (which is a good thing!), but it can be easily resolved by requesting that WP Engine setup a special cache exception for your checkout page.
To do this, simply submit a support ticket to WP Engine via their support portal and ask them to exclude your checkout page from cache.
Your checkout page is the one that has the [download_checkout] short code on it, and is saved in Downloads > Settings:
To make things really easy for you, feel free to copy and paste this sample ticket:
Hi!
My site runs the Easy Digital Downloads e-commerce plugin and we are having some issues with page caching and the checkout page. The Easy Digital Downloads team has instructed us to ask you to place a cache exception on our checkout page.
Could you please add the following URL to the exception list?
http://YOURSITE.com/{put your checkout page URL here}
Thanks!
Note: While the checkout page may no longer be cached, you may still have a problem with the "Remove" link in your cart not properly removing items from the cart. If this occurs, ask WP Engine to"exclude the 'edd_saved_cart' and 'edd_items_in_cart' cookies from cache" and that should fix the link.
iPage: If you are hosting your site with iPage, you will need to use a version of PHP lower than 7.0.x. There is a configuration issue with versions of PHP 7 that causes empty carts to occur, however using the newest version of PHP 5 allows the site to function normally.
EasyEngine/Nginx: If you are hosting your site with EasyEngine/Nginx and happen to be using Redis page cache, you will have to find and edit your redis.conf (or redis-php7.conf) and add edd_items_in_cart|
. So, for example, your exceptions could look something like this:
# Don't use the cache for logged in users or recent commenter if ($http_cookie ~* "edd_items_in_cart|comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") { set $skip_cache 1; }
Varnish
If you are experiencing empty shopping carts when using a Varnish caching server with your Easy Digital Downloads store, you might try and use the following rules to help prevent this:
In your Varnish Configuration
// Tells Varnish to pass through on the checkout page if (req.url ~ "checkout") { return (pass); } // Tells Varnish to pass through on any request with edd_action in the query string if (req.url ~ "edd_action") { return (pass); } // Tells Varnish to pass through on any request with add_to_cart in the query string if (req.url ~ "add_to_cart") { return (pass); } // Tells Varnish to pass through if any cookies with `edd` are found if (req.http.cookie ~ "(^|;s*)edd") { return (pass); }
In your wp-config.php
Put the following right
above the line that states /* That's all, stop editing! Happy blogging. */
define( 'EDD_USE_PHP_SESSIONS', false );
View our full document on troubleshooting Empty Shopping Cart errors.
Blocked admin-ajax.php File
Included in WordPress core is a file called
admin-ajax.php
which is used heavily in the shopping cart system, the processing of discounts, and many other important parts of EDD's functionality. Blocking access to this file can cause issues with your cart behavior.
If you are using any security plugins or have aggressive security settings on your server, temporarily disable them and check the cart functionality again. If your security settings block this file, your cart will not work properly.
For more information on blocked admin-ajax.php, see the
full documentation.
Blocked /wp-admin/
There are plugins that block access to /wp-admin/ for security purposes, and these sometimes also block
admin-ajax.php, causing the problems listed above.
To test to see if this is the issue, temporarily deactivate admin blocking plugins. If the problem is resolved then you know it was that plugin.
No PHP Session Support
PHP sessions are designed to give your site visitors a more customized experience. The ability to add items to a shopping cart from page to the next, and then see all of store items in the cart at checkout is about as personal as it gets for a brand new visitor that hasn't shared any information with your site.
However, your web host needs to support PHP sessions in order for your EDD system to use it. Lack of sessions support is oftentimes the reason for an empty cart. If the above issues do not apply to you, try adding the following to your `wp-config.php` file (in the root of your WordPress install):
define( 'EDD_USE_PHP_SESSIONS', false );
Place this code directly
above the /* That's all, stop editing! Happy blogging. */
line. It will not work if you place it at the bottom of the file.
That will instruct EDD to use an alternate browser session tracking system that is supported by your host.
Browser cookies disabled
EDD uses cookies to store information with sessions and keep count of the items in your cart. If your browser cookies are disabled, the shopping cart system will not work.
URL Settings
In order for WordPress to keep track of the contents of the cart your domain name needs to remain consistent throughout your site. If your Settings say your site is
http://
www.example.com, but you have links to http://example.com then your browser sees those as two different sites.
Make sure that whatever you have set under Settings → General is used in all links throughout your site.
In some cases, we have seen where a 3rd party plugin or script installed modifies the Site Address or WordPress address automatically after a certain amount of time. Double check that your Site Address is not being modified to have the www removed or added automatically.
.htaccess rules
The .htaccess file is used by the server to properly route user requests to your pages. WordPress has a set of default rules that we rely on in order for the cart to properly work. If you are having problems with your cart being empty, try and use the default .htaccess configuration set by WordPress:
https://codex.wordpress.org/htaccess
Known Plugin Conflicts
- YouTube SimpleGallery
- Web Ninja Auto Tagging System
- Easy Bootstrap Shortcode
Source: https://easydigitaldownloads.com/docs/shopping-cart-is-empty-at-checkout/
0 Response to "Your Cart is Currently Empty Easy Digital Downloads"
Post a Comment