rapidez / amasty-promo-banners
Rapidez Amasty Promo Banners
Installs: 2 452
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 4
Open Issues: 2
Requires
- php: ^8.0|^8.1|^8.2
- illuminate/database: ^9.0|^10.0|^11.0
- illuminate/support: ^9.0|^10.0|^11.0
- illuminate/view: ^9.0|^10.0|^11.0
- rapidez/core: ~0.91|^1.0|^2.0|^3.0
README
Requirements
You need to have the Amasty Promo Banners module installed and configured within your Magento 2 installation.
Installation
composer require rapidez/amasty-promo-banners
If you haven't published the Rapidez views yet, you can publish them with:
php artisan vendor:publish --provider="Rapidez\Core\RapidezServiceProvider" --tag=views
Usage
Categories
Add @banners('category_page', $category->entity_id)
where you'd like to display your banners, add the specified location to make sure the banner shows up on the location you've specified in magento backend. The possible locations are listed at locations. For categories, you can just pass the category id in the blade directive to make sure it only displays for the selected categories in the Magento backend.
Products
With product rules
If you want the banners to be rendered conditional (based on magento rules), you can pass the product as object to the banners directive:
@banners('prod_page', $product)
.
This will display the banners for all products that passes the conditions.
Without product rules
If you just want to show the banner on some product pages, you can pass the SKU in the banners directive:
@banners('prod_page', $product->sku)
This will only display the banner for the specified SKUs in the Magento backend.
Among category products
Just add the view within the renderItem
slot in listing/partials/item.blade.php
@includeWhen(config('frontend.category'), 'AmastyPromoBanners::promobanners.amongproducts')
You should also use getListingSize(...)
as the page size in your products.blade.php
, for example like so:
<reactive-list [...] :size="getListingSize(parseInt(listingSlotProps.pageSize))" [...] >
Views
If you need to change the views you can publish them with:
php artisan vendor:publish --provider="Rapidez\AmastyPromoBanners\AmastyPromoBannersServiceProvider" --tag=views
Locations
These are the locations that are configurable in the magento backend for each banner.
Note
Not all features are implemented yet! For example: cart rules, show on search, etc.