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

Queries for listing active Payment and Shipping Methods #3312

Open
apoca opened this issue Jan 9, 2025 · 1 comment
Open

Queries for listing active Payment and Shipping Methods #3312

apoca opened this issue Jan 9, 2025 · 1 comment
Labels

Comments

@apoca
Copy link

apoca commented Jan 9, 2025

Is your feature request related to a problem? Please describe.

Yes, currently in Vendure, it is only possible to access the active PaymentMethods and ShippingMethods during the cart or checkout process. This limitation creates an issue for e-commerce websites that want to display available payment and shipping options on static pages like the footer or other sections of the site. For instance, it is common in e-commerce stores to show payment logos (e.g., Visa, Mastercard, PayPal) or shipping partners (e.g., DHL, UPS) in the footer for information purposes.

The current workflow forces us to hardcode these methods in the frontend, which leads to maintenance challenges. If a method is deactivated or removed in the backend, it will not reflect on the frontend unless the code is manually updated. This is inefficient and can lead to discrepancies between the backend configuration and what is displayed to users.

Describe the solution you'd like

I propose adding two public GraphQL queries in the Vendure core:

1.	activePaymentMethods – Returns a list of all active PaymentMethods.
2.	activeShippingMethods – Returns a list of all active ShippingMethods.

These queries would allow frontend developers to dynamically fetch and display the current active methods without requiring access to the cart or checkout state. This would ensure consistency between the backend configuration and the frontend display, reducing the need for manual intervention when changes are made.

Describe alternatives you've considered

1.	Hardcoding Methods in the Frontend: As mentioned, hardcoding active methods in the frontend is a workaround but introduces maintainability challenges. It creates a risk of outdated information being shown to customers.
2.	Custom Plugin: A custom plugin could expose these queries, but this feels like a core feature since it benefits most Vendure users by addressing a common e-commerce use case.

Additional context

Having access to these queries would enhance the developer experience, making it easier to build dynamic and accurate frontends. It would also improve the overall consistency of e-commerce sites built on Vendure.

@michaelbromley michaelbromley moved this to 👀 Under consideration in Vendure OS Roadmap Jan 11, 2025
@michaelbromley michaelbromley added @vendure/core P4: low Non-critical, workarounds exist labels Jan 11, 2025
@apoca
Copy link
Author

apoca commented Jan 13, 2025

@michaelbromley if you want I can try do a PR with this. I only need to know where I should create the resolvers for this queries... I think we can solve this by using the actual services!?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 👀 Under consideration
Development

No branches or pull requests

2 participants