Jump to content

Ajax cart isnt opening


Recommended Posts

Some scripts are probably colliding with ajax-cart.js.

<div id="cart_block"> should have style="display: none;" dynamically assigned to it and change to display:block for hovering, but it doesn't happen on pages other than Cart page.

i dont have any idea about it. if you have an idea i can try to edit codes in files.

Link to comment
Share on other sites

It seems to work for me, on which browser are you experiencing this issue?

 

In any csse you have an ajax issue left:

 

No 'Access-Control-Allow-Origin' header is present on the requested resource

 

Basically, you are trying to access an ssl'd page from a non secured one. Your hosting is not allowing it ;)

Link to comment
Share on other sites

It seems to work for me, on which browser are you experiencing this issue?

 

In any csse you have an ajax issue left:

 

No 'Access-Control-Allow-Origin' header is present on the requested resource

 

Basically, you are trying to access an ssl'd page from a non secured one. Your hosting is not allowing it ;)

 

hello Nemo i tested on chrome and firefox.  if i click to cart,cart page is opening on new page.

 

ssl pages are opening normally. ajax drop down cart isnt have ssl feature i think

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

access origin errors arent related to "server side" problems.

errors like that are related to "mixed content" filtering in all modern browsers.

but in fact, problem isn't related to this.

problem is somewhere in javascripts,

the same cart works well right after adding some stuff to cart

  • Like 1
Link to comment
Share on other sites

access origin errors arent related to "server side" problems.

errors like that are related to "mixed content" filtering in all modern browsers.

but in fact, problem isn't related to this.

problem is somewhere in javascripts,

the same cart works well right after adding some stuff to cart

yes definitely

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

I have exactly the same problem, showing the following symptoms:

- ajax cart not opening on non-ssl pages when nothing has been added to the cart on that page

- ajax cart functions well on ssl pages, drops down ok

 

It seems related to the ajaxCart not being updated because the GET request is not processed because of the mixed content issue, which gives the following error:

GET http://magneetventielshop.nl/?controller=cart&aj...4dc916e7bacccadf2f3a64dbac9946a9&_=1391538146389      301 Moved Permanently       

 

When a POST request is made, the ajaxCart is updated, nb_total_products goes >0 and the ajax cart opens again.

 

Does somebody have an idea how to fix this issue?

 

website: http://magneetventielshop.nl

 

Thanks!

  • Like 1
Link to comment
Share on other sites

Hello everybody,

 

Finally I managed to solve the problem. I noticed there was a POST request from adding a product to the cart, in the response the complete cart contents are listed and used by the ajax cart. The GET request to update the cart on a page refresh (or next/previous page) does not resolve (301 response).

 

Instead of a GET request, I now send a POST request, which results in the cart contents being returned.

 

To solve this I have changed type: 'GET to 'POST' in  the following code on line 126 of ajax-cart.js:

	// Fix display when using back and previous browsers buttons
	refresh : function(){
		$.ajax({
			type: 'POST',
			url: baseUri,
			async: true,
			cache: false,
			dataType : "json",
			data: 'controller=cart&ajax=true&token=' + static_token,
			success: function(jsonData)
			{
				ajaxCart.updateCart(jsonData);
			}
		});
	},

Regards

Edited by libertec (see edit history)
  • Like 2
Link to comment
Share on other sites

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

T

 

Hello everybody,

 

Finally I managed to solve the problem. I noticed there was a POST request from adding a product to the cart, in the response the complete cart contents are listed and used by the ajax cart. The GET request to update the cart on a page refresh (or next/previous page) does not resolve (301 response).

 

Instead of a GET request, I now send a POST request, which results in the cart contents being returned.

 

To solve this I have changed type: 'GET to 'POST' in  the following code on line 126 of ajax-cart.js:

	// Fix display when using back and previous browsers buttons
	refresh : function(){
		$.ajax({
			type: 'POST',
			url: baseUri,
			async: true,
			cache: false,
			dataType : "json",
			data: 'controller=cart&ajax=true&token=' + static_token,
			success: function(jsonData)
			{
				ajaxCart.updateCart(jsonData);
			}
		});
	},

Regards

 

Thanks man, this solved another problem i had with an XMLHttp request being disallowed , i changed the get to post and now it solved many other problems with the cart.

Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...
×
×
  • Create New...