duncanmcclean / simple-commerce

A simple, yet powerful e-commerce addon for Statamic.
https://statamic.com/addons/duncanmcclean/simple-commerce
Other
146 stars 40 forks source link

[6.x] Fix querying `data` in Eloquent Query Builders #1004

Closed duncanmcclean closed 7 months ago

duncanmcclean commented 7 months ago

This pull request fixes an issue where queries like Order::query()->where('hello', 'world')->get() would error when using Database Orders.

This was happening since the query builders were querying as if hello was a real column. However, we store a lot of things inside the data JSON column.

This PR fixes that for both the order & customer query builders to ensure if a column doesn't exist matching the provided column name, it'll instead query against the data column.

Fixes #1002.

github-actions[bot] commented 7 months ago

Released as part of v6.0.4.