codecycler / ordernumbershopaholic-plugin
No description provided yet...
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 0
Type:october-plugin
Requires
- composer/installers: ~1.0
This package is auto-updated.
Last update: 2024-11-29 00:32:08 UTC
README
You can use some cool variables to customise the order number format.
Extend
You can extend the formatter with your own variables. Simple register your variable and use it in the formatting string.
You can use the event codecycler.ordernumberformat.variables_extend
.
// Listen to event in Plugin.php boot method Event::listen('codecycler.ordernumberformat.variables_extend', function () { return [ '@customvariable' => [ \Hendricks\Piedpiper\Classes\OrdernumberVariable::class, ], ]; }); // File located at $/hendricks/piedpiper/classes/OrdernumberVariable.php namespace Hendricks\Piedpiper\Classes; class OrdernumberVariable { public static function getValue($obOrder, $sVariable) { return 'hello'; } }
You can use a variable. See table with default variables (@n(4)
) at the top of this document for understanding how the variable works.