Add To Cart Fails With 405 Error - Question | JoomShaper
SP Page Builder 6 is Here! Learn More →

Add To Cart Fails With 405 Error

RM

Rescue Multimedia

EasyStore 4 months ago

Hello,

When I click the "Add to Cart" button on a product page, nothing is added to the cart. Instead, I get a browser popup that says only:

rescuemultimedia.fr says:
[OK]

In the browser console, I see this error:

GET /?option=com_easystore&task=cart.addToCart 405 (Method Not Allowed)

The product is published and priced at €1.00 (not zero). I’ve also cleared Joomla’s cache and tested with all performance features disabled.

This used to work perfectly before the most recent updates.

Can you help identify what might be blocking the addToCart action?

Thank you in advance.

Best regards,

0
6 Answers
RM
Rescue Multimedia
Accepted Answer
3 months ago #197548

Hi,

Thanks again for your help earlier.

I was finally able to resolve the issue. The problem came from a redirection rule in my .htaccess file that was forcing all requests to index.php to be redirected to /, including POST requests.

Here's the rule I had in place :

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/index\.php[?\s] [NC]
RewriteRule ^index\.php$ / [R=301,L]

This was originally added for SEO reasons, but it ended up breaking the "Add to Cart" function in EasyStore, because :

POST + 301 redirect → becomes a GET → EasyStore returns 405 Method Not Allowed

THE SOLUTION :

I updated the rule to apply only for GET requests by adding this condition:

RewriteCond %{REQUEST_METHOD} =GET

So the final working version is:

RewriteCond %{REQUEST_METHOD} =GET
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/index\.php[?\s] [NC]
RewriteRule ^index\.php$ / [R=301,L]

Now everything works perfectly — including Matomo, Redis cache, and my custom price script.

Thanks again for pointing me in the right direction!

Best regards,

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 months ago #195160

Hi there,

Thank you for reaching out, and I apologize for any inconvenience caused by this oversight. To better address the issue, could you kindly provide me Joomla Super administrator access? This will enable me to thoroughly investigate the matter and provide you with a prompt resolution.

I appreciate your cooperation and will ensure to get back to you as soon as possible.

Best regards,

Toufiqur Rahman (Team Lead, Support)

0
RM
Rescue Multimedia
Accepted Answer
4 months ago #195170

Hi,

I give you the access.

Best regards,

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 months ago #195285

First problem solved by disabled this plugin.

Itcs Matomo

Did you use any script on your site?

Like this

https://prnt.sc/hcnKiE4zoGo4

And why did you use? If you use this kind of script anywhere. Please remove and check again.

0
RM
Rescue Multimedia
Accepted Answer
3 months ago #196264

Hi,

Thanks for your feedback.

I saw that the Matomo plugin has been disabled, but unfortunately the issue still persists on my side.

I also removed all custom scripts (Raw HTML block) from the product page to rule out any interference — but I’m still getting the same result: clicking “Add to Cart” triggers a popup with no message and nothing gets added to the cart, and the 405 error still appears in the browser console.

Best regards,

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 3 months ago #196292

I just download a Akeeba backup from your site and it works fine on my end. I think you need to contact your hosting provider.

0