Jump to content

[Resolved] Odd Basket Behaviour


Dirty Butter

Recommended Posts

This is new behavior since upgrading to 6.1.1, but with such an edited version that it's something wrong with my upgrade. This does NOT happen on the CC Demo store.

Something weird is going on when I try to delete an item from the Basket. The page refreshes, but the page does not change - the item is still there. Same thing if I use the Empty Basket button.

If I go back to the homepage, the Cart icon shows there is still an item there. If I refresh the homepage, it zeroes out.

I've tested this on FF and Chrome, with the same results.

Error log shows

[23-Nov-2016 10:12:33 America/Chicago] PHP Warning:  Shipping not setup or allow no shipping not enabled in XXX/plushcatalog/classes/cubecart.class.php on line 1857

I tried using stock box.basket.php and box.basket.content.php, but that did not change anything.

 

Link to comment
Share on other sites

I tried that, but it still persists (cleared cache and browser before attempting) until I manually refresh the page. The waterfall does not look like the CC demo store waterfall, either.

This is happening on both the dirtybutterestates.com and the /plushcatalog/ stores.

There were lots of cache related changes in 6.1.1, and as far as I can tell those changes are all in place. I don't know what file to examine that controls the trashcan icon/Empty Basket button removing the item.

Link to comment
Share on other sites

The "Empty Basket" button is a link that points to: /index.php?_a=basket&empty-basket=true

This is dealt with in the Cubecart class starting near line 293. (The querystring doesn't have to equal true, but empty_basket needs to be present.)

An immediate call is made to Cart->clear(). The clear() function in the Cart class starts near line 475. The actions here are simple: delete, delete, and delete. I am not aware of any other storage location for shopping basket contents (until starting to checkout). After which, CubeCart bounces the browser back to the View Cart page.

Working with the theory that the cart gets emptied, when a page still shows previous contents, it must be coming from a cached skin template, or a server-level pre-compiled and cached PHP script.

As an experiment, when you empty the Cart and yet, the View Cart page still shows contents, scan the debug section at the bottom of the page for the __basket section. If the __basket section is not there, or is there but has no 'contents', then the page's HTML is coming from a cache somewhere.

Link to comment
Share on other sites

The _basket section of the gray Debug section at the bottom of the screen was there and looked ok as far as I could tell. I've checked and my cubecart.class section around line 293 is just like stock. I wasn't sure what I needed to do for Debug, so I added {DEBUG} to the bottom of box.basket.content.php. When I took the debug line off - the popup still showed when I tried emptying the basket routine again. I had to refresh to get rid of it. (Cache is still turned off on storefront)

There's definitely some super caching going on. I tried changing global.inc.php to cache=file, instead of memcached, but the cart item still persists after it should be gone.

I just realized that zeroing out the quantity of the basket item DOES refresh the page correctly when I Update Basket. So I went back to the homepage and put a different item in the basket. Instead of seeing the new item, it says the basket is empty and continue shopping, just as it did when I Update Basket emptied it. I refreshed, and there the item was, sitting in the basket!

Link to comment
Share on other sites

"When I took the {debug} line off - the [Smarty debug console] popup still showed when I tried emptying the basket routine again."

So, having dismissed the popup from the prior page request, and then removing the Smarty {debug} command from the template and saving that file back, the next page request still produced the popup.

I have to then ask, after you added the {debug} command to the template, did the first page request NOT show the popup? Did a second page request then get the popup?

 

 

Link to comment
Share on other sites

20 minutes ago, bsmither said:

I have to then ask, after you added the {debug} command to the template, did the first page request NOT show the popup? Did a second page request then get the popup?

I've hit so many things now I'm not positive - but I'm pretty sure I did refresh before I could see it.

Link to comment
Share on other sites

Ok, that adds a piece to the puzzle, but doesn't really help identify the whole picture.

Using your favorite file/folder compare utility, make a file difference report between a stock CC611 and your current installation.

Let's take a look at what edits may be to blame.

 

Link to comment
Share on other sites

I've already done that several times, but didn't see anything that seemed related. That;s the problem - I could be looking straight at the issue and not realize its significance. I do know all those classes/cache files are stock in my version.

I haven't made a file difference report in a long time, but I'll get it done - may take awhile.

Link to comment
Share on other sites

Ok, so what happens is that, by clicking any link in the report, I get shown the storefront.

This is because of the rewrite rules in htaccess.

/plushcatalog/BcFiles/Dir2016-11-23_17-17-43-699.html
probably rewritten to:
index.php?seo_path=plushcatalog/BcFiles/Dir2016-11-23_17-17-43-699

which CubeCart can't find a product, category, or document for.

Do me the favor of zipping the BcFiles folder and the Report.html file (and anything else BC created) into a ZIP and emailing it to me.

You should have my email address.

Link to comment
Share on other sites

Looking at the headers of the Result page sent in /plushcatalog/, I see:

X-Powered-By: W3 Total Cache

This appears to be a Wordpress plugin.

Please review what this does, make any adjustments to the settings as appropriate for the CC611 codebase, and test.

Link to comment
Share on other sites

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.   Paste as plain text instead

  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...