262 results
Sorted by relevance
General / Response Builders
How do I set the response status code?
There may be situations where the HTTP response status needs to be altered. By default, the returned status is
200, however, this can be changed by passing the new status code to the
setStatus() method:
\Aero\Store\Http\Responses\ProductPage::extend(function...
General / Response Builders
How do I set response headers?
When extending the response builder, you can set HTTP headers to be sent with the response:
\Aero\Store\Http\Responses\ProductPage::extend(function ($page) {
$page->setHeader('foo', 'bar');
});
General / Response Builders
How do I attach middleware to a response builder?
Since Aero does not expose the underlying routes and controllers, middleware can be attached directly to the response builder. This allows for code to be executed before the main pipeline is run.
For example, to restrict all products from being accessible to g...
General / Response Builders
How do I change the response view?
For responses that return HTML, a Twig view file is used. Whilst these are originally defined, the view can be changed. For example, to change the product page view based on product data:
\Aero\Store\Http\Responses\ProductPage::extend(function (\Aero\Store\Htt...
General / Pipelines
What are the available pipelines?
Pipeline
Description
\Aero\Store\Pipelines\ContentForBody
Builds content string to be injected into the body of all pages.
\Aero\Store\Pipelines\ContentForHead
Builds content string to be injected into the head of all pages.
\Aero\Store\Pipelines\RobotsTxt
Use...
General / Pipelines
How do I extend pipelines?
The payload data can be altered using the
extend() method. This is typically done from within a Service Provider:
If the code is unique to a particular store it could be placed in the
boot() method of the
AppServiceProvider.
If it is to be included as part ...
General / Requests
What are the available requests?
Storefront
Listed below are all the storefront validation requests:
Aero\Store\Http\Requests\SearchRequest
Aero\Store\Http\Requests\CartDiscountCodeApply
Aero\Store\Http\Requests\CreateAccountRequest
Aero\Store\Http\Requests\UpdateAccountDetailsRequest
Aero\St...
General / Requests
How can I extend an existing request?
The
expects() method can be used to add custom validation rules (and messages) for your custom field (or to overwrite the existing rules/messages for an existing field):
// Adding a custom field
\Aero\Admin\Http\Requests\Catalog\CreateProductRequest::expects(...
Storefront / Blocks
How do I display content blocks on the storefront?
The structure of the views for the block items is shown below. If you are creating your own theme or custom storefront, you must ensure these files are present in order for the content blocks to display correctly:
└─ resources
└─ views
└─ blocks
...
Storefront / Breadcrumb
How do I display the breadcrumb?
To access the breadcrumb on the storefront, use the
breadcrumb() function inside Twig files.
It can be displayed by looping over each crumb like so:
<ul class="breabcrumb">
{% for crumb in breadcrumb() %}
<li class="crumb">
{% if loop...
Storefront / Breadcrumb
How do I add something to the breadcrumb?
You can use the
add() method to add a crumb:
\Aero\Store\Facades\Breadcrumb::add(function (\Aero\Store\Services\Breadcrumb $breadcrumb) {
$breadcrumb->add(new \Aero\Store\Crumb('Name', '/url'));
});
You can provide a Closure that returns an
\Aero\Store\C...
Storefront / Breadcrumb
How do I clear the breadcrumb?
You can use the
clear() method to clear the crumbs:
\Aero\Store\Facades\Breadcrumb::clear();
Storefront / Breadcrumb
How can I filter the breadcrumb?
You can provide a filter callback to remove unwanted crumbs, it should return
true when a crumb should be kept and
false otherwise:
\Aero\Store\Facades\Breadcrumb::setFilter(function ($crumb) {
if ($crumb->getName() === 'Foo') {
return false;
...
Storefront / Breadcrumb
How can I display the request referrer?
By default, the product page breadcrumb is built based on the referrer.
For example, if a customer performs a search for "shirt" and then clicks on a listing result, the breadcrumb on the product page will be
Home > Search for “shirt” > Casual Shirt.
To disab...
Storefront / Breadcrumb
How can I disable the breadcrumb functionality?
There may be cases (such as an API) where the breadcrumb functionality should not use the request at all.
To do this, use
dontUseRequest():
\Aero\Store\Facades\Breadcrumb::dontUseRequest();
Storefront / Products Page
How can I remove the manufacturer from the product page breadcrumb?
By default, when there is no referrer (i.e. the page was hit directly - not through a filtering or searching), the product page breadcrumb contains a crumb entry for the manufacturer.
This can be disabled:
\Aero\Catalog\Models\Product::$breadcrumbContainsManu...
Storefront / Currencies
How do I change the store currency?
In order to change the store currency we need to publish the store configuration file:
php artisan vendor:publish --tag aero::store-config
Then locate the
configurations section of the published
config/aero/store.php file and update the
currency_code value ...
Storefront / Currencies
What is a fascia currency and how do I use it?
A fascia currency can be set to render a different currency to the one specified in the store configuration.
Setting the fascia currency
The easiest way to check for and apply the fascia currency is through
store middleware.
The example snippet below details ...