Hide order notes in customer’s order details page
-
Hi, I have a B2B, the checkout has the “notes” field used by sales agents and admin, but I want to hide them to customers.
I removed it in the customer-processing-order.php email template adding a custom template, but I need to hide it in the customer’s order details page too.
Is it possible to remove it with an action so to not have to create a custom template too?
Thanks
-
Hi @maipiusenza
I have a B2B, the checkout has the “notes” field used by sales agents and admin, but I want to hide them to customers.
I removed it in the customer-processing-order.php email template adding a custom template, but I need to hide it in the customer’s order details page too.
Is it possible to remove it with an action so to not have to create a custom template too?
From what I understand, you’re running a B2B site and you want to keep the ‘notes’ field exclusive to your sales agents and admin, hiding it from your customers. You’ve already managed to remove it from the customer-processing-order.php email template by adding a custom template, and now you’re looking to do the same on the customer’s order details page.
You’re in luck! You can indeed remove it with an action, thus avoiding the need to create another custom template. A handy code snippet that you can add for this purpose is available here: ?? WooCommerce: Hide “Order Notes” @ Checkout
Just a heads-up though, the code provided in the link is from a third party. Unfortunately, we can’t provide support for it. If you have any questions about this code, it’s best to reach out to the author.
Alternatively, you can also consider getting in touch with Codeable.io, one of the official WooCommerce development partners. They’re just a click away: ?? https://woocommerce.com/codeable/
I hope this information helps you out. If you have any other questions or need further clarification, don’t hesitate to ask. We’re always here to assist you!
Thanks, but it is a snippet to remove it from the check-out page (where it must remain), while I need it removed in the order-details page (Customer dashboard > My Orders > Order details).
Is there any action to achieve it in the Customer dashboard > My Orders > Order details page?
Thnaks
Hi @maipiusenza
Yes, it is indeed possible to achieve this through an action. You can use WooCommerce hooks to customize the order details page.
You can add the following code snippet to your theme’s functions.php file:
add_filter( 'woocommerce_purchase_note_order_statuses', 'remove_customer_order_notes' ); function remove_customer_order_notes( $order_statuses ){ return array(); }
This code will remove the notes field from the order details page for all customers. The
woocommerce_purchase_note_order_statuses
filter allows you to manipulate the order statuses for which purchase notes should be included in the email. By returning an empty array, we’re effectively saying, “don’t include notes for any status“.Please ensure to backup your website before making any changes to your theme’s files. If you’re uncomfortable editing theme files, I recommend contacting your theme developer or hiring a developer.
I hope this helps! Please don’t hesitate to ask if you have any further questions or if anything is unclear.
Thanks!
Sorry, but it still doesn’t do what I’m asking. In the page
Customer dashboard > My Orders > Order details
https://mysite.com/my-account/view-order/(order-it)/
I can still seethe order note. There is no override file for that template in the theme folder.
https://snipboard.io/42ca5u.jpg
Is it possible to remove THAT line with a snippet?
ThanksHi @maipiusenza
In this case, you can override the template file
view-order.php
and then either remove or commented out the code block highlighted here.Find out more about how to override templates from this link:
https://docs.woocommerce.com/document/template-structure/I hope this helps! If you have any other questions, feel free to ask.
Thanks!
Yes I know, as written I was asking if it was possible with an action rather than overriding a template.
Hello @maipiusenza,
Yes I know, as written I was asking if it was possible with an action rather than overriding a template.
You can use this one liner to remove the field from the checkout page:
add_filter( 'woocommerce_enable_order_notes_field', '__return_false', 9999 );
From what I’ve checked, orders that don’t have a value in the note, won’t have a note field in
/my-account/view-order/{id}/
. Therefore, simply removing the field should do the trick. However, previous orders will still display the field.Hope this helps!
@babylon1999, please read the previous messages.
The order MUST have the notes enabled, but only the admin and sales agent (who places the order in name of the customer) can see them, they must be hidden for customers when they log-in in their dashboard.
So, again, I need to remove them from
Customer dashboard > My Orders > Order details
and not from the checkout or from the admin dashboard.
And I would like to do that with an action rather than a custom template.Thanks
Hi there @maipiusenza ??
Let’s loop back to your original inquiry, for a moment:
I have a B2B, the checkout has the “notes” field used by sales agents and admin, but I want to hide them to customers.
Just to clarify, is there a CRM solution in place, or otherwise?
It sounds like this situation is better served by a CRM software, where the business teams can collaborate freely, while having access to a toolset for taking things further.
Feel free to take a look into JetpackCRM, as I’m sure you will find great value in the following features:
I removed it in the customer-processing-order.php email template adding a custom template, but I need to hide it in the customer’s order details page too.
Is it possible to remove it with an action so to not have to create a custom template too?
If you are needing help with customizations or troubleshooting WooCommerce and do not have a developer or company you can depend on, then we’ve got recommendations for you.
Visit?https://woocommerce.com/customizations/?to find the right agency or developer for your specific needs.
I hope this is helpful! Please let us know if you have any further questions or concerns.
Are you kidding me?
I only asked to remove that note from the order details page in customer view, I don’t need any further feature, all works well as it is.
I don’t want to do it with a custom template to avoid the problem of future updates of that template, if it is possible with an action as it happens in other pages.
That’s all!Hi @maipiusenza
The order MUST have the notes enabled, but only the admin and sales agent (who places the order in name of the customer) can see them, they must be hidden for customers when they log-in in their dashboard.
Why should you use the customer provided note field in this case? Instead, you could use the private note on the right sidebar, which remains hidden from the customer.
I only asked to remove that note from the order details page in customer view, I don’t need any further feature, all works well as it is.
I don’t want to do it with a custom template to avoid the problem of future updates of that template, if it is possible with an action as it happens in other pages.
I’ve given it a shot many times, but it looks like you might need to dive into some more advanced customization to achieve your goal.
You can consider seeking help from a WooCommerce developer or specialist who can analyze your website’s setup and provide a tailored solution to hide those notes for customers on the
my-account/view-order
page.If you have any further questions on development or custom coding, don’t hesitate to reach out to some of our great resources available for support. Our WooCommerce community is brimming with skilled open-source developers who are active on the following channels:
- WooCommerce Developer Resources Portal
- WooCommerce Advanced Facebook group
- WooCommerce Developer Slack Channel
- Hire a WooCommerce Expert
Thanks!
Hi @shameemreza,
Why should you use the customer provided note field in this case? Instead, you could use the private note on the right sidebar, which remains hidden from the customer.
Because they are created in the check-out process, not in admin.
And they must be order notes, not private (used elsewhere).I’ve given it a shot many times, but it looks like you might need to dive into some more advanced customization to achieve your goal.
It should be possible by a simple custom template but, as said, I would prefer to do it with an action as a custom template needs to be periodically updated.
The same action exists in checkout, so I imagine there should be inmy-account/view-order
page too.Hello @maipiusenza
Thanks for clarifying your requirements.
I’d like to help you with this, but I am afraid we are not developers and only offer support for existing functionality, so this type of customization is not within the scope of our support policy.
While it’s possible to customize the WooCommerce to suit your specific needs, it’s important to note that some advanced customization may require a deeper understanding of the platform and potentially some coding skills. In your case, creating a custom template could potentially solve your issue, but it would need to be periodically updated to ensure it remains compatible with any updates to the WooCommerce platform.
However, for assistance with customization or development with your site, we recommend that you seek help from:
- A local web developer
- Codeable.io
- WooExperts
If you are comfortable with coding yourself and have questions, I would also recommend that you consider:
I hope that helps you to figure it out.
- The topic ‘Hide order notes in customer’s order details page’ is closed to new replies.