Single Delivery Provider with multiple prices?
Posted: 21 Nov 2015, 00:17
Is there a simple way to build a drop-down on the checkout page to allow the user to select a particular delivery service?
I can easily build a select box based on multiple providers by changing the radio selects to a select drop-down. What I need to do is display a drop-down of multiple services from a single provider.
I'd like to write a single Service/Provider/Delivery implementation that returns multiple prices. I want to then display a drop-down to the user with, for example: UPS Ground - 3.54, UPS 2nd Day - 5.72, UPS Overnight - 9.23 and let them select the service they'd like to use.
I'm not seeing a simple way to implement something like that. I see a way to have each of those 3 be a different provider in the admin interface but that would result in 3 calls to the back-end API instead of a single call that can retrieve all 3 prices.
Is it as simple as building an array in the provider implementation and adding a getPrices() method (or something similar) to use in the basket view? I'm not sure how to name the select drop-down, if so, such that the correct user selection makes it into the database.
Basically, I'm trying to not have to rewrite any of the checkout processing code if I don't have to. I'd rather be able to simply write a provider implementation and tweak the view to deal with the multiple options from that single provider.
Can you point me in the right direction?
I can easily build a select box based on multiple providers by changing the radio selects to a select drop-down. What I need to do is display a drop-down of multiple services from a single provider.
I'd like to write a single Service/Provider/Delivery implementation that returns multiple prices. I want to then display a drop-down to the user with, for example: UPS Ground - 3.54, UPS 2nd Day - 5.72, UPS Overnight - 9.23 and let them select the service they'd like to use.
I'm not seeing a simple way to implement something like that. I see a way to have each of those 3 be a different provider in the admin interface but that would result in 3 calls to the back-end API instead of a single call that can retrieve all 3 prices.
Is it as simple as building an array in the provider implementation and adding a getPrices() method (or something similar) to use in the basket view? I'm not sure how to name the select drop-down, if so, such that the correct user selection makes it into the database.
Basically, I'm trying to not have to rewrite any of the checkout processing code if I don't have to. I'd rather be able to simply write a provider implementation and tweak the view to deal with the multiple options from that single provider.
Can you point me in the right direction?