composer require rapidez/compare
The compared products are available in the compare variable imported from the useCompare.js
file.
import { compare } from './../stores/useCompare.js'
To add a product to the compare list you can simply import the add function and execute it with product id's.
import { addProductToCompare } from './../stores/useCompare.js'
addProductToCompare(['1', '2']);
If you want a button on the product detail page, you can simply import this partial:
@include('rapidez-compare::product.partials.compare')
If you want checkbox on a category page, you can simply add this import in the item tile:
@include('rapidez-compare::listing.partials.checkbox')
Within your vue app container you can show the user they have a compare list. This will show a button with a count. Clicking on this will result in the user redirecting to the compare page.
@include('rapidez-compare::partials.button')
The compare page show's a list of the comparable attributes of the products that are added. The url of the compare page can be changed in the config.
php artisan vendor:publish --provider="Rapidez\Compare\RapidezCompareServiceProvider"
Currently this module does not support:
- Linking a compare list to a customer
GNU General Public License v3. Please see License File for more information.