263 results
for “custom module routes”
Sorted by relevance
Storefront / Twig
How do I add a custom twig function?
You can use the
add() method to add a custom twig function:
\Aero\Store\Twig\Extensions\TwigFunctions::add([
new \Twig\TwigFunction('foo', function () {
return 'bar';
}),
]);
And then use it in twig:
{{ foo() }}
Storefront / Events
How do I run a custom event?
You can run your own custom event using the
runEvent() method:
window.Aero.runEvent('acme', { foo: 'bar' });
And listen for it wherever needed:
window.AeroEvents.on('acme', (data) => {
console.log(data);
});
Account Area / General
How do I add a Custom CSS File to the account area?
You can add a custom CSS file to the account area by creating a file named
account-area.css in your public directory.
Example contents where we're overriding the default colours:
:root {
--bpa-color-primary: deepskyblue;
--bpa-color-success: forestgre...
Account Area / Pages
How do I create a custom page in the account area?
To create and register a custom account area page you need to u ...a::registerPage(\Aerocargo\Acme\CustomPage::class);
Your account area page class must implement the
title(),
route(), and
routeName() methods that all should return a string.
It’s common pra...
Account Area / Sets
How do I create a custom set in the account area?
...uests.
To create and register a custom account area set you need to us ...:registerDelete(\Aerocargo\Acme\CustomDelete::class);
Your account area set class must implement the
route() and
routeName() methods that all should return a string.
You should als...
Admin / Dashboard
How do I create a custom dashboard lens?
... $dateGetVariables = [
'custom' => 'ordered-at-date',
'start' => 'ordered-at-date-start-date',
'end' => 'ordered-at-date-end-date',
];
public function data(\Illuminate\Http\Request $request, array $date, array $compare): \Il...
Search / Listings
How do I create a custom sort order for the listings pages?
...rns\CanBeSorted trait.
To add a custom sort to the listings page you therefore just need to macro a method to the
\Aero\Search\Elastic\Query\Builder class using the correct naming convention.
For example, we will add a summary sort:
\Aero\Search\Elastic\D...
Order Management / Shipping
How do I set a custom item weight totalizer for shipping rates?
Shipping rates can define a custom item weight totalizer to control how item weights are calculated when determining whether a rate is applicable.
For example, you may want certain product variants to be exempt from the shipping weight calculation.
First, ad...
Order Management / Shipping
How do I set a custom item volume totalizer for shipping rates?
Shipping rates can define a custom item volume totalizer to control how item volumes are calculated when determining whether a rate is applicable.
For example, you may want to account for additional packaging space by applying a percentage allowance to the vol...
Order Management / Shipping
How do I set a custom item quantity totalizer for shipping rates?
Shipping rates can define a custom item quantity totalizer to control how item quantities are calculated when determining whether a rate is applicable.
For example, you may want sample products to be excluded from the item quantity used when evaluating quantit...
Order Management / Shipping
How do I set a custom item price totalizer for shipping rates?
Shipping rates can define a custom item price totalizer to control how the total item price is calculated when determining whether a rate is applicable.
For example, you may want to calculate the shipping rate's price threshold using the original item prices r...
Order Management / Orders
How do I customize the order reference?
...rder reference generator can be customized to control the format of order references that are generated when an order is created.
For example, to use the order reference prefix followed by the order ID:
\Aero\Cart\Models\Order::setReferenceGenerator(functi...
Admin / Dashboard
How do I add a custom dashboard lens to the dashboard?
First, you must register your lens:
\Aero\Admin\Facades\Admin::registerLens(\Aero\Admin\Lenses\OrdersLens::class);
Then you can add it to the Dashboard:
\Aero\Admin\Http\Responses\AdminDashboardPage::extend(function (\Aero\Admin\Http\Responses\AdminDashboardPa...
Admin / Resource Lists
How do I create a custom bulk action?
You can create a class that extends
\Aero\Admin\BulkActions\BulkActionJob and implement a
handle method:
class DeleteProductsBulkAction extends \Aero\Admin\BulkActions\BulkActionJob
implements \Illuminate\Contracts\Queue\ShouldQueue
{
protected $list...
Account Area / Forms
How do I create a custom form in the account area?
To create a form you need to create a class that extends the
\Aero\AccountArea\AccountAreaForm class:
The
$sections array lists the views used to render the form.
The
method() method defines the method that the form will use (this should be
post,
get,
pu...
Order Management / Shipping
How do I set a custom order validator for shipping methods?
Shipping methods can define an order validator to determine whether they are available for a particular order.
For example, you may only want to offer some shipping methods on certain days.
First we will define an availability setting for each day:
$days = col...
Order Management / Shipping
How do I set a custom order validator for shipping rates (for subscriptions)?
Shipping rates can define a subscription order validator to determine whether they are available for a particular subscription order.
For example, you may want to make a shipping rate available for one-time orders but explicitly opt it into subscription order...
Developer Documentation / Extending Core Functionality
What are the available commands?
php artisan make:module
This command scaffolds a module for you (you need to provide a ...valid name for the module such as aerocargo/my-module). This involves setting up comp ...ser and publishing some default module stubs.
php artisan aero:configu...