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

Fix order line observer #1732

Merged
merged 4 commits into from
Aug 19, 2024
Merged

Conversation

theimerj
Copy link
Contributor

@theimerj theimerj commented May 8, 2024

Problem

This PR fixes the issue with adding non-eloquent purchasable data types to orders. It was possible to add only shipping type, which was hardcoded.

Solution

If we check if a class implements Purchasable contract instead of checking for type or calling instanceof on already resolved class, we have more general checking mechanism which opens the doors for custom non-eloquent purchasables.

Tests

  • Added tests which prove that any non-eloquent purchasables can be added to orders.

Copy link

vercel bot commented May 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 9:58am

@alecritson alecritson changed the base branch from 0.8 to 1.x August 16, 2024 07:11
@alecritson alecritson changed the base branch from 1.x to 0.8 August 16, 2024 07:11
@alecritson alecritson merged commit 917ff5a into lunarphp:0.8 Aug 19, 2024
13 checks passed
alecritson pushed a commit that referenced this pull request Aug 19, 2024
@alecritson alecritson mentioned this pull request Aug 19, 2024
alecritson added a commit that referenced this pull request Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants