Shopkeeper Vendor Notes Extension
This Magento 2 extension displays vendor-specific notes on the admin order view page based on the vendor attribute assigned to order items.
Features
- Displays vendor notes on the admin order view page
- Configurable notes per vendor via admin configuration
- Supports HTML formatting (links, line breaks, etc.)
- Automatically shows notes when products with specific vendors are in an order
Adding New Vendors
To add a new vendor option and corresponding note configuration, follow these steps:
Step 1: Add the Vendor Option to the Attribute
The vendor attribute code is: vendor
You can add new options through the Magento admin:
- Navigate to Stores > Attributes > Product
- Search for and edit the Vendor attribute
- Go to the Manage Options section
- Click Add Option and enter your new vendor name
- Save the attribute
Alternatively, you can add options programmatically by creating an upgrade script.
Step 2: Add Configuration Field for the New Vendor
Edit the file: app/code/Shopkeeper/VendorNotes/etc/adminhtml/system.xml
Add a new field block within the <group id="general"> section:
<field id="new_vendor_note" translate="label" type="textarea" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
<label>New Vendor Name Note</label>
<comment>Enter notes here. Supports HTML for links and emails.</comment>
</field>
Important: Replace new_vendor_note with a lowercase, underscore-separated version of your vendor name (e.g., "ABC Company" becomes abc_company_note).
Step 3: Add Default Configuration Value (Optional)
Edit the file: app/code/Shopkeeper/VendorNotes/etc/config.xml
Add a new default value within the <general> section:
<new_vendor_note>Example note for New Vendor.<br>Contact: <a href="mailto:support@newvendor.com">support@newvendor.com</a></new_vendor_note>
Step 4: Update the Block Logic
Edit the file: app/code/Shopkeeper/VendorNotes/Block/Adminhtml/Order/View/VendorNotes.php
In the getVendorNotes() method, add your new vendor to the $vendorConfigPaths array:
$vendorConfigPaths = [
'Thermo Fisher' => 'vendor_notes/general/thermo_fisher_note',
'Orion' => 'vendor_notes/general/orion_note',
'Nalgene' => 'vendor_notes/general/nalgene_note',
'Thermo Fisher Parts' => 'vendor_notes/general/thermo_fisher_parts_note',
'New Vendor Name' => 'vendor_notes/general/new_vendor_note', // Add this line
];
Important: The key must match exactly the vendor option label as it appears in the admin.
Step 5: Clear Cache
After making these changes, clear the Magento cache:
php bin/magento cache:clean
php bin/magento cache:flush
Configuration
After installation, configure vendor notes at:
Stores > Configuration > Shopkeeper > Vendor Notes
Each vendor has a textarea field where you can enter notes. HTML is supported for:
- Links:
<a href="https://example.com">Link Text</a> - Email links:
<a href="mailto:email@example.com">email@example.com</a> - Line breaks:
<br>
How It Works
- The extension checks all items in an order
- For each item, it retrieves the
vendorattribute value - If a vendor matches one in the configuration, the corresponding note is displayed
- Multiple vendor notes can appear if an order contains items from different vendors
- Duplicate notes are automatically filtered out
File Structure
app/code/Shopkeeper/VendorNotes/
├── Block/
│ └── Adminhtml/
│ └── Order/
│ └── View/
│ └── VendorNotes.php
├── etc/
│ ├── acl.xml
│ ├── config.xml
│ ├── module.xml
│ └── adminhtml/
│ └── system.xml
├── Setup/
│ └── InstallData.php
├── view/
│ └── adminhtml/
│ ├── layout/
│ │ └── sales_order_view.xml
│ └── templates/
│ └── order/
│ └── view/
│ └── vendor_notes.phtml
└── registration.php
Support
For issues or questions, please contact your development team.
Installing via Composer
You can install this module into a Magento 2 project using Composer in a few ways.
- Local path repository (during development)
Add this to your Magento project's composer.json repositories section:
{
"type": "path",
"url": "../path/to/VendorNotes",
"options": { "symlink": true }
}
Then require the package:
composer require shopkeeper/vendornotes:1.1.0
- VCS repository
If this module is hosted in a Git repository (GitHub/GitLab/etc.), add a VCS entry to your project's composer.json:
{
"type": "vcs",
"url": "git@github.com:shopkeeperdev/VendorNotes.git"
}
Then require it the same way:
composer require shopkeeper/vendornotes:dev-main
After installing, run these Magento commands from your project root:
php bin/magento module:enable Shopkeeper_VendorNotes
php bin/magento setup:upgrade
php bin/magento cache:flush