Jump to content

Article deleted completely after deleting it from the basket


harald.thomas

Recommended Posts

Hi All,

 

If a customer puts an article in his shopping basket and deletes it with the X beside the article in the basket, the article is deleted completely, even from the article list in the backend.

The issue is reproducible.

PS version 8.2.3

PHP version 8.1.33

Any suggestion on how to solve this?

 

slainte

Harald

Link to comment
Share on other sites

yes, completely, the theme is a custom theme, but not affecting the behaviour, used the default theme with same issue.

 

here is a video

 

https://wetransfer.com/downloads/933829aefca48bd4afed0f5e5affc0f920251004142713/16c7d6e8979e9283bd90b1ef36ca9f3520251004142733/4e8988?trk=TRN_TDL_01&utm_campaign=TRN_TDL_01&utm_medium=email&utm_source=sendgrid

 

Edited by harald.thomas (see edit history)
Link to comment
Share on other sites

Usual suspect: a module hooked on cart-delete

Go to:
Design → Positions (in older builds, “Improve → Design → Positions”).

Search the hook

also  select: Display non-positionable hooks

In the search bar at the top-right of that page, type one of:

actionObjectProductInCartDeleteAfter

or (for legacy modules)

actionDeleteProductInCartAfter

If a module is registered on that hook, it will appear in the results table.

Sometimes the problem module is using an older or slightly different hook name:

  • actionObjectCartDeleteAfter
  • actionCartSave
  • actionObjectCartRemoveProductAfter
  • actionCartUpdateQuantityBefore
Link to comment
Share on other sites

This is the Link for the remove from car icon (X):

<a class="remove-from-cart" rel="nofollow" href="https://xxxxxxx/warenkorb?delete=1&amp;id_product=249&amp;id_product_attribute=0&amp;token=xxxxxxxxxx" data-link-action="delete-from-cart" data-id-product="249" data-id-product-attribute="0" data-id-customization=""><i class="material-icons"></i></a>

Link to comment
Share on other sites

36 minutes ago, harald.thomas said:

This is the Link for the remove from car icon (X):

<a class="remove-from-cart" rel="nofollow" href="https://xxxxxxx/warenkorb?delete=1&amp;id_product=249&amp;id_product_attribute=0&amp;token=xxxxxxxxxx" data-link-action="delete-from-cart" data-id-product="249" data-id-product-attribute="0" data-id-customization=""><i class="material-icons"></i></a>

this is normal

23 minutes ago, Daresh said:

Weird indeed. Like @El Patron wrote, it may be something hooked to 'actionObjectProductInCartDeleteAfter', but the only module that is there is PrestaShop Checkout. Are you using it? If not, disable or uninstall.

I did check that prestashop checkout does is hooked here normally, at least on a 9.0.0.  

to narrow down try the following:

Disable all overrides (Advanced Parameters → Performance) and re-test. If the deletion stops, inspect override/classes/Cart.php, override/classes/Product.php, or any controller override.

In Back Office go to Advanced Parameters → Performance.  Under Debug mode, switch Enable Debug Mode to Yes and Save.

Reproduce and collect the profiler data at the bottom of the footer of our website.  This will provide a lot of insights you may not have already collected.

Link to comment
Share on other sites

17 minutes ago, harald.thomas said:

Disable all overrides -> still the same issue

I disabled the hook actionObjectProductInCartDeleteAfter - still same issue

will do the debug tomorrow. 

where can i check the debug log?

If your hosting has Plesk, cPanel, or similar:
→ Look for Logs → PHP Error Log (sometimes called “Web Server Logs”).

You can also check whether your installation has been modified unexpectedly.

Go to Advanced Parameters → Performance.
Scroll down and find the “Check Files” section (sometimes labeled “Check PrestaShop files integrity” or “Check if files have been modified”).

PrestaShop will compare your core files against its original checksums. If files have changed in /controllers/, /classes/, or /modules/ and you didn’t modify them yourself, that’s a red flag.

 

While this specific “delete product from catalog when removing from cart” behavior is unusual, it’s worth noting:

Many PrestaShop stores have been hacked through outdated modules or themes, often exploiting insecure file uploaders or helper classes.

This can allow attackers to:

Inject malicious code into overrides,

Replace controller files, or

Hook scripts into events like cart updates (exactly what’s happening here).

So if:

You see unexpected file changes in Advanced Parameters → Performance,

Or your PHP logs show suspicious includes or eval(),
then treat this as a security incident — not just a bug.

 

Me?  if  you  want to stay with PrestaShop then use a tool like migrator pro and migrate to fresh copy of PrestaShop.  I see  that you have many topics on this same question.  Or move your catalog to different ecommerce platform so you can get focus on selling rather then debugging

 

 

Link to comment
Share on other sites

Thanks for the hints.

 

No altered files found.

 

The only log that I could find was:

A.B.C.D - - [05/Oct/2025:11:13:25 +0200] "POST /warenkorb?delete=1&id_product=253&id_product_attribute=0&token=c473c28e64c98d4c690b6b56647c4adc HTTP/1.0" 200 4070 "https://xxxxxx/suche?controller=search&s=test" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Safari/605.1.15"
A.B.C.D - - [05/Oct/2025:11:13:26 +0200] "POST /module/ps_shoppingcart/ajax HTTP/1.0" 200 6050 "https://xxxxxx/suche?controller=search&s=test" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Safari/605.1.15"

 

Thanks for the hint with migrator pro, already used it to migrate to this version of the shop.

 

any other hint for tracking this down?

 

Link to comment
Share on other sites

2 hours ago, harald.thomas said:

Thanks for the hints.

 

No altered files found.

 

The only log that I could find was:

A.B.C.D - - [05/Oct/2025:11:13:25 +0200] "POST /warenkorb?delete=1&id_product=253&id_product_attribute=0&token=c473c28e64c98d4c690b6b56647c4adc HTTP/1.0" 200 4070 "https://xxxxxx/suche?controller=search&s=test" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Safari/605.1.15"
A.B.C.D - - [05/Oct/2025:11:13:26 +0200] "POST /module/ps_shoppingcart/ajax HTTP/1.0" 200 6050 "https://xxxxxx/suche?controller=search&s=test" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Safari/605.1.15"

 

Thanks for the hint with migrator pro, already used it to migrate to this version of the shop.

 

any other hint for tracking this down?

 

those https above are ok.

I suppose really only way now to pin point it is to disable 3rd party modules from  performance page, first make a list of enabled modules.  Cheek if problem still exists and  if not then enable one by one until problem comes back.  This will tell you  which module if any is creating the issue.  Also  advanced --> information did you check which ps files changed?

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