From 649bf62430231b08921f56d5cd2dde58d59bfd64 Mon Sep 17 00:00:00 2001 From: Isabelle Date: Mon, 22 Jun 2026 13:28:47 +0200 Subject: [PATCH] fix(main): Task #3 in readme complete --- README.md | 11 ----------- src/Module/DisplayHooks.php | 2 +- ws_giftdropdown.php | 4 ++-- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 7c0ec7f..33cc821 100644 --- a/README.md +++ b/README.md @@ -44,15 +44,4 @@ Todo: {/if} ``` -3.) Make this translatable in displayHooks.php - -``` - if ($paperChoice) { - $note = 'Cadeaupapier: ' . $paperChoice; - $order->note = $order->note ? $order->note . "\n" . $note : $note; - $order->update(); - } - -``` - 5.) Make paper choice an entity diff --git a/src/Module/DisplayHooks.php b/src/Module/DisplayHooks.php index e84a80e..bb0ce51 100644 --- a/src/Module/DisplayHooks.php +++ b/src/Module/DisplayHooks.php @@ -60,7 +60,7 @@ trait DisplayHooks ); if ($paperChoice) { - $note = 'Cadeaupapier: ' . $paperChoice; + $note = $this->trans('Gift paper: ', [], 'Modules.Wsgiftdropdown.Admin') . $paperChoice; $order->note = $order->note ? $order->note . "\n" . $note : $note; $order->update(); } diff --git a/ws_giftdropdown.php b/ws_giftdropdown.php index 46c9ac0..c1f8130 100644 --- a/ws_giftdropdown.php +++ b/ws_giftdropdown.php @@ -48,8 +48,8 @@ class Ws_GiftDropdown extends Module parent::__construct(); - $this->displayName = $this->trans('Gift Paper Selector', [], 'Modules.Ws_giftdropdown.Admin'); - $this->description = $this->trans('Adds a paper style selector to the gift wrap option at checkout', [], 'Modules.Ws_giftdropdown.Admin'); + $this->displayName = $this->trans('Gift Paper Selector', [], 'Modules.Wsgiftdropdown.Admin'); + $this->description = $this->trans('Adds a paper style selector to the gift wrap option at checkout', [], 'Modules.Wsgiftdropdown.Admin'); $this->ps_versions_compliancy = ['min' => '1.7.0.0', 'max' => _PS_VERSION_]; } }