feat(skin-info): convert RP to EUR in skin schema

This commit is contained in:
Rico van Zelst
2025-05-16 15:08:47 +02:00
parent 2649a5e8f8
commit 500f7b5e75

View File

@@ -22,6 +22,15 @@
<script type="application/ld+json"> <script type="application/ld+json">
@php @php
$description = $skin->skin_name . " is a " . $skin->rarity . " tier skin for " . $skin->champion->name . " in League of Legends"; $description = $skin->skin_name . " is a " . $skin->rarity . " tier skin for " . $skin->champion->name . " in League of Legends";
$realCurrencyPrice = match (true) {
$skin->rp_price == '99999' => 0,
$skin->rp_price >= 3250 => 25,
$skin->rp_price >= 1820 => 15,
$skin->rp_price >= 1350 => 10,
$skin->rp_price >= 975 => 7.5,
$skin->rp_price >= 520 => 5,
default => 0,
};
if($skin->new_effects) $description .= " with custom visual effects"; if($skin->new_effects) $description .= " with custom visual effects";
if($skin->new_animations) $description .= ", new animations"; if($skin->new_animations) $description .= ", new animations";
@@ -45,8 +54,8 @@
"offers" => [ "offers" => [
"@type" => "Offer", "@type" => "Offer",
"url" => url()->current(), "url" => url()->current(),
"priceCurrency" => "RP", "priceCurrency" => "EUR",
"price" => $skin->rp_price == '99999' ? '' : $skin->rp_price, "price" => $skin->rp_price == '99999' ? '' : $realCurrencyPrice,
"priceValidUntil" => date('Y-m-d', strtotime('+1 year')), "priceValidUntil" => date('Y-m-d', strtotime('+1 year')),
"availability" => $skin->availability == 'Available' "availability" => $skin->availability == 'Available'
? 'https://schema.org/InStock' ? 'https://schema.org/InStock'