mirror of
https://github.com/wearepixel/laravel-cart.git
synced 2026-11-14 22:01:48 +00:00
chore: migrate to wearepixel/laravel-cart
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
<a name="top"></a>
|
||||
[](https://joelmale.com)
|
||||
[](https://packagist.org/packages/joelwmale/laravel-cart)
|
||||
[](https://github.com/joelwmale/laravel-cart/actions?query=workflow%3ATests+branch%3Amaster)
|
||||
[](https://packagist.org/packages/joelwmale/laravel-cart)
|
||||
[](#)
|
||||
[](https://packagist.org/packages/joelwmale/laravel-cart)
|
||||
[](https://packagist.org/packages/wearepixel/laravel-cart)
|
||||
[](https://github.com/wearepixel/laravel-cart/actions?query=workflow%3ATests+branch%3Amaster)
|
||||
[](https://packagist.org/packages/wearepixel/laravel-cart)
|
||||
[](#)
|
||||
[](https://packagist.org/packages/wearepixel/laravel-cart)
|
||||
[](#-license)
|
||||
|
||||
A Cart Implementation for Laravel.
|
||||
|
||||
Supported Laravel Versions: 10, 11, and 12.
|
||||
|
||||
For Laravel 9.0 and below, please use version [1.0](https://github.com/joelwmale/laravel-cart/releases/tag/1.0.12)
|
||||
For Laravel 9.0 and below, please use version [1.0](https://github.com/wearepixel/laravel-cart/releases/tag/1.0.12)
|
||||
|
||||
## Table of Contents
|
||||
- [Getting Started](#-getting-started)
|
||||
@@ -31,7 +31,7 @@ ### 🔥 Installing
|
||||
|
||||
Install the package through [Composer](http://getcomposer.org/).
|
||||
|
||||
`composer require joelwmale/laravel-cart`
|
||||
`composer require wearepixel/laravel-cart`
|
||||
|
||||
## 🧑🍳 Demo
|
||||
|
||||
@@ -71,7 +71,7 @@ ### ⚙️ Configuration
|
||||
You can publish the configuration file to customize various options.
|
||||
|
||||
```php
|
||||
php artisan vendor:publish --provider="Joelwmale\Cart\CartServiceProvider" --tag="config"
|
||||
php artisan vendor:publish --provider="Wearepixel\Cart\CartServiceProvider" --tag="config"
|
||||
```
|
||||
|
||||
#### Formatting Numbers
|
||||
@@ -328,7 +328,7 @@ ##### Adding a condition to the cart: **Cart::condition()**
|
||||
|
||||
```php
|
||||
// Add a single condition to the cart
|
||||
$condition = new \Joelwmale\Cart\CartCondition([
|
||||
$condition = new \Wearepixel\Cart\CartCondition([
|
||||
'name' => 'Tax: 10%',
|
||||
'type' => 'tax',
|
||||
'target' => 'subtotal', // this condition will be applied to cart's subtotal when getSubTotal() is called.
|
||||
@@ -341,7 +341,7 @@ ##### Adding a condition to the cart: **Cart::condition()**
|
||||
Cart::condition($condition);
|
||||
|
||||
// Add multiple conditions
|
||||
$tax = new \Joelwmale\Cart\CartCondition([
|
||||
$tax = new \Wearepixel\Cart\CartCondition([
|
||||
'name' => 'Tax: 10%',
|
||||
'type' => 'tax',
|
||||
'target' => 'subtotal', // this condition will be applied to cart's subtotal when getSubTotal() is called.
|
||||
@@ -349,7 +349,7 @@ ##### Adding a condition to the cart: **Cart::condition()**
|
||||
'order' => 2
|
||||
]);
|
||||
|
||||
$shipping = new \Joelwmale\Cart\CartCondition([
|
||||
$shipping = new \Wearepixel\Cart\CartCondition([
|
||||
'name' => 'Shipping: $15',
|
||||
'type' => 'shipping',
|
||||
'target' => 'subtotal', // this condition will be applied to cart's subtotal when getSubTotal() is called.
|
||||
@@ -364,7 +364,7 @@ ##### Adding a condition to the cart: **Cart::condition()**
|
||||
Cart::condition([$tax, $shipping]);
|
||||
|
||||
// add condition to only apply on totals, not in subtotal
|
||||
$shipping = new \Joelwmale\Cart\CartCondition([
|
||||
$shipping = new \Wearepixel\Cart\CartCondition([
|
||||
'name' => 'Express Shipping $15',
|
||||
'type' => 'shipping',
|
||||
'target' => 'total',
|
||||
@@ -556,7 +556,7 @@ #### Conditions on items
|
||||
```php
|
||||
|
||||
// lets create first our condition instance
|
||||
$saleCondition = new \Joelwmale\Cart\CartCondition([
|
||||
$saleCondition = new \Wearepixel\Cart\CartCondition([
|
||||
'name' => '50% Off',
|
||||
'type' => 'tax',
|
||||
'value' => '-50%',
|
||||
@@ -576,7 +576,7 @@ #### Conditions on items
|
||||
Cart::add($product);
|
||||
|
||||
// You can of course also do multiple conditions on an item
|
||||
$saleCondition = new \Joelwmale\Cart\CartCondition([
|
||||
$saleCondition = new \Wearepixel\Cart\CartCondition([
|
||||
'name' => 'SALE 5%',
|
||||
'type' => 'sale',
|
||||
'value' => '-5%',
|
||||
|
||||
Reference in New Issue
Block a user