Is there any way to make something like this? (pho...
# support
j
Is there any way to make something like this? (photo in thread) work with multiple currencies?
because i'm trying to use a match all, instead of a match any, i can only specify a single currency, which means i'd need to make one of these codes per currency?
j
Yeah. I’ve seen stores implement multi currency versions of these rules.
j
got it yeah i was just giving a shot overriding
return false unless order.currency == preferred_currency
in the rule, but it will leave the currency as shrapnel on the screen there -- thought there might be another way
b
I would ask about the multi-currency complications in the ticket. If the product is in CAD, how should this rule behave?
For the rule, am I selecting only the prices on the variant and then doing a simple > or do they need me to convert the pricing to EUR and then do the check?
j
for sure, well really, i don't understand why solidus only allows one rule on the left in general, in the actions you can specify actions for different currencies and it selects the correct action for the current currency
but in the left you can only add each rule one time, which seems a design flaw? It would be fine to have multiple of the same rule and still apply the same logic to check if a promotion should or shouldn't apply
b
I noticed that 10 years ago when I started working with Spree.
Doesn't seem to bother me too much. Rules people need are often coded anyways.
j
yeah if you can code it's not a massive issue since adding rules isn't too troublesome
but still, it could be a lot more "flexible" if you could apply the same rule type multiple times which might be as simple as changing as a UI change (haven't looked at the model) but i assume the relationships is already has_many
k
that sounds like a good idea. maybe a bit of git blaming might reveal if there’s a reason for being as it is. Otherwise seems like a good change
👍 1