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

Warn/block member from buying lab membership if person does not have yearly membership #179

Open
emanuelen5 opened this issue Sep 25, 2021 · 11 comments · May be fixed by #525
Open

Warn/block member from buying lab membership if person does not have yearly membership #179

emanuelen5 opened this issue Sep 25, 2021 · 11 comments · May be fixed by #525
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers public Relating to the public interface (shop/member view)

Comments

@emanuelen5
Copy link
Member

Current behaviour

Member can buy yearly membership and lab membership independently of each other.

Wanted behaviour

Member should be warned or blocked from buying lab membership if they do not have active yearly membership

@emanuelen5 emanuelen5 added enhancement New feature or request public Relating to the public interface (shop/member view) labels Sep 25, 2021
@nitro2k01
Copy link
Contributor

How is this currently handled on the key extension side? Will the key automatically be extended even the person doesn't have a yearly membership?

@emanuelen5
Copy link
Member Author

How is this currently handled on the key extension side? Will the key automatically be extended even the person doesn't have a yearly membership?

Yes, it will be extended regardless of yearly membership status.

@emanuelen5 emanuelen5 added the good first issue Good for newcomers label Jun 6, 2022
@BerglundDaniel
Copy link
Member

Hasn't this been fixed with @HalfVoxel changes with subscriptions?

@velaco
Copy link
Contributor

velaco commented May 9, 2024

@BerglundDaniel It has not been fixed yet, I was able to purchase one month of lab access without a base membership. Will take this one to fix

@velaco velaco self-assigned this May 9, 2024
@velaco
Copy link
Contributor

velaco commented May 9, 2024

Correction: it is possible to buy labaccess without base membership, but once it is done, there will be a warning saying that the person needs to buy the base membership. The lab access subscription will not start until that is done, so that is nice.

Is that fine or do we want to make other changes here?

@HalfVoxel
Copy link
Contributor

If you want to do this, the relevant thing to do would be to add a filter: https://github.com/makerspace/makeradmin/blob/master/api/src/shop/filters.py

@velaco
Copy link
Contributor

velaco commented May 9, 2024

Looking at the code, filters are applied per product, so if we don't allow buying lab access when there is no active base membership, we will also disallow buying them both at the same time 😢

Alternative is to check if there is an attempt to purchase lab access without a base membership, which can be done once the function processes all products in the cart individually

@HalfVoxel
Copy link
Contributor

Right. That makes sense. Annoying. Probably why there's no filter already :p

@velaco
Copy link
Contributor

velaco commented May 9, 2024

Best solution would probably be to sort out #207 first. If the cart is on backend, we can validate contents earlier, before payment is attempted

@HalfVoxel
Copy link
Contributor

You can validate contents at the same time as the filters are run anyway. They are run on the backend.

@velaco
Copy link
Contributor

velaco commented May 9, 2024

Yes, that is the best place for now. I will put it there, and it can be moved with the cart later.

@velaco velaco linked a pull request May 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers public Relating to the public interface (shop/member view)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants