This PR fixes the issues outlined in Issue #72. It fixes the query-in-a-loop anti-pattern, the assumption that all items in a quote will be in a category (Which can cause a SQL error), the logic error where the category name array is overwritten for each item in the loop.
Bug
75 <Potential errors and performance issues in Tracker/InitiateCheckout>
Fixed Issues (if relevant)
magento-commerce/facebook-for-magento2#<72>: Potential errors and performance issues in Tracker/InitiateCheckout
Manual testing scenarios (*)
Create an item that has no categories, add it to the cart and check out. No error should occur.
Checklist
[X] Pull request has a meaningful description of its purpose
[X] All commits are accompanied by meaningful commit messages
[X] All new or changed code is covered with unit/integration tests (if applicable)
[x] All automated tests passed successfully (all builds are green)
Description (*)
This PR fixes the issues outlined in Issue #72. It fixes the query-in-a-loop anti-pattern, the assumption that all items in a quote will be in a category (Which can cause a SQL error), the logic error where the category name array is overwritten for each item in the loop.
Bug
Fixed Issues (if relevant)
Manual testing scenarios (*)
Checklist