Jump to content

[solved] Friendly urls & ajax cart impossible to add product


Recommended Posts

Hi all. I have a problem on production server, hosted by OVH. Apache, PHP v5.3.16 , PS v 1.5.2 Default theme.

When I have Friendly URLs turned OFF the blockcart module Ajax add to cart works fine, with the image moving to to Cart graphic etc...

Friendly URls turned ON : CLick add to cart button on Product page. A modal pops up:

 

Impossible to add the product to the cart.

 

textStatus: 'parsererror'

errorThrown: 'SyntaxError: JSON.parse: unexpected character'

responseText:[ **** SOME HTML **** ]

 

From FireBug Console:

 

POST http://id-pharm.com/

controller=cart&add=1&ajax=true&qty=1&id_product=1&token=a92eb22d2ccd6bc84754017a7bd83b84&ipa=14

 

So this tells me that the Homepage gets served and not the blockcart-json, of course this is'nt JSON but HTML so the parsing fails. Conclusion : url_rewrite issue!!

 

I have tried rebuildinig the .htaccess but no change, interestingly all pages work as expected when browsing site, so friendly urls seem to work fine except for when I have exact copy of the site on my local server and everything works as expected.

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

  • 1 year later...

Writing the above post gave me some ideas.... problem solved! Turns out the default OVH index.html file was the culprit, in fact this file was served instead of index.php as the rewrite rules directs to http://domain.com and not explicitly http://domain.com/index.php

 

So my bad , kinda...

 

thx

.henkedo

 

Thanks, this solved my problem also, read somewhere else that it was the paypal app but when that didn't work I read this and it ended up being the index file.

Link to comment
Share on other sites

  • 6 months later...
  • 5 months later...

Writing the above post gave me some ideas.... problem solved! Turns out the default OVH index.html file was the culprit, in fact this file was served instead of index.php as the rewrite rules directs to http://domain.com and not explicitly http://domain.com/index.php

 

So my bad , kinda...

 

thx

.henkedo

HEllo!

 

Seems that I have the same error. Could you please explain how to resolve the problem? step by step :)

Link to comment
Share on other sites

  • 3 years later...
On 12/14/2012 at 6:12 PM, henkedo said:

Writing the above post gave me some ideas.... problem solved! Turns out the default OVH index.html file was the culprit, in fact this file was served instead of index.php as the rewrite rules directs to http://domain.com and not explicitly http://domain.com/index.php

 

So my bad , kinda...

 

thx

.henkedo

 

I'm facing same issue on quantity update and on change of any attribute. Where can i find index.html file and index.php file? And how to fix it.

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