Aggiorna marketing: prezzi lancio, Funzionalità narrativa e link store.

Allinea i piani Light/Full ai prezzi di lancio, ripensa /funzionalita per vendere il prodotto e aggiunge i badge App Store/Play nella home.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-14 23:00:17 +02:00
co-authored by Cursor
parent bc2257efd2
commit 3ed70b6999
42 changed files with 2115 additions and 266 deletions
@@ -5,9 +5,13 @@ module Billing
AMOUNT_HINTS = {
500 => %w[premium_light monthly],
790 => %w[premium_light monthly],
4000 => %w[premium_light yearly],
5900 => %w[premium_light yearly],
2000 => %w[premium_full monthly],
20_000 => %w[premium_full yearly]
2490 => %w[premium_full monthly],
20_000 => %w[premium_full yearly],
19_900 => %w[premium_full yearly]
}.freeze
class << self
@@ -23,10 +23,11 @@ module Billing
def button_label(plan:, interval:, kind:)
price = PriceCatalog.label(plan_slug: plan.slug, interval: interval)
name = I18n.t("pages.plans.cta_name.#{plan.slug}", default: plan.name)
if kind == :checkout
I18n.t("billing.messages.activate_button", plan: plan.name, price: price)
I18n.t("billing.messages.activate_button", plan: name, price: price)
else
I18n.t("billing.messages.switch_button", plan: plan.name, price: price)
I18n.t("billing.messages.switch_button", plan: name, price: price)
end
end
@@ -4,9 +4,16 @@ module Billing
INTERVALS = %w[monthly yearly].freeze
DEFAULT_INTERVAL = "yearly"
PRICING = {
"premium_light" => { "yearly" => "€40/anno", "monthly" => "€5/mese" },
"premium_full" => { "yearly" => "€200/anno", "monthly" => "€20/mese" }
# Importi in centesimi (EUR). Il yearly è il prezzo lancio addebitato.
AMOUNTS = {
"premium_light" => {
"yearly" => { charge: 5900, list: 7900, equivalent_monthly: 492 },
"monthly" => { charge: 790 }
},
"premium_full" => {
"yearly" => { charge: 19_900, list: 24_900, equivalent_monthly: 1658 },
"monthly" => { charge: 2490 }
}
}.freeze
class << self
@@ -30,7 +37,23 @@ module Billing
end
def label(plan_slug:, interval:)
PRICING.dig(plan_slug.to_s, normalize_interval(interval)) || normalize_interval(interval)
interval = normalize_interval(interval)
format_interval_price(charge_cents(plan_slug, interval), interval)
end
def list_label(plan_slug:, interval: "yearly")
interval = normalize_interval(interval)
cents = list_cents(plan_slug, interval)
return nil if cents.blank?
format_interval_price(cents, interval)
end
def equivalent_monthly_label(plan_slug:)
cents = AMOUNTS.dig(plan_slug.to_s, "yearly", :equivalent_monthly)
return nil if cents.blank?
format_interval_price(cents, "monthly")
end
def available_intervals(plan_slug:)
@@ -52,8 +75,33 @@ module Billing
nil
end
def format_eur(cents)
cents = cents.to_i
whole, frac = cents.divmod(100)
if frac.zero?
"#{whole}"
else
sep = I18n.locale.to_s == "en" ? "." : ","
"#{whole}#{sep}#{frac.to_s.rjust(2, '0')}"
end
end
private
def charge_cents(plan_slug, interval)
AMOUNTS.dig(plan_slug.to_s, interval, :charge)
end
def list_cents(plan_slug, interval)
AMOUNTS.dig(plan_slug.to_s, interval, :list)
end
def format_interval_price(cents, interval)
return nil if cents.blank?
I18n.t("billing.prices.#{interval}", amount: format_eur(cents))
end
def price_id_for(plan_slug, interval)
case [plan_slug, interval]
when %w[premium_light monthly]