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

Query helpers #24

Open
sjelfull opened this issue Nov 23, 2022 · 0 comments
Open

Query helpers #24

sjelfull opened this issue Nov 23, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@sjelfull
Copy link
Member

sjelfull commented Nov 23, 2022

Is your feature request related to a problem? Please describe.
It would be awesome if we could have query helpers for common tasks where it would require you to either opt for very unoptimized queries (if even possible for a big chunk of people to write), or to write manual SQL queries.

Examples:

  • Does anyone know if it's possible to query order line items by their status? Am trying to put together a report of any ordered items that have a "Back Ordered" status and am struggling to find any documentation on it. The end goal is a page/report/daily email summary of any items with X status where there's actually some in stock. The idea is to solve the issue of long term out of stock items coming in to stock and noone realising there's an outstanding order for them

Describe the solution you'd like
Something like query helpers that look like this: ```twig
{% set query = craft.commerce.orders().withLineItems().withProductStatus('Back Ordered') %}


Or perhaps Twig filters. We will see.

**Describe alternatives you've considered**
No alternatives exist today.
@sjelfull sjelfull added the enhancement New feature or request label Nov 23, 2022
@sjelfull sjelfull self-assigned this Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant