✨ feat(produit): Améliore l'affichage des prix et ajoute des options de prix supplémentaires.
This commit is contained in:
32
migrations/Version20260127085400.php
Normal file
32
migrations/Version20260127085400.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20260127085400 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE product ALTER dim_w DROP NOT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE SCHEMA public');
|
||||
$this->addSql('ALTER TABLE product ALTER dim_w SET NOT NULL');
|
||||
}
|
||||
}
|
||||
32
migrations/Version20260127085439.php
Normal file
32
migrations/Version20260127085439.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20260127085439 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE product ALTER price_sup DROP NOT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE SCHEMA public');
|
||||
$this->addSql('ALTER TABLE product ALTER price_sup SET NOT NULL');
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ class ReserverController extends AbstractController
|
||||
#[Route('/reservation', name: 'reservation')]
|
||||
public function revervation(ProductRepository $productRepository): Response
|
||||
{
|
||||
$products =$productRepository->findBy([], ['updatedAt' => 'DESC']);
|
||||
$products =$productRepository->findBy([], ['updatedAt' => 'DESC'],3);
|
||||
return $this->render('revervation/home.twig',[
|
||||
'products' => $products
|
||||
]);
|
||||
|
||||
@@ -33,7 +33,7 @@ class Product
|
||||
#[ORM\Column]
|
||||
private ?float $priceDay = null;
|
||||
|
||||
#[ORM\Column]
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?float $priceSup = null;
|
||||
|
||||
#[ORM\Column]
|
||||
@@ -78,7 +78,7 @@ class Product
|
||||
#[ORM\OneToMany(targetEntity: ProductDoc::class, mappedBy: 'product')]
|
||||
private Collection $productDocs;
|
||||
|
||||
#[ORM\Column]
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?float $dimW = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
|
||||
@@ -55,8 +55,7 @@ class ProductType extends AbstractType
|
||||
'html5' => true,
|
||||
])
|
||||
->add('priceSup',NumberType::class,[
|
||||
'label' => 'Prix Suplémentaire',
|
||||
'required' => true,
|
||||
'required' => false,
|
||||
'html5' => true,
|
||||
])
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
{% block actions %}
|
||||
<div class="flex items-center gap-4">
|
||||
{% if product.slug != "" %}
|
||||
<a target="_blank" rel="nofollow"
|
||||
href="https://reservation.ludikevent.fr{{ path('reservation_product_show', {id: product.slug}) }}"
|
||||
class="flex items-center px-6 py-3 bg-white/5 hover:bg-white/10 border border-white/10 hover:border-blue-500/50 text-white text-[10px] font-black uppercase tracking-[0.2em] rounded-2xl transition-all group shadow-xl backdrop-blur-md">
|
||||
@@ -20,6 +21,7 @@
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"/>
|
||||
</svg>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
@@ -163,7 +165,7 @@
|
||||
{# PRIX LOCATION #}
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
{{ form_label(form.priceDay, 'Tarif 1er Jour (€)', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-widest ml-1 mb-2 block'}}) }}
|
||||
{{ form_label(form.priceDay, 'Tarif 1er Jour (€) Ou Tarif weekend (si Barnums)', {'label_attr': {'class': 'text-[10px] font-black text-slate-500 uppercase tracking-widest ml-1 mb-2 block'}}) }}
|
||||
<div class="relative">
|
||||
{{ form_widget(form.priceDay, {'attr': {'class': 'w-full bg-slate-900/50 border-white/5 rounded-2xl text-emerald-400 font-black text-xl focus:ring-emerald-500/20 focus:border-emerald-500 transition-all py-4 px-5'}}) }}
|
||||
<span class="absolute right-5 top-1/2 -translate-y-1/2 text-slate-600 font-bold">€HT</span>
|
||||
|
||||
@@ -80,8 +80,12 @@
|
||||
|
||||
{# PRIX #}
|
||||
<div class="absolute top-5 right-5 bg-white/95 backdrop-blur-md px-4 py-2 rounded-2xl shadow-md border border-slate-100">
|
||||
<p class="text-slate-900 font-black text-lg italic leading-none">
|
||||
A partir de {{ product.priceDay }}€ / Jour
|
||||
<p class="text-slate-900 font-black text-sm italic leading-none">
|
||||
{% if product.category == "barnums" %}
|
||||
A partir de {{ product.priceDay|format_currency('EUR') }} / Week-End
|
||||
{% else %}
|
||||
A partir de {{ product.priceDay|format_currency('EUR') }} / Jour
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -151,7 +151,11 @@
|
||||
|
||||
{# Badge Prix flottant #}
|
||||
<div class="absolute top-5 left-5 bg-white/95 backdrop-blur-md px-4 py-2 rounded-2xl shadow-sm border border-white/50">
|
||||
<p class="text-[9px] font-black text-gray-600 uppercase tracking-widest mb-0.5">Location / Jour</p>
|
||||
{% if product.category == "barnums" %}
|
||||
<p class="text-[9px] font-black text-gray-600 uppercase tracking-widest mb-0.5">Week-End</p>
|
||||
{% else %}
|
||||
<p class="text-[9px] font-black text-gray-600 uppercase tracking-widest mb-0.5">Jour</p>
|
||||
{% endif %}
|
||||
<p class="text-[#0782bc] font-black text-sm uppercase leading-none">
|
||||
Dès {{ product.priceDay|format_currency('EUR') }}
|
||||
</p>
|
||||
|
||||
@@ -109,18 +109,24 @@
|
||||
<div class="flex flex-col items-center md:items-start space-y-6">
|
||||
{# Prix principal #}
|
||||
<div class="flex flex-col md:flex-row items-center md:items-baseline gap-2 md:gap-4 text-center md:text-left">
|
||||
<span class="text-6xl md:text-7xl font-black text-[#f39e36] leading-none">{{ product.priceDay }}€</span>
|
||||
<span class="text-6xl md:text-7xl font-black text-[#f39e36] leading-none">{{ product.priceDay|format_currency('EUR') }}</span>
|
||||
{% if product.category == "barnums" %}
|
||||
<span class="text-[10px] md:text-sm font-bold text-slate-400 uppercase tracking-widest italic">Week-End</span>
|
||||
{% else %}
|
||||
<span class="text-[10px] md:text-sm font-bold text-slate-400 uppercase tracking-widest italic">La première journée</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Grille de badges Tarifs/Caution #}
|
||||
<div class="flex flex-wrap justify-center md:justify-start gap-3 w-full">
|
||||
{% if product.category != "barnums" %}
|
||||
<div class="flex items-center gap-3 bg-slate-50 px-5 py-3 rounded-2xl border border-slate-100 shadow-sm">
|
||||
<span class="text-xl md:text-2xl font-black text-slate-900 italic">+ {{ product.priceSup }}€</span>
|
||||
<span class="text-xl md:text-2xl font-black text-slate-900 italic">+ {{ product.priceSup|format_currency('EUR') }}€</span>
|
||||
<span class="text-[9px] font-black text-slate-400 uppercase tracking-widest italic">Jour supplémentaire</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="flex items-center gap-3 bg-slate-50 px-5 py-3 rounded-2xl border border-slate-100 shadow-sm">
|
||||
<span class="text-xl md:text-2xl font-black text-slate-900 italic">{{ product.caution }}€</span>
|
||||
<span class="text-xl md:text-2xl font-black text-slate-900 italic">{{ product.caution|format_currency('EUR') }}</span>
|
||||
<span class="text-[9px] font-black text-slate-400 uppercase tracking-widest italic">LA CAUTION</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user