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

Soft delete on product variant causes an error on cart line #2001

Open
jargoud opened this issue Oct 24, 2024 · 0 comments
Open

Soft delete on product variant causes an error on cart line #2001

jargoud opened this issue Oct 24, 2024 · 0 comments
Labels
bug Something isn't working unconfirmed

Comments

@jargoud
Copy link

jargoud commented Oct 24, 2024

Hello,

  • Lunar version: 1.0.0-beta.4
  • Laravel Version: 11.29.0
  • PHP Version: 8.3.12
  • Database Driver & Version: MariaDB 10.6.19

Expected Behaviour:

When soft deleting a product variant added to a cart, the line should be ignored when calculating the cart.

Actual Behaviour:

An error happens:

Lunar\Managers\PricingManager::for(): Argument #1 ($purchasable) must be of type Lunar\Base\Purchasable, null given, called in …/vendor/lunarphp/core/src/Pipelines/CartLine/GetUnitPrice.php on line 37

Steps To Reproduce:

  • Add a product variant to a cart
  • Soft delete the product variant
  • Re-Authenticate with the user
  • Listener Lunar\Listeners\CartSessionAuthListener triggers a calculating for the cart
  • The error happens
@jargoud jargoud added bug Something isn't working unconfirmed labels Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed
Projects
None yet
Development

No branches or pull requests

1 participant