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

Error thrown on empty cart #275

Closed
TracerBuilt opened this issue Aug 6, 2020 · 3 comments
Closed

Error thrown on empty cart #275

TracerBuilt opened this issue Aug 6, 2020 · 3 comments

Comments

@TracerBuilt
Copy link

After installing a new site and updating through 'composer update', if you attempt to navigate to the empty cart in the browser it returns a TypeError stating:

Argument 1 passed to DoubleThreeDigital\SimpleCommerce\Repositories\CartRepository::find() must be of the type string, null given, called in [directory]/rad-ecommerce-store/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 261

@duncanmcclean
Copy link
Owner

Thanks for the information!

Are you navigating to any of the cart or checkout related pages or just the anywhere on the site?

@TracerBuilt
Copy link
Author

The home page runs fine, it's only when clicking the cart link that the error show up.

@duncanmcclean duncanmcclean transferred this issue from duncanmcclean/sc-starter-kit Aug 6, 2020
@duncanmcclean
Copy link
Owner

Fixed in latest release. Also, might want to add this line to the top of your cart & shipping pages so the user is redirected if they don't currently have a cart.

{{ if {sc:cart:has} === false }}
    {{ redirect to='/' }}
{{ /if }}

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

No branches or pull requests

2 participants