{%- liquid assign show_unit_price = show_unit_price | default: false assign show_sale_price_first = show_sale_price_first | default: false assign selected_variant = product_resource.selected_or_first_available_variant # --- PENGATURAN KURS MANUAL --- assign manual_usd_rate = 16000.00 assign price_raw = selected_variant.price assign compare_at_price_raw = selected_variant.compare_at_price if product_resource == blank assign price_raw = 199900 endif # Cek apakah market selain Indonesia assign is_intl = false if localization.country.iso_code != 'ID' assign is_intl = true endif # Formatting & Kalkulasi Nilai if is_intl # 1. Ubah ke float dengan times: 1.0 # 2. Bagi dengan Kurs # 3. Bagi 100 karena Shopify menggunakan satuan cents assign converted_price = price_raw | times: 1.0 | divided_by: manual_usd_rate | divided_by: 100.0 # Gunakan round: 2 untuk membulatkan desimal assign price = converted_price | round: 2 | prepend: '$' | append: ' USD' if compare_at_price_raw > price_raw assign converted_compare = compare_at_price_raw | times: 1.0 | divided_by: manual_usd_rate | divided_by: 100.0 assign compare_at_price = converted_compare | round: 2 | prepend: '$' | append: ' USD' endif else # Jika Indonesia, gunakan format standar Shopify (IDR) assign price = price_raw | money assign compare_at_price = compare_at_price_raw | money endif # Logika Menampilkan Compare Price assign show_compare_price = false if compare_at_price_raw > price_raw assign show_compare_price = true endif -%}
{% if show_sale_price_first == false and show_compare_price %} {{ 'content.price_regular' | t }}  {{- compare_at_price -}} {% endif %} {% if show_compare_price %} {{ 'content.price_sale' | t }}  {{ price | default: ' ' }} {% else %} {{ price | default: ' ' }} {% endif %} {% if show_sale_price_first == true and show_compare_price %} {{ 'content.price_regular' | t }}  {{- compare_at_price -}} {% endif %}