I'm building in Ubercart the ability to sell membership subscriptions. So far, so good, but now I want to apply a discount of 33% to the price of a subs based on the country (from billing address) of the buyer.
In Drupal 7 this was done using Commerce with commerce_product_pricing, which allowed a Rule to apply a calculation (multiplication) to provide a percentage discount.
I've tried this using the Rules Action 'Calculate a value' which takes 'input value 1' (the price) and multiplies it by 'input value 2' (the discount = 0.333).
However, 'input value 2' can only be an integer. While writing this I realised I could instead divide by 3 to get the correct result (this worked, so I've left this detail here in case anyone else has this problem).
So all I need is to get Rules to identify the buyer's country from their billing address so I can block the purchase if their country is not in the list where the discount applies. However, if I add the Rule to trigger on checkout completion, and manage to obtain the billing address, I can't see how to stop the purchase from completing.
Currently trying to extract the Billing address country in Rules leads to this error:
Error: Call to undefined function entity_metadata_field_verbatim_get() in EntityStructureWrapper->getPropertyValue()
I'm clearly doing this wrong! Any suggestions gratefully received.