From 7a5c7c209072323a5e408bb3cbaa4a2707e335e8 Mon Sep 17 00:00:00 2001 From: Diego Jimenez Date: Thu, 30 Dec 2021 19:44:18 -0600 Subject: [PATCH 1/3] Create CustomBoldCommentPlugin Support to have the column "bold_order_comment" in Magento's order endpoint --- CustomBoldCommentPlugin | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 CustomBoldCommentPlugin diff --git a/CustomBoldCommentPlugin b/CustomBoldCommentPlugin new file mode 100644 index 0000000..4b1c8d4 --- /dev/null +++ b/CustomBoldCommentPlugin @@ -0,0 +1,41 @@ +extensionFactory = $extensionFactory; + } + + public function afterGet(OrderRepositoryInterface $subject, OrderInterface $order) + { + $customBoldComments = $order->getData(self::FIELD_NAME); + $extensionAttributes = $order->getExtensionAttributes(); + $extensionAttributes = $extensionAttributes ? $extensionAttributes : $this->extensionFactory->create(); + $extensionAttributes->setBoldOrderComment($customBoldComments); + $order->setExtensionAttributes($extensionAttributes); + return $order; + } + + public function afterGetList(OrderRepositoryInterface $subject, OrderSearchResultInterface $searchResult) + { + $orders = $searchResult->getItems(); + foreach ($orders as &$order) { + $customBoldComments = $order->getData(self::FIELD_NAME); + $extensionAttributes = $order->getExtensionAttributes(); + $extensionAttributes = $extensionAttributes ? $extensionAttributes : $this->extensionFactory->create(); + $extensionAttributes->setBoldOrderComment($customBoldComments); + $order->setExtensionAttributes($extensionAttributes); + } + return $searchResult; + } +} From 2b4aca3a693a6b62f8199774429f632c55e2d9c7 Mon Sep 17 00:00:00 2001 From: Diego Jimenez Date: Thu, 30 Dec 2021 19:46:44 -0600 Subject: [PATCH 2/3] Update di.xml Support for custom column on Magento's order endpoint --- etc/di.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etc/di.xml b/etc/di.xml index cf06849..2542f03 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -15,4 +15,9 @@ - \ No newline at end of file + + + + + From 549cbfbc7bb6ac04a07f477c3533dcaf944562af Mon Sep 17 00:00:00 2001 From: Diego Jimenez Date: Thu, 30 Dec 2021 19:57:45 -0600 Subject: [PATCH 3/3] Spanish support Adding Spanish support --- i18n/es_ES.csv | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 i18n/es_ES.csv diff --git a/i18n/es_ES.csv b/i18n/es_ES.csv new file mode 100644 index 0000000..16ab730 --- /dev/null +++ b/i18n/es_ES.csv @@ -0,0 +1,5 @@ +"Do you have any comments regarding the order?","¿Tienes algún comentario para agregar al pedido?" +"Enter your comment...","Ingrese su comentario..." +"Order Comment","Comentario del pedido" +"The order comment could not be saved","El comentario del pedido no pudo ser almacenado" +"Cart %1 doesn't contain products","El carrito %1 no contiene productos"