Download the PHP package safemood/discountify without Composer
On this page you can find all versions of the php package safemood/discountify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download safemood/discountify
More information about safemood/discountify
Files in safemood/discountify
Package discountify
Short Description Laravel package for dynamic discounts with custom conditions.
License MIT
Homepage https://github.com/safemood/discountify
Informations about the package discountify
Laravel Discountify for dynamic discounts with custom conditions.
Discountify is a Laravel package designed for managing dynamic discounts with custom conditions. It allows you to create flexible and powerful discounting strategies, easily defining conditions and applying percentage-based discounts to enhance your e-commerce application.
- Installation
- Usage
- Define Discounts Conditions
- Set Items, Global Discount, and Tax Rate
- Calculate Total Amounts
- Dynamic Field Names
- Class-Based Discounts
- Skip Discounts conditions
- Event Tracking
- Coupon Based Discounts
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Usage
Define Conditions
Set Items, Global Discount, and Tax Rate
Calculate Total Amounts
Dynamic Field Names
Class-Based Discounts
The classes in App\Conditions will be auto-discovered by Discountify for seamless integration—no configuration is needed.
- Create Class-Based Conditions:
To create a class-based condition using the discountify:condition
artisan command, you can run the following command:
- Command Options:
--discount (-d): Specifies the discount value for the condition. Default value is 0.
--slug (-s): Specifies the slug for the condition. If not provided, the name of the condition will be used as the slug.
--force (-f): Creates the class even if the condition class already exists.
Skip Discounts Conditions
This will allows you to exclude specific conditions based on the "skip" field.
Using Condition::define:
- Using Condition::add:
Event Tracking
You can listen for the DiscountAppliedEvent
and CouponAppliedEvent
using Laravel's Event system.
Ensure the following configuration in the discountify.php file:
Check the Laravel Events documentation for more details.
Coupon Based Discounts
Coupon based discounts to easily apply and calculate discounts (Percentage) on a given coupon code.
Discountify Coupons allows you to apply various types of coupons to your cart.
Period-Limited Coupon
Single-Use Coupon
Restricted User Coupon
Limited Usage Coupon
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Khalil Bouzidi
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of discountify with dependencies
spatie/laravel-package-tools Version ^1.14.0
illuminate/contracts Version ^10|^11.1