Forums / General Questions / "Your shopping cart is empty"

"Your shopping cart is empty"

Views: 3,614

Results 1 to 20 of 21
6 Jan 2017, 4:40 PM
#1
campdave avatar

campdave

New Zenner

Join Date:
Jan 2017
Location:
Morecambe
Posts:
9
Plugin Contributions:
0

"Your shopping cart is empty"

campdavebadges co uk

Since adding a SSL certificate and enabling it on my Zen Cart store, I am having the intermittent issue where it is displaying the message "Your Shopping Cart is Empty" when trying to add items to the basket.

I've googled the issue, and read several threads on this forum suggesting an issue with suhosin and adding the line

php_flag suhosin.session.encrypt off

To my .htaccess file. I've done this, to no effect

I'm hosted with hostgator, and after a lengthy online chat was told

Alright, with this, your php is actually using suphp, and not suhosin, so this shouldn't be effecting the php sessions' encryption.

My htaccess file is as follows:

#### BOF SSU

Options +FollowSymLinks -MultiViews
RewriteEngine On
# Make sure to change "zencart" to the subfolder you install ZC. If you use root folder, change to: RewriteBase / 
#RewriteBase /zencart/
RewriteBase /

# Deny access from .htaccess
RewriteRule ^\.htaccess$ - [F]


# Always use https for secure connections
# Replace 'www.example.com' with your domain name
# (as it appears on your SSL certificate)
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.campdavebadges.co.uk/$1 [R=301,L]

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.+) index.php/$1 [E=VAR1:$1,QSA,L,PT]


# alternative rewrite rule, seem to work on GoDaddy hosts http://codeigniter.com/wiki/Godaddy_Installaton_Tips/
# to use it, please make sure you comment out the rewrite rule above, then uncomment the line below
# RewriteRule ^(.*)$ /index.php?$1 [L] 
#### EOF SSU 
<IfModule mod_suphp.c>
  suPHP_ConfigPath /home3/campdave
  <Files php.ini>
    order allow,deny
    deny from all
  </Files>
 </IfModule>

and my config file

<?php
/**
 * @package Configuration Settings
 * @copyright Copyright 2003-2016 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * File Built by Zen Cart Installer on Wed Jun 22 2016 08:34:12
 */

/*************** NOTE: This file is VERY similar to, but DIFFERENT from the "admin" version of configure.php. ***********/
/***************       The 2 files should be kept separate and not used to overwrite each other.              ***********/

/**
 * Enter the domain for your store
 * HTTP_SERVER is your Main webserver: eg-http://www.yourdomain.com
 * HTTPS_SERVER is your Secure/SSL webserver: eg-https://www.yourdomain.com
 */
define('HTTP_SERVER', 'https://www.campdavebadges.co.uk');
define('HTTPS_SERVER', 'https://www.campdavebadges.co.uk');

/**
 *  If you want to tell Zen Cart to use your HTTPS URL on sensitive pages like login and checkout, set this to 'true'. Otherwise 'false'. (Keep the quotes)
 */
define('ENABLE_SSL', 'true');

/**
 * These DIR_WS_xxxx values refer to the name of any subdirectory in which your store is located.
 * These values get added to the HTTP_CATALOG_SERVER and HTTPS_CATALOG_SERVER values to form the complete URLs to your storefront.
 * They should always start and end with a slash ... ie: '/' or '/foldername/'
 */
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');

/**
 * This is the complete physical path to your store's files.  eg: /var/www/vhost/accountname/public_html/store/
 * Should have a closing / on it.
 */
define('DIR_FS_CATALOG', '/home3/campdave/public_html/');

/**
 * The following settings define your database connection.
 * These must be the SAME as you're using in your non-admin copy of configure.php
 */
define('DB_TYPE', 'mysql'); // always 'mysql'
define('DB_PREFIX', 'zen_'); // prefix for database table names -- preferred to be left empty
define('DB_CHARSET', 'utf8'); // 'utf8' or 'latin1' are most common
define('DB_SERVER', 'localhost');  // address of your db server
define('DB_SERVER_USERNAME', '**********');
define('DB_SERVER_PASSWORD', '**************');
define('DB_DATABASE', '***************');

/**
 * This is an advanced setting to determine whether you want to cache SQL queries.
 * Options are 'none' (which is the default) and 'file' and 'database'.
 */
define('SQL_CACHE_METHOD', 'none');

/**
 * Reserved for future use
 */
define('SESSION_STORAGE', 'reserved for future use');

/**
 * Advanced use only:
 * The following are OPTIONAL, and should NOT be set unless you intend to change their normal use. Most sites will leave these untouched.
 * To use them, uncomment AND add a proper defined value to them.
 */
// define('DIR_FS_SQL_CACHE' ...
// define('DIR_FS_DOWNLOAD' ...
// define('DIR_FS_LOGS' ...

// End Of File

Thanks for any advice given

6 Jan 2017, 5:25 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: "Your shopping cart is empty"

Any consistency on the product/product selections to reproduce the condition? Are there attributes (or not), quantity of product available, plugins that might use the includes/extra_cart_actions folder?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

6 Jan 2017, 5:37 PM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: "Your shopping cart is empty"

One minor comment at least when reviewing the includes/configure.php file, can and is recommended to set ENABLE_SSL to 'false' considering you are presenting your entire site with SSL, there is no need for the software to intelligently switch between the two server constants.

Ugh, and now that the htaccess file has been reviewed, my guess is the uri rewriter Simple SEO URLS. But, it could be that the suphp instruction is after the other rules rather than before, just something I would switch to ensure that in line logically to incorporate php before anything tried to execute php code.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

6 Jan 2017, 6:22 PM
#4
campdave avatar

campdave

New Zenner

Join Date:
Jan 2017
Location:
Morecambe
Posts:
9
Plugin Contributions:
0

Re: "Your shopping cart is empty"

Thanks for the comments and suggestions.

There is nothing to suggest any differences between products - on the chrome browser I use day in, day out, everything seems to work fine. When I started a private browsing session to to try a setup with no cookies or suchlike, I got the issues. On IE, works sometimes, and not others. One item can work fine in one window but not another. As I sell variations of one item, the first product got created and everything copied from there.

I have modified the htaccess file as you suggested - unfortunately it's made no change. I do have Simple SEO installed, on the recommendation of someone who did some work on my site (I understand a bit of code, but not a huge amount), though it turns out the guy who did the work probably didn't know a huge amount more than me. To be fair, I did get a search engine boost after it was installed.

I'll will make the config suggestion you have made - I have tried several combinations of SSL being enabled today, and the basket only works when it's completely turned off.

6 Jan 2017, 6:43 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: "Your shopping cart is empty"

You said that you tried to access the site using a private browser option and that's when the issues arose? There are cookies involved with using ZC and that could potentially be a part of the issue. Also, what are your configuration->sessions settings?

You're able to login as a customer and browse around without issues? What specific 1.5.5 version are you using and what is the history/method of getting there? (ie. Has the store been upgraded to get where it is, or freshly built?)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

6 Jan 2017, 7:06 PM
#6
campdave avatar

campdave

New Zenner

Join Date:
Jan 2017
Location:
Morecambe
Posts:
9
Plugin Contributions:
0

Re: "Your shopping cart is empty"

Thanks again for the response.

I'm currently using 1.5.5a. I started on 1.5.0, then had a fresh install of 1.5.4 which was upgraded to 1.5.5a (not by me, it was beyond my skill level).

I used private browsing just to test another set up on the site - the site works perfectly for browsing in normal and private modes.

Using IE and Opera in normal modes, and Chrome on my phone both give the error when trying to add items to the cart. Occasionally it will work, but most of the time it's the Your Cart is empty message. Turning off SSL completely, the site works perfectly in all browsers I have access to, in private and regular browsing modes.

Sorry, forgot to add my sessions info:

Value	Action 

Session Directory /home3/campdave/public_html/cache
Cookie Domain True Info
Force Cookie Use False Info
Check SSL Session ID False Info
Check User Agent False Info
Check IP Address False Info
Prevent Spider Sessions True Info
Recreate Session True Info
IP to Host Conversion Status true Info
Use root path for cookie path False Info
Add period prefix to cookie domain True Info

6 Jan 2017, 8:18 PM
#7
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,857
Plugin Contributions:
18

Re: "Your shopping cart is empty"

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

6 Jan 2017, 8:39 PM
#8
campdave avatar

campdave

New Zenner

Join Date:
Jan 2017
Location:
Morecambe
Posts:
9
Plugin Contributions:
0

Re: "Your shopping cart is empty"

dbltoe:

Dave,
Have you looked at https://www.zen-cart.com/showthread.php?201971-SOLVED-When-clicking-quot-Add-to-Cart-quot-message-shows-quot-Your-Shopping-Cart-is-Empty-quot&p=1163306#post1163306

Thanks for your link. I've looked at many different threads today, but hadn't come across this one.

Ignoring the argument on the thread, it does go a little over my head (it's beyond my capabilities to remove what has been installed to check) - but my understanding of what is being said there is that it would either work or it wouldn't work, whereas this seems to work some of the time and not other times. I'm happy to be corrected though!

6 Jan 2017, 9:57 PM
#9
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: "Your shopping cart is empty"

Curious...

There are a number of ways to check/validate/force https on the first landing of the site, the method chosen above is to see if port 80 was being used.

Based on the above includes/configure.php of using https for both sides of the server constants, ZC will transition to https automatically when selecting any link from whatever page is initially landed.

Wondering if you could try temporarily commenting out the following from your .htaccess file:

# Always use https for secure connections
# Replace 'www.example.com' with your domain name
# (as it appears on your SSL certificate)
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.campdavebadges.co.uk/$1 [R=301,L]

So that it would look like this by adding # before each line to be commented out:

# Always use https for secure connections
# Replace 'www.example.com' with your domain name
# (as it appears on your SSL certificate)
RewriteEngine On
# RewriteCond %{SERVER_PORT} 80
# RewriteRule ^(.*)$ https://www.campdavebadges.co.uk/$1 [R=301,L]

Leave RewriteEngine on alone as it is needed at least before the rewrites that follow.
Then try your test(s) again and see if you end up with items in your cart or continue to receive the empty cart result(s).

If resolved, then need to come up with a slightly different solution to the above, my initial thought is to remove the ",L" portion of the commented out rewriterule line.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

6 Jan 2017, 10:06 PM
#10
campdave avatar

campdave

New Zenner

Join Date:
Jan 2017
Location:
Morecambe
Posts:
9
Plugin Contributions:
0

Re: "Your shopping cart is empty"

Thanks again for another suggestion.

Commenting out the secure forcing from the .htaccess, so SSL is selected only in the config file has the same result of empty cart when pressing the add to cart button.

I was able to try my site on my girlfriends laptop, and on chrome and IE on her laptop, in normal and private browsing modes, I was getting the empty cart message. I had been disappointed with sales since I added SSL at the end of November, but I was so busy in other places I didn't really stop to look at it and only noticed today by chance. I have been getting some sales, so I guess the issue is intermittent, which is frustrating as it makes it difficult to pin down.

I've temporarily disabled SSL so people can at least add stuff to their baskets.

6 Jan 2017, 10:13 PM
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: "Your shopping cart is empty"

Well, if you plan to keep SSL disabled (at least until the issue can be resolved) then that section will need to remain commented out.

The other "thought" and as related to the thread recommended above, would be to disable SSU which should be possible within your configuration menu area. By temporarily disabling it while the store is set to support SSL (whether the htaccess rule is enabled or not), you should be able to navigate the store to add a product (using default ZC URIs. And see if the problem is more of a server configuration/interface with the server or if it is/was the uri rewriter.

After the test you can return to whatever status/condition you think appropriate for your needs and the operation of your store. Certainly the inability to add items to the cart will have a direct impact on the ability to make sales.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

7 Jan 2017, 1:04 PM
#12
campdave avatar

campdave

New Zenner

Join Date:
Jan 2017
Location:
Morecambe
Posts:
9
Plugin Contributions:
0

Re: "Your shopping cart is empty"

Thanks, there is a config section in the admin panel for SSU, but it doesn't seem to be a simple on/off. I did comment out some of the lines in the htaccess file which also seem to be part of it, as when I did so the links reverted to the normal product ID, but when I clicked on them I got a 404 so there's something else I need to find somewhere.

7 Jan 2017, 3:13 PM
#13
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: "Your shopping cart is empty"

campdave:

Thanks, there is a config section in the admin panel for SSU, but it doesn't seem to be a simple on/off. I did comment out some of the lines in the htaccess file which also seem to be part of it, as when I did so the links reverted to the normal product ID, but when I clicked on them I got a 404 so there's something else I need to find somewhere.
That's unfortunate. Both of the other two suggested/recommended uri rewriters have such an on/off switch. When off the htaccess can remain created or can be removed (at least the parts created to support the renaming).

So, here's another thought if you're up to it at least a little bit. If you were to create a new store off of your current host that has only the default product with SSL activated and see if that version of the store can handle such a connection properly, then it would at least help eliminate the server's SSL configuration as part of the issue.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

7 Jan 2017, 3:45 PM
#14
campdave avatar

campdave

New Zenner

Join Date:
Jan 2017
Location:
Morecambe
Posts:
9
Plugin Contributions:
0

Re: "Your shopping cart is empty"

After finding the documentation, I did actually find an off/on switch for SSU which wasn;t labelled especially well in the admin panel.

Turning it off and reinstating SSL seems to have fixed the issue on both IE and Chrome on my laptop in both standard and private browsing. Unfortunately it means my links from search engines to my site no longer resolve correctly, but that will sort itself out the next time google spiders my site.

I appreciate different people have different views on the subject, but would you recommend trying a different package to create more search engine friendly URLS - do you reckon it makes a difference to SEO?

Thanks for your patience in helping to solve this problem for me.

8 Jan 2017, 10:34 AM
#15
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: "Your shopping cart is empty"

Bravo.

So, agree, there are the sort of "two schools" of thought. Don't use a uri rewriter, do use one that works...

I have a preference, but it's somewhat a "selfish" reason in that, if I was going to rewrite uris, then I would want total control of the result and not something that follows some certain set of rules that I have to code/recode in order to get to work the way I want them to work. But, on the flip side, having a relatively automated method of not only generating but more than likely being able to handle a user's inability to spell well may also be of benefit...

If you have/or want to maintain the exact same uris for all of your products (for now), I would say/suggest CEON (SEO) URI mappings. If you want a system that seems to be similar to what SSU offers then I would suggest Ultimate SEO URIs (usu is one way of how it's referred). It is likely to be a little more straight forward in transition from SSU to another URI rewriter.

There are settings with which to be concerned, and I believe there is plenty of documentation and there is a forum thread for it/both programs.

The thing is, that generally speaking, only one or the other rewriters is suggested to be installed at one time and having two or more could be problematic. CEON does offer the ability to be installed and to be able to obtain information from the existing program (SSU) to help populate CEON to take its place, but when all is said and done, only one should be installed.

There have been those that have continued to suggest SSU, but of any systems to which I've seen it installed, it has not functioned fully/as if no rewriter has been installed because some feature or another has been disabled or there continues be more and more error logs...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

8 Jan 2017, 12:07 PM
#16
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: "Your shopping cart is empty"

campdave:

After finding the documentation, I did actually find an off/on switch for SSU which wasn;t labelled especially well in the admin panel.

Turning it off and reinstating SSL seems to have fixed the issue on both IE and Chrome on my laptop in both standard and private browsing. Unfortunately it means my links from search engines to my site no longer resolve correctly, but that will sort itself out the next time google spiders my site.

I appreciate different people have different views on the subject, but would you recommend trying a different package to create more search engine friendly URLS - do you reckon it makes a difference to SEO?

Thanks for your patience in helping to solve this problem for me.

I've never been a great fan of URL re-writers, but these days there are some operational reasons for using them. About 18 months ago I installed CEON URI Re-writer, and it's doing a good job. Bear in mind that it hasn't been "tweaked" for some time, and with Connor's sad passing a few years ago his superb skills have not been "replaced" - despite the noble efforts of many people.

I made some alterations to the mod before installing it. For example, it applies latin-1 collation to the new tables, so I changed this to utf-8.

Also, it still offers the selection to re-write url's for tell-a-friend and reviews. So after installation, use the configuration options to switch off this capability.

The mod allows a variety of automatic and manually controlled URL re-writes, with the resultant url being stored in the database. One down-side on installing into an existing store is that you need to "manually" edit each existing product for the mod to generate the URL.

I circumvented this by applying SQL injects, after creating my desired URL's in a MS Excel sheet, based on a dump from Easy Populate. What would have taken the better part of 2 - 3 days, took just over an hour.

Now... The "practical" reason for using these re-written URL's...

Firstly, there is no evidence to show that a re-written URL has a measurable SEO benefit - but what we have tracked is that as the URL is often reflected in the search result (and I'll elaborate on this later), PEOPLE see their search phrase repeated more often in the search results. This is a basic marketing principle and comes down to human behaviour - but there is a greater likelihood that a search link will be clicked if the person seeing it gets a good idea of what it points to.

Now... to elaborate... If you use AdWords, Google offers an opportunity for you to insert 15 characters into two "path" fields for any given display advert. It does not generate a hyperlink, but appears as the "green text" under the advert's heading. Again, having textual url's makes this more logical and again, repeats the display of actual words that the PERSON is keen to see.

So, what I have done (and you can "edit" the hyperlinks in CEON) is configure URL's that have a path of two elements:

EG: http : // yourwebsite . com / first-path-text / second-path-text

... and keep each path to 15 characters or less.

This takes a bit of careful planning, but if it becomes a "policy", then one can apply when new products are added.

The RESULT (and again... it's not about technology but HOW PEOPLE BEHAVE) is that it returns results to the screen that are far more likely to be "noticed" and "acted upon" by the viewer.

When one couples this with ad extensions, and the Super-Data plugin for Json/ld Structured Data embedding, one sees greater CTR, and... and... and...
more rapid climb up search results tables.

We launched a site in mid-November... already 30% of our important keywords are resulting in ORGANIC links on page 1 of google (desktop) and nearly 40% are featuring on page 1 in mobile searches.

20 years a Zencart User

8 Jan 2017, 12:17 PM
#17
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: "Your shopping cart is empty"

Critical to managing how google interprets the site, are good use of Google Search Console and Analytics. These services need to be very carefully configured and "linked" (also to any adwords and merchant-centre accounts). Enabling enhanced modes in Google adwords, and configuring all the essential technology, one can test how effective your efforts are by using a variety of measuring tools. These include:

Google Pagespeed Tester
Google mobile tester
GTMetrix pagespeed analyser
Google Structured Data Testing Tools

If you get bad reports, or score under 80% on any of the tests, your site needs work.

20 years a Zencart User

8 Jan 2017, 1:17 PM
#18
campdave avatar

campdave

New Zenner

Join Date:
Jan 2017
Location:
Morecambe
Posts:
9
Plugin Contributions:
0

Re: "Your shopping cart is empty"

Thanks both for your comprehensive replies.

It's a major regret of mine that I didn't put enough effort into SEO when I started my site a few years ago and got to the point where I have 2600 products that may need updating.

Obviously I'm apprehensive about installing another extension which may or may not conflict with SSU and more importantly, could reinstate the error I was having - so I think any solution needs to be a mapped solution rather than a re-writer. I guess rather than rushing into it, I should see how my rankings are affected once google reindexes my site back to it's original URLs.

Plenty for me to research and think about. Thank you!

8 Jan 2017, 1:39 PM
#19
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: "Your shopping cart is empty"

What I did - 18 months ago - was launch an entirely new website on a "fresh" install - using a "clone" of the database (with lots of php-my-admin editing along the way).

But I ended up with a site that was populated with all the original site's product and attribute data, shipping and payment configs, customer and transaction data - but no complex plugins or "dud" database tables and fields. Then, we installed CEON and (as described in my earlier post), we "applied" the new url's with sql inserts.

The result was one site (the original) using conventional dynamic URL's and the other using URI mapping. Both were functioning side-by-side in the real world.

So, it mattered not if customers accessed either site to login, but what we also did when they used the new site for the first time, was send them a message telling them that their login on the old site had been deactivated, and that all future purchases should happen on the new site. After 6 months, we switched off the old site and did 301 re-direct (global, using .htaccess) to the new site.

Interestingly, the effect on sales (across the board) was positive. We lost very, very few customers, but ended up with a relatively "seamless" (if slightly prolonged) transition, with no down-time.

20 years a Zencart User

8 Jan 2017, 1:41 PM
#20
campdave avatar

campdave

New Zenner

Join Date:
Jan 2017
Location:
Morecambe
Posts:
9
Plugin Contributions:
0

Re: "Your shopping cart is empty"

That's a good suggestion, and one I will seriously think about. Thanks very much!