diff --git a/migrations/Version20260116125355.php b/migrations/Version20260116125355.php new file mode 100644 index 0000000..ddee10b --- /dev/null +++ b/migrations/Version20260116125355.php @@ -0,0 +1,32 @@ +addSql('ALTER TABLE product ADD product_id VARCHAR(255) DEFAULT 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 DROP product_id'); + } +} diff --git a/src/Entity/Product.php b/src/Entity/Product.php index 5a25833..e057099 100644 --- a/src/Entity/Product.php +++ b/src/Entity/Product.php @@ -49,6 +49,9 @@ class Product #[ORM\Column(nullable: true)] private ?\DateTimeImmutable $updatedAt = null; + #[ORM\Column(length: 255, nullable: true)] + private ?string $productId = null; + public function getId(): ?int { return $this->id; @@ -173,4 +176,16 @@ class Product { return $this->imageSize; } + + public function getProductId(): ?string + { + return $this->productId; + } + + public function setProductId(?string $productId): static + { + $this->productId = $productId; + + return $this; + } } diff --git a/templates/product/products.twig b/templates/product/products.twig index 2c03072..5c353d9 100644 --- a/templates/product/products.twig +++ b/templates/product/products.twig @@ -44,28 +44,43 @@ {# CONTENU #}
- {# REF, NOM #} + {# REF, NOM & STRIPE SYNC #}

{{ product.ref }}

-

+

{{ product.name }}

+ + {# ETAT SYNCHRO STRIPE (Même style que Client) #} +
+ {% if product.productId %} +
+ + Stripe synchronisé +
+ {% else %} +
+ + Non synchronisé Stripe +
+ {% endif %} +
{# GRILLE TARIFS (priceDay & priceSup) #}
-
+

Prix Journée

{{ product.priceDay|number_format(2, ',', ' ') }}€

-
+

Jour Sup.

{{ product.priceSup|number_format(2, ',', ' ') }}€

{# CAUTION & INSTALLATION #} -
+
@@ -86,19 +101,19 @@ {# ACTIONS #}
- {# Bouton Modifier (Redirection vers la fiche) #} + {# Bouton Modifier #} - Modifier le produit + Modifier - {# Bouton Supprimer (Identique aux clients) #} + {# Bouton Supprimer #}
{% else %} -
-
- -
-

Le catalogue est actuellement vide

-
+ {# ... vide ... #} {% endfor %}