rapidez/reviews

Rapidez Reviews

Installs: 2 345

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 5

Open Issues: 0

Language:Blade

1.1.0 2024-03-05 07:31 UTC

This package is auto-updated.

Last update: 2024-04-05 07:38:43 UTC


README

Installation

composer require rapidez/reviews

If you haven't published the Rapidez views yet, publish them with:

php artisan vendor:publish --provider="Rapidez\Core\RapidezServiceProvider" --tag=views

Configuration

If you'd like to show product reviews on out-of-stock product pages you need to enable this setting in Magento:

Stores > Settings > Configuration > Catalog > Inventory > Stock Options > Display Out of Stock Products

Product page

Review stars

Add the stars where you'd like in resources/views/vendor/rapidez/product/overview.blade.php:

@if($product->reviews_score)
    <stars :score="{{ $product->reviews_score }}" :count="{{ $product->reviews_count }}"></stars>
@endif

Optionally you can change the classes with the class-star, class-star-inactive and class-count props.

Review list

The review list can be added with:

@include('rapidez-reviews::reviews', [
    'sku' => $product->sku,
    'reviews_count' => $product->reviews_count,
    'reviews_score' => $product->reviews_score,
])

Review form

And the form to add a review:

@include('rapidez-reviews::form', ['sku' => $product->sku])

Product listing

Review stars

Add somewhere in resources/views/category/partials/listing/item.blade.php:

<stars v-if="item.reviews_score" :score="item.reviews_score" :count="item.reviews_count"></stars>

Views

If you need to change the views you can publish them with:

php artisan vendor:publish --provider="Rapidez\Reviews\ReviewsServiceProvider" --tag=views

License

GNU General Public License v3. Please see License File for more information.