-
Notifications
You must be signed in to change notification settings - Fork 22
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
Potential errors and performance issues in Tracker/InitiateCheckout #72
Comments
Fourth logic error I noticed...
You guys overwrite categoryNames for each item in the loop, so as a result you only get category names from the last item in the quote. |
Also FYI - This is what that SQL error log looks like. #0 /home/jetrails/XXXX/html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php(89): Magento\Framework\DB\Statement\Pdo\Mysql->tryExecute(Object(Closure)) |
This has been fixed in v1.3.3. Please let us know if this becomes an issue again. Thanks! |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Basically what's going on is
` private function getCartCategories(CartInterface $quote): string
{
if (!$quote) {
return '';
}
In this code -
It's assumed that the quote item is in a category. This should be checked prior to doing this query.
Second, this is a query in a loop. You could easily aggregate the category IDs and do the query after.
Third, you're selecting ALL attributes even though you only use name. It's a best practice in Magento to only fetch the attributes you actually need.
The text was updated successfully, but these errors were encountered: