Cart

Created by:  Sam Poyigi
 12,563

Easily add a shopping cart to your site. The most powerful way to sell your menu items.

 Extension
Version
v2.3.1
Updated
3 weeks ago
Published
2 years ago
Author
Sam Poyigi

Support the author with a donation.

  Donate

Igniter Cart extension is simple, flexible shopping cart. There are some features:

  • Stock control
  • Cart conditions: Coupon, Tax
  • Order types: Delivery, Pick-up
  • Abandoned Checkout
  • Payment method: Cod, Paypal, Stripe
  • One page checkout
  • Easy to extends and customize
  • Sending order confirmation emails

This extension requires the following extensions:

  • Igniter Local
  • Igniter User
  • Igniter PayRegister

Admin Panel

In the admin user interface you can manage the cart conditions.

Components

Name Page variable Description
CartBox @component('cartBox') Show the contents of and manages the user's cart
Checkout @component('checkout') Displays Checkout form on the page
OrderPage @component('orderPage') Displays a single order on the page
Orders @component('orders') Displays a list of orders on the page

CartBox Component

Properties

Property Description Example Value Default Value
showCartItemThumb Show cart menu item image in the popup true/false false
cartItemThumbWidth Cart item image width 720 720
cartItemThumbHeight Cart item image height 300 300
checkStockCheckout Check cart item stock quantity true/false false
pageIsCheckout Value to determine if the user is on a checkout page true/false false
pageIsCart Display a standalone cart true/false false
hideZeroOptionPrices Whether to hide zero prices on options true/false false
checkoutPage Checkout page path checkout/checkout checkout/checkout
localBoxAlias Specify the LocalBox component alias used to refresh the localbox after the order type is changed localBox localBox

Variables available in templates

Variable Description
{{ $cart }} Cart Class instance

Example:

---
title: 'Checkout'
permalink: /checkout

'[cartBox]':
    cartBoxTimeFormat: 'ddd hh:mm a'
    checkStockCheckout: 0
    pageIsCheckout: 0
    pageIsCart: 0
    checkoutPage: checkout/checkout
---
...
@component('cartBox')
...

Checkout Component

Properties

Property Description Example Value Default Value
showCountryField Show/hide the country checkout field true/false false
agreeTermsPage Terms and conditions page page/terms
menusPage Menus page page/menus
redirectPage Redirect page name checkout/checkout checkout/checkout
orderPage Order page name account/order account/order
successPage Order confirmation page name checkout/success checkout/success
successParamCode URL routing code used for displaying the order confirmation page hash hash

Variables available in templates

Variable Description
{{ $order }} Order Model instance
{{ $paymentGateways }} Instances of available payment gateways

Example:

---
title: 'Checkout'
permalink: /checkout

'[checkout]':
    showCountryField: 0
    menusPage: local/menus
    redirectPage: checkout/checkout
    successPage: checkout/success
    successParamCode: 'hash'
---
...
@component('checkout')
...

Registering a new Cart Condition

Here is an example of an extension registering a cart condition.

public function registerCartConditions()
{
    return [
        \Igniter\Local\CartConditions\Tip::class => [
            'name' => 'tip',
            'label' => 'Tip',
            'description' => 'Applies tips to cart total',
        ]
    ];
}

Automations

Events

  • Order Placed Event
  • Order Status Update Event
  • Order Assigned Event

Conditions

  • Order Attributes
  • Order Status Attributes

Notifications

  • Order confirmation notification
  • Order status update notification
  • Order assigned notification

Events

The Cart Library used with this extension will fire some global events that can be useful for interacting with other extensions.

Event Description Parameters
cart.created When cart instance is created.
cart.added When an item has been added to the cart. The CartItem instance
cart.updated When an item has been updated in the cart. The CartItem instance
cart.removed When an item has been removed from the cart. The CartItem instance
cart.cleared When all items has been cleared from the cart.
cart.condition.loaded When a condition has been loaded to the cart. The CartCondition instance
cart.condition.removed When a condition has been removed from the cart. The CartCondition instance
cart.condition.cleared When all condition has been cleared from the cart.
cart.stored When the content of a cart was stored.
cart.restored When the content of a cart was restored.

Example of hooking an event

Event::listen('cart.updated', function($cartItem) {
    // ...
});

License

The MIT License (MIT)

Releases

  1.   Latest release
    v2.3.1

    Bug fixes

  2. v2.3.0

    Improvements and bug fixes

  3. v2.2.0

    ❗️❗️❗️Requires v3.0.4-beta.22

    What’s new

    • Your customers now have the option to tip once enabled from the admin panel.
    • Your menu items can now be made available at multiple mealtimes

    Improvements

    • The time picker component partial now gets updated when order type option toggled
    • When updating cart item quantity, you can now set the quantity to 0 to remove the item from cart
    • Your customers can now save their card details to use later during checkout
    • Moved change order type feature to the localBox component
    • Consistent validation rule for all names and emails
    • When completing an order with no required payment, the payment field is now set to null

    Bug Fixes

    • Fixed a bug where the delivery address was not validated for customers during checkout
    • Fixed a bug where the payment fee (if available) of the selected payment was not applied for customers visiting the checkout page the first time
  4. v2.1.5

    ❗ Breaking changes and bug fixes.. Requires v3.0.4-beta.20+