Jump to content

Disappearing cart


musicmaster

Recommended Posts

I am preparing a shop and suddenly I had the problem that the shopping cart in the left column spontaneously disappears. 

 

This happened when I moved the mouse over it and then away again. So it looks like there is some "mouseout()" routine on the cart_block that switches the css "display" setting of that block to "none".

 

Problem: I don't know how to see which routines are connected to that block or when some code runs. Firebug has a "debugger" but that shows only what runs from a specificied script. I want to know how I can find out which script is running.

Link to comment
Share on other sites

  • 2 weeks later...

so i launched it on localhost too.

okay, in the ajax-cart.js file please comment this code:

$("#shopping_cart a:first").hover(
		function() {
			$(this).css('border-radius', '3px 3px 0px 0px');
			if (ajaxCart.nb_total_products > 0 || cart_qty > 0)
				$("#cart_block").stop(true, true).slideDown(450);
		},
		function() {
			$('#shopping_cart a').css('border-radius', '3px');
			setTimeout(function() {
				if (!shopping_cart.isHoveringOver() && !cart_block.isHoveringOver())
					$("#cart_block").stop(true, true).slideUp(450);
			}, 200);
		}
	);

should help 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

I'm not sure what to do here,

 

I've replaced the ajax-cart.js with the code from Github, but it fails to update the right-menu cart properly.

 

http://www.smartphonehandschoenen.nl

 

Adding products seems to be working well, but as soon as I try to delete an item from the rightmenu-block, it seems to first remove the price, then after a second click (on the remove button) it deletes the product. It seems to lag behind one click each time (not properly refreshing). 

 

Also, when all items are deleted, there is no message such as "no items in cart" as there used to be. Simply add/remove a bunch of items a couple of times and you'll see what i'm talking about.

 

Please compare to http://www.topsnoep.nl/ (where it does seem to function properly).

 

What am I missing here..?

 

Regards,

Dave

Link to comment
Share on other sites

Dear all,

 

Please also see this recent commit https://github.com/PrestaShop/PrestaShop/commit/4c484afda11ce2527befaaf878cb9473e6ebc6d6

 

As musicmaster said, because of original bad design, this module can not be hooked twice on the top and on a column at same time. You have to choose just one place.

 

Best regards

Edited by Gregory Roussac (see edit history)
Link to comment
Share on other sites

I´ve done two things:

 

- Removed "Top of pages" hook from positions

- Copied and replaced the full Github file posted by Vekia (https://github.com/PrestaShop/PrestaShop/blob/1652f3575c10995b8e088c5cf185b9f8ee77d32a/modules/blockcart/ajax-cart.js)

 

The top of pages hook is still displaying, and the right menu is collapsing on mouse-over (the original problem I believe?).

 

What am I doing wrong?

Link to comment
Share on other sites

Hi,

 

Did you clear smarty cache ? Didi you clear your browser cache ?

 

Regards

 

I've now tried it with your Github file (i'm not sure how Github works), and it seems to work (https://raw.github.com/PrestaShop/PrestaShop/4c484afda11ce2527befaaf878cb9473e6ebc6d6/modules/blockcart/ajax-cart.js)

 

Cleaned smarty and browser cache.

 

However, the top pf pages hook is still showing, but doing pretty much nothing. How would I make that invisible?

Edited by CrossY (see edit history)
Link to comment
Share on other sites

CrossY,

It MUST be hooked to the header of Pages, as this is NOT visible code on your page which is positioned, but the place where PrestaShop adds all CSS/JavaScript code (for optimization purpose). So it's not the TPL file which is hooked here, only css/js files.

 

So please make sure you DO have it in header of Pages AND the column of your choice.

 

For your info,

pascal

  • Like 1
Link to comment
Share on other sites

CrossY,

It MUST be hooked to the header of Pages, as this is NOT visible code on your page which is positioned, but the place where PrestaShop adds all CSS/JavaScript code (for optimization purpose). So it's not the TPL file which is hooked here, only css/js files.

 

So please make sure you DO have it in header of Pages AND the column of your choice.

 

For your info,

pascal

 

It is hooked to Header of Pages, as well as Right Column...

Link to comment
Share on other sites

displayHeader hook isn't mean displayTop hook. Here are differencies between Header and Top section. Huge differencies.

In my opinion displayHeader is one of the most important hooks in the store.

 

I checked sources of your minified js file and you've got code from ajax-cart.js file there. 

It mean, that your module use displayHeader hook mentioned by Pascal. It's necessary :)

Link to comment
Share on other sites

  • 4 months later...

I am not sure whether it is related but I am experiencing a related problem with this same configuration. 

 

When I am on my checkout page (one-page checkout) and I change the order (deleting an item or changing its quantity) the two shopping baskets both become empty. The content is still there and re-appears after a refresh.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...