-
When using the UserCustomerRepository with a custom model (
I don't believe this is an issue in Simple Commerce but more likely a subtlety in the particular combination of using the UsersRepository AND a custom User model. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Would it make sense for the orders() method in Customer.php to also check if the resource is an instance of Statamic\Auth\Eloquent\User which (if I'm understanding correctly) the User would be if storing users in the DB via Statamic? And then query from the model in that resource? |
Beta Was this translation helpful? Give feedback.
-
Sorry for the delay in getting back to you! I don't have a Simple Commerce site setup with eloquent users... would you be able to add this route to your Route::get('test', function () {
dd(
User::findByEmail('[email protected]')->get('orders')
);
});
Don't worry about that - it should be a Statamic user instance. |
Beta Was this translation helpful? Give feedback.
The issue was my template. I was using the sc:customers tag but with Statamic users I should have used the user tag to output the orders rather than the customers tag. Once I did that everything worked fine. Sorry for the mix up. (Maybe this is worth a mention in the docs where using the Users driver is covered)