Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Products in Cart report #8724

Closed
dannynimmo opened this issue Feb 28, 2017 · 11 comments
Closed

Products in Cart report #8724

dannynimmo opened this issue Feb 28, 2017 · 11 comments
Labels
bug report Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@dannynimmo
Copy link
Contributor

Preconditions

  1. Magento 2.1.3
  2. PHP 5.6

Steps to reproduce

  1. Create a product
  2. Add product to cart
  3. Delete product
  4. View Products in Cart report

Expected result

Report page should display with no errors

Actual result

Exception #0 (Exception): Notice: Undefined offset: 5 in /var/www/src/vendor/magento/module-reports/Model/ResourceModel/Quote/Item/Collection.php on line 222

Looks like the code needs to check the product still exists before trying to add data to the collection.

@Radosav
Copy link

Radosav commented May 3, 2017

Created an extension to fix this until Magento 2 team fixes it.
https://github.com/Radosav/Radosav_ReportFix

@smoskaluk
Copy link

@dannynimmo I cannot reproduce this issue as described. Please provide the detailed steps I must follow to reproduce this issue. In addition, identify the web server you are running, the versions of PHP and MySQL, and any other information needed to reproduce your issue

@dannynimmo
Copy link
Contributor Author

@smoskaluk I feel I was pretty clear in my issue report, but I will detail further:

  1. As a Magento admin, create a new product in the backend
  2. As a customer, add the product to the cart
  3. As the Magento admin, delete the product from the system
  4. As the Magento admin, view the "Products in Carts" report (Reports > Marketing > Products in Carts)
    1. Depending on how many products on the website, there may be pagination, in which case you should click through all pages

@veloraven
Copy link
Contributor

@dannynimmo thank you for your update.
Unfortunately we still can not reproduce this issue.
Please provide following information:

  1. Type of the product in the shopping cart
  2. If it was registered customer or guest user
  3. It's not clear how pagination on the report page can depend on total products amount (step 4i in your comment). Can you reproduce this issue when there is no pagination?
  4. Do you still have other shopping cats active at the moment of error?
  5. Can you reproduce this issue on ver. 2.1.7?
  6. Do you use any external extensions?
  7. Please provide information about your environment: OS, web-server, MySQL version (as I can see PHP version is 5.6)

@bnymn
Copy link
Contributor

bnymn commented Jul 5, 2017

I had the same problem. The module which @Radosav writes works.

You can also flush the following table, if you are in development environment: DELETE FROM quote_item;

@sambalay
Copy link

I am having the same issue.

I installed @Radosav fix, but still it didn't work. Please suggest.

@magento-engcom-team magento-engcom-team added 2.1.x bug report Progress: needs update Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@rliukshyn
Copy link
Contributor

@veloraven please try to reproduce it with configurable product in shopping cart.
Thanks.

@shreyap26
Copy link

@dannynimmo I had a similar bug in my magento installation. I had created some products, they were added to cart and then these products were deleted. Deleting the products did not delete them from quote_item table. I deleted all rows from this table that had an invalid product_id and that fixed the bug for me. The products were deleted from Magento 2.1.2. I have upgraded to magento 2.1.8 now and I did not need to use the module suggested by @Radosav

@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed and removed Progress: needs update labels Sep 18, 2017
@magento-engcom-team
Copy link
Contributor

@dannynimmo, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.1.9

@magento-engcom-team magento-engcom-team added the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Sep 21, 2017
@Linek
Copy link
Contributor

Linek commented Feb 14, 2018

To reproduce this issue on 2.2.0 you have to:

  1. Create configurable with simple assigned. IMPORTANT: Configurable products must not have price fulfilled (but this is default behaviour)
  2. Open configurable product on FO, choose size and add to the basket
  3. Try to open Reports -> Products in Cart

@walrus28
Copy link

Thanks @shreyap26 Your solution worked for me! There were a couple of deleted products in my quote_item table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests