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

Added the ability to pass the channel to the StorefrontSessionManager #2077

Closed
wants to merge 1 commit into from

Conversation

chrispage1
Copy link

Currently, when the StorefrontSessionManager is initialised, there is no way of setting the defaults.

In my use case, I'm determining the channel based on the URL structure and market that is defined (separate to Lunar).

So in my middleware, I want to initialise the storefront with the channel but there isn't actually a way to do this. This adds the option to supply a channel

Copy link

vercel bot commented Jan 23, 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 4:19pm

@alecritson
Copy link
Collaborator

Thanks @chrispage1 I don't imagine this would be required since you should be able to do:

\Lunar\Facades\StorefrontSession::setChannel('webstore');
\Lunar\Facades\StorefrontSession::setChannel(
    \Lunar\Models\Channel::first()
);

or if you're worried about the default channel being set beforehand you can manually set the channel in the session

Session::put(\Lunar\Facades\StorefrontSession::getSessionKey().'_channel', 'webstore');

@alecritson alecritson closed this Feb 13, 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.

2 participants