Download the PHP package ozdemir/aurora without Composer
On this page you can find all versions of the php package ozdemir/aurora. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ozdemir/aurora
More information about ozdemir/aurora
Files in ozdemir/aurora
Package aurora
Short Description Shopping Cart for Laravel
License MIT
Homepage https://github.com/ozdemir/aurora
Informations about the package aurora
Aurora Shopping Cart for Laravel
Aurora Cart is a flexible and feature-rich shopping cart library for Laravel.
Features
- Cart Management: Easily manage the shopping cart for both guest and authenticated users.
- Item Addition: Add items to the cart with quantity and options support.
- Item Modification: Adjust item quantity, remove items, and update options.
- Calculators: Implement custom calculators for shipping, tax, or any other additional costs.
- MetaData: Attach meta information to the entire cart or individual items.
- Snapshot and Rollback: Save and restore the cart state for scenarios like order creation.
- Validation: Validate the cart integrity using checksums.
Installation
Install the package using Composer:
Configuration
To configure Aurora Cart, publish the configuration file:
This will create a cart.php file in your config directory. Here's an example configuration file with explanations:
Basic Usage
Aurora Cart supports custom calculators for calculating totals. You can add your custom calculators to the config/cart.php file under the calculate_using key.
Example
Now, your cart will use these custom calculators to calculate totals, including shipping and tax. Adjust the logic in the calculators based on your specific business requirements.
Breakdowns
You can retrieve the breakdowns of your cart using the Cart::breakdowns() method. Breakdowns provide a detailed summary of how the total amount is calculated, including contributions from various components such as shipping, tax, and any custom calculators you've added.
Example
The breakdowns() method returns an array where each element represents a breakdown item. Each breakdown item typically includes a label and value, providing transparency into how different factors contribute to the overall total.
Here's a hypothetical example output:
Adjust the output format and contents as needed for your specific use case.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Yusuf Özdemir
- All Contributors
License
The MIT License (MIT). Please see License File for more information.