Will this patch has a chance to get merged? Or should I continue looking for other method?
Thanks,
- last update
over 1 year ago 781 pass - 🇮🇳India vipin.j
The patch #18 is re-rolled with updates for release ^2.35 compatibility.
- last update
about 1 year ago 786 pass - 🇮🇳India vipin.j
Small tweak in the patch to remove one of the WCAG 2.1 issue.
- Status changed to Needs work
11 months ago 12:43pm 31 December 2023 - Status changed to Needs review
11 months ago 2:16pm 31 December 2023 - last update
11 months ago 788 pass, 2 fail - last update
11 months ago 790 pass - Status changed to RTBC
11 months ago 9:40am 3 January 2024 - Status changed to Active
9 months ago 11:36pm 23 February 2024 - 🇬🇧United Kingdom nags338228
Hi,
I patched with https://www.drupal.org/project/commerce/issues/3267366 ✨ Add customer-facing order comments Active and https://www.drupal.org/project/commerce/issues/2908196 ✨ Add ability to add an order comment Fixed this issue and merged both of it.
The #25 patch contains Comment form in user order page for the user along with permissions + comment form for admin with radio buttons and sending email functionality.
Please test it
Thanks !!
- last update
9 months ago Patch Failed to Apply - last update
9 months ago Patch Failed to Apply - Status changed to Needs review
9 months ago 2:27pm 26 February 2024 - last update
9 months ago 784 pass, 2 fail - 🇮🇳India vipin.j
From patch #6 we are carrying a deprecated statement which has fixed with the issue #3336658 📌 PHP 8.2: ${var} in strings is deprecated Fixed
Re-rolling patch #24 to fix this issue in the patch.
- 🇸🇰Slovakia poker10
I think that a possibility to add customer-facing order comments is an important feature, so +1 from me and hopefully we will see this in Drupal Commerce soon. As it was mentioned in the referenced issue ( 💬 How to Add Order Comment and also Allow to notify customer via email? Active ), each other eshop system has such comments (magento, ubercart, prestashop, opencart).
- 🇺🇦Ukraine khiminrm
I've tested patch from #27.
It works.
But I've noticed one bug:
When add comment and go to review page,
on review page click on Edit near the Comments section
then the page with previous checkout step is opened and the Comment input field is empty.
Adding new comment in this case and submitting checkout step form again will save the comment as new log.
So there are two comment logs.
I haven't time to look into code and check if it's possible to load already created comment log yet.
Maybe it should be fixed? - last update
9 months ago 791 pass - last update
9 months ago 791 pass - 🇺🇦Ukraine khiminrm
Added one more small fix to render a customer comment on the order review page with new lines (if there any in the comment) and not '
' instead. - Status changed to Needs work
9 months ago 1:06pm 5 March 2024 - 🇸🇰Slovakia poker10
Thanks for working on this. I have quickly checked the patch and writing a few points.
1. I think there are some unrelated changes, or at least not explained:
+++ b/modules/payment/tests/src/Functional/DefaultPaymentAdminTest.php @@ -132,7 +132,7 @@ class DefaultPaymentAdminTest extends CommerceBrowserTestBase { [ 'absolute' => TRUE, ], - )->toString(); + )->getInternalPath(); }
+++ b/modules/order/tests/src/FunctionalJavascript/OrderAdminTest.php @@ -424,7 +424,7 @@ class OrderAdminTest extends OrderWebDriverTestBase { - $this->drupalGet($order->toUrl()->toString()); + $this->drupalGet($order->toUrl()); @@ -462,14 +462,14 @@ class OrderAdminTest extends OrderWebDriverTestBase { - $this->drupalGet($order->toUrl()->toString()); + $this->drupalGet($order->toUrl()); // Logout and check that anonymous users cannot see the order admin screen. $this->drupalLogout(); - $this->drupalGet($order->toUrl()->toString()); + $this->drupalGet($order->toUrl()); }
+++ b/modules/order/src/Mail/OrderReceiptMail.php @@ -30,7 +31,7 @@ class OrderReceiptMail implements OrderReceiptMailInterface { - public function send(OrderInterface $order, $to = NULL, $bcc = NULL, bool $resend = FALSE) { + public function send(OrderInterface $order, $to = NULL, $bcc = NULL, bool $resend = FALSE): bool {
+++ b/modules/order/commerce_order.module @@ -181,8 +182,8 @@ function template_preprocess_commerce_order(array &$variables) { - $profile_view_bulder = \Drupal::entityTypeManager()->getViewBuilder('profile'); - $variables['order']['billing_information'] = $profile_view_bulder->view($billing_profile, $view_mode); + $profile_view_builder = \Drupal::entityTypeManager()->getViewBuilder('profile'); + $variables['order']['billing_information'] = $profile_view_builder->view($billing_profile, $view_mode);
2. Regarding the templates - I think it would be a little weird to display it this way. As far as I understand, we can have only one comment of type "From customer". Maybe it should be out of foreach to not cause a confusion. Then we should have a foreach just for "To customer" comments and there would be no need to write "Comment to customer" for each row. This is the related code:
+++ b/modules/order/templates/commerce-order-receipt.html.twig @@ -133,6 +134,44 @@ + {% for comment in order_comments %} + <tr> + {% if comment.type == 'commerce_order.comment.to_customer' %} + <td style="border: 1px solid #dee2e6; padding: 0.75rem; vertical-align: top;">{{ comment.date|date("D, m/d/Y - H:i") }}</td> + <td style="border: 1px solid #dee2e6; padding: 0.75rem; vertical-align: top;"><strong>Comment to customer:</strong> <br />{{ comment.comment|raw }}</td> + {% elseif comment.type == 'commerce_order.comment.from_customer' %} + <td style="border: 1px solid #dee2e6; padding: 0.75rem; vertical-align: top;">{{ comment.date|date("D, m/d/Y - H:i") }}</td> + <td style="border: 1px solid #dee2e6; padding: 0.75rem; vertical-align: top;"><strong>Comment from customer:</strong> <br />{{ comment.comment|raw }}</td> + {% endif %} + </tr> + {% endfor %}
+++ b/modules/order/templates/commerce-order--user.html.twig @@ -33,6 +34,34 @@ + {% for comment in order_comments %} + <tr style="border-bottom: 0.0625rem solid #d3d4d9; color: #232429; background: #fff;"> + {% if comment.type == 'commerce_order.comment.to_customer' %} + <td style="border: 1px solid #dee2e6; padding: 0.75rem; vertical-align: top;">{{ comment.date|date("D, m/d/Y - H:i")}}</td> + <td style="border: 1px solid #dee2e6; padding: 0.75rem; vertical-align: top;"><strong>Comment to customer:</strong> <br />{{ comment.comment|raw }}</td> + {% elseif comment.type == 'commerce_order.comment.from_customer' %} + <td style="border: 1px solid #dee2e6; padding: 0.75rem; vertical-align: top;">{{ comment.date|date("D, m/d/Y - H:i") }}</td> + <td style="border: 1px solid #dee2e6; padding: 0.75rem; vertical-align: top;"><strong>Comment from customer:</strong> <br />{{ comment.comment|raw }}</td> + {% endif %} + </tr> + {% endfor %}
3. Why are we changing the comment output from
{{ comment }}
to{{ comment|raw }}
(and even for the existing admin comments)? Personally I think that comments should be only plaintext and I do not see a reason for this change. It can probably open some vulnerabilities if not handled correctly.4. As this patch is pretty large, I think it would be great if we can move it to MR instead, so that reviews/comments/progress is easier and more transparent.
- 🇺🇦Ukraine khiminrm
Added small fix for the cases if the customer comment contains apostrophes and when we go back to edit the comment, so wouldn't have
'
instead of'
. - last update
6 months ago Patch Failed to Apply - last update
6 months ago 685 pass, 50 fail - last update
6 months ago 692 pass, 48 fail - last update
6 months ago 692 pass, 48 fail - last update
6 months ago 784 pass, 4 fail - last update
6 months ago 784 pass, 4 fail - Status changed to Needs review
5 months ago 10:05am 8 July 2024 - 🇮🇱Israel jsacksick
A bit of scope creep here, I'll probably create a separate issue to focus on the checkout pane in checkout as this is a bit hard to review.
The patch here for example dispatches an event on pane submission, but the user could go back and edit the comment?I haven't tested the patch manually, but it doesn't seem that editing the comment is supported.
I'm thinking we should store the comment in the order data for example, and only record the log on checkout completion / order placement. - 🇮🇱Israel jsacksick
Created ✨ Provide a checkout pane for customer comments Active .
- 🇮🇳India vipin.j
Here is the updated patch from the reference of #36, after the changes introduced & committed from #38 into Commerce Core.
- 🇬🇧United Kingdom cjd4001
I'm getting following error after installing patch 39 (previous patches not patching with my version of commerce 2.40.0 and drupal 10.3.6
TypeError: Drupal\commerce_log\EventSubscriber\OrderEventSubscriber::__construct(): Argument #2 ($order_receipt_mail) must be of type Drupal\commerce_order\Mail\OrderReceiptMailInterface, Drupal\symfony_mailer\MailManagerReplacement given, called in /home/picksorg/dev1124/core/lib/Drupal/Component/DependencyInjection/Container.php on line 261 in Drupal\commerce_log\EventSubscriber\OrderEventSubscriber->__construct() (line 40 of /home/picksorg/dev1124/modules/contrib/commerce/modules/log/src/EventSubscriber/OrderEventSubscriber.php).
any help / pointers gratefully received as client strongly relies on this functionality which has stopped working since upgrades.