Add cart_rule column total_quantity#1693
Open
jolelievre wants to merge 1 commit into
Open
Conversation
Contributor
jolelievre
commented
Mar 4, 2026
| Questions | Answers |
|---|---|
| Description? | Add cart_rule column total_quantity, related to PrestaShop/PrestaShop#40830 |
| Type? | improvement |
| BC breaks? | no |
| Deprecations? | no |
| Fixed ticket? | ~ |
| Sponsor company | ~ |
| How to test? | ~ |
|
jolelievre
commented
Mar 6, 2026
Contributor
|
any news about that still the PR has been merged ? (Rebase needed) |
94189b7 to
c772fea
Compare
Contributor
Author
|
@ga-devfront yes the PR was merged, I didin't find the time to finish this one though, the structure is ok But I also need to compute extra data |
c772fea to
56967f5
Compare
Contributor
Author
|
@ga-devfront all good now |
56967f5 to
51f1906
Compare
|
Comment on lines
+15
to
+16
| LEFT JOIN ( | ||
| SELECT ocr.`id_cart_rule`, COUNT(*) as quantity_used |
Member
There was a problem hiding this comment.
I'm wondering the impact of having a nest subquery when running it on large tables.
Member
There was a problem hiding this comment.
Look fine
+------+-------------+------------------+--------+-----------------------+---------+---------+-----------------------------+------+----------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+------------------+--------+-----------------------+---------+---------+-----------------------------+------+----------------------------------------------+
| 1 | PRIMARY | cr | ALL | NULL | NULL | NULL | NULL | 1 | Using where |
| 1 | PRIMARY | <derived2> | ref | key0 | key0 | 5 | psreference.cr.id_cart_rule | 2 | |
| 2 | DERIVED | ocr | ALL | id_order,id_cart_rule | NULL | NULL | NULL | 1 | Using where; Using temporary; Using filesort |
| 2 | DERIVED | o | eq_ref | PRIMARY,current_state | PRIMARY | 4 | psreference.ocr.id_order | 1 | Using where |
| 3 | SUBQUERY | ks_configuration | ref | name | name | 1018 | const | 1 | Using where |
+------+-------------+------------------+--------+-----------------------+---------+---------+-----------------------------+------+----------------------------------------------+
We don't have a DEPENDENT SUBQUERY in the list. The subrequest is made once.
Quetzacoalt91
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


