PHPackages                             superbig/craft-ordernotes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. superbig/craft-ordernotes

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

superbig/craft-ordernotes
=========================

Order notes for Commerce

2.0.4(5y ago)31.8k3[2 PRs](https://github.com/sjelfull/craft-ordernotes/pulls)MITPHPCI passing

Since Apr 13Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/sjelfull/craft-ordernotes)[ Packagist](https://packagist.org/packages/superbig/craft-ordernotes)[ RSS](/packages/superbig-craft-ordernotes/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (10)Used By (0)

Order Notes for Craft Commerce
==============================

[](#order-notes-for-craft-commerce)

Add internal notes to Craft Commerce orders. Team members can annotate orders directly from the control panel and optionally notify customers by email.

[![Screenshot](resources/img/screenshot-plugin.png)](resources/img/screenshot-plugin.png)

Requirements
------------

[](#requirements)

- Craft CMS 5.5+
- Craft Commerce 5.0+
- PHP 8.2+

Installation
------------

[](#installation)

```
composer require superbig/craft-ordernotes
```

Then go to **Settings → Plugins** and install Order Notes.

Quick Start
-----------

[](#quick-start)

Once installed, a notes panel appears on every Commerce order edit screen. Type a message, optionally check "Notify customer", and submit.

Using Order Notes in Templates
------------------------------

[](#using-order-notes-in-templates)

Access order notes in Twig via the `craft.orderNotes` variable.

### Get notes by Order object

[](#get-notes-by-order-object)

```
{% set order = craft.commerce.orders.number(orderNumber).one() %}
{% set notes = craft.orderNotes.getNotesForOrder(order) %}

{% if notes %}
    Order Notes
    {% for note in notes %}

            {{ note.getUsername() }}
            {{ note.dateCreated|date('Y-m-d H:i') }}
            {{ note.message|nl2br }}

    {% endfor %}
{% endif %}
```

### Get notes by order ID

[](#get-notes-by-order-id)

```
{% set notes = craft.orderNotes.getNotesByOrderId(order.id) %}
```

### Available properties

[](#available-properties)

PropertyTypeDescription`note.id``int`Note ID`note.message``string`Note content`note.orderId``int`Associated order ID`note.userId``int`Author's user ID`note.notify``bool`Whether the customer was notified`note.dateCreated``DateTime`When the note was created`note.dateUpdated``DateTime`When the note was last updated`note.getUser()``User`The User element who created the note`note.getUsername()``string`Username of the note authorConfiguration
-------------

[](#configuration)

Configure via the CP settings page or a `config/order-notes.php` file:

OptionTypeDefaultDescription`notifyEmailFrom``string``''`Sender email address (falls back to system email)`notifyEmailFromName``string``''`Sender name (falls back to system name)`notifyEmailTemplate``string``''`Path to HTML email template`notifyEmailTemplateText``string``''`Path to plain text email template`notifyEmailSubject``string``''`Email subject (Twig, receives `order` and `note`)### Config file example

[](#config-file-example)

```
