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

API support #669

Open
rpmcmurphy opened this issue May 22, 2022 · 2 comments
Open

API support #669

rpmcmurphy opened this issue May 22, 2022 · 2 comments

Comments

@rpmcmurphy
Copy link

Does the package work through API endpoints? I tried with Postman and Sanctum. Seems like Add to cart works and returns rowId properly but once contents of the cart is requested, nothing is returned. isSaved param is false when items are added.

    `"8aba6628cc50563aa69002b76af27473": {
        "rowId": "8aba6628cc50563aa69002b76af27473",
        "id": "123ABC",
        "name": "Hello product",
        "qty": 2,
        "price": 9.99,
        "options": [],
        "tax": "0.00",
        "isSaved": false,
        "subtotal": "19.98"
    }`
@bumbummen99
Copy link

bumbummen99 commented May 22, 2022

No this package does store the cart content in session while the cart is loaded and api has no session. There is a refactor branch where i am currently trying to rewrite it to always store cart content in database & to use pagination - that would make it compatible with API scenario.

Edit: Sorry tought this is a issue in my fork, anyways talkin about this PR's
bumbummen99#145
bumbummen99#148

@rpmcmurphy
Copy link
Author

I was implementing an API with the package and found this out. Is the PR (https://github.com/bumbummen99/LaravelShoppingcart) you did production-ready? Need this badly at this point of the project. Wasn't aware of the session part before I started developing the app version of the project.

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