Closed ghost closed 5 years ago
Thanks for posting the issue, @mikewink! I believe I created the setting because there isn't an explicit way to get active currencies from the Snipcart API. The setting should obviously be saved though, so I'll get that fixed.
If there is no way to get it from Snipcart, could we maybe have a simple key/value field and add it ourselves? 🤔
Multi-currency support is something that's on my plugin roadmap but unfortunately not part of v1.
Right now that plugin setting is there to clarify what currency symbol should be displayed in the control panel when one isn't explicitly provided with a Snipcart record. Plugin-generated buy buttons will use a currency-agnostic number for the price, which Snipcart will interpret according to whatever default currency is set for the store (in its dashboard).
You can, however, define multiple currencies per item in its frontend definition if you'd like. Instead of using a single numeric value for the item's price, like data-item-price="20"
, you would use a JSON array such as data-item-price='{"usd": 20, "eur": 17.79}'
.
@mikewink I've fixed the not-saving bug for 1.0.4 and included the ability to override the product prices at the template level, so something like this is possible:
{{ productInfo.getBuyNowButton({
price: { 'usd': 20, 'eur': 17.79 },
}) | raw }}
Going to hop over to #5 and see if I can work that in before testing and publishing this release. You're welcome to check out the 1.0.4 branch if you'd like to poke at it. Again, thanks for the feedback! :)
Saving works just fine now.
And having the option to override is great and opens up some options to work with on-demand currency conversions.
Thank you, Matt.
Describe the bug
The currency dropdown does not get saved.
To Reproduce Steps to reproduce the behaviour:
admin/settings/plugins/snipcart
Expected behaviour When I switch from USD to EUR and save the page, I expect to see EUR the next time I visit the settings page.
Desktop (please complete the following information):
Improvement
Would it be possible to read the activated currencies from Snipcart and use them for the dropdown?