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

Addition of getCartQuantity method on the CartSessionManager #2072

Open
wants to merge 3 commits into
base: 1.x
Choose a base branch
from

Conversation

chrispage1
Copy link

@chrispage1 chrispage1 commented Jan 21, 2025

This PR contains two updates to the CartSessionManager class

  1. Abstraction of cart ID retrieval so anyone can get the current cart ID

  2. Addition of a getCartQuantity method which will allow fetching the current quantity of all line items with minimal queries.

  3. Addition of onlyVisible to the customerGroups scope to be able to limit products down based on visibility

The reason for this addition is that to load the basket quantity at the top of the page uses lots more queries than is necessary, if I am indeed simply fetching the basket quantity.

I have also added a test for this.

Thanks!

Copy link

vercel bot commented Jan 21, 2025

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 Jan 23, 2025 11:10am

@chrispage1 chrispage1 changed the title Cp updates Addition of getCartQuantity method on the CartSessionManager Jan 21, 2025
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.

1 participant