You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@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!?
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:
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
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.
The text was updated successfully, but these errors were encountered: