We run a US based store with some international customers.
Recently we ran a promotion via Line Item Script, but received an error specifically for international customers. In one instance, the same customer received the error when trying to ship to an international address, but was able to successfully receive the script discount when shipping to a domestic location.
Relevant section of the script is:
if line_item.variant.product.tags.include?(PROMO_TAG_2) line_item.change_line_price( line_item.variant.compare_at_price * line_item.quantity * (Decimal.new(1) - PROMO_DISCOUNT_2 / 100), message: PROMO_MESSAGE, ) end
In this case, PROMO_DISCOUNT_2 = 50.
The error received was:
undefined method '*' for nil
Is line_item.change_line_price unavailable when dealing with, for example, customers using local currency?
Any idea why this script might work when shipping to the USA, but not to Slovakia?