Download the PHP package bozboz/orders without Composer

On this page you can find all versions of the php package bozboz/orders. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package orders

Orders package

Installation

  1. See http://gitlab.lab/laravel-packages/ecommerce
  2. Run php artisan vendor:publish && php artisan migrate
  3. Edit config/orders.php (see Order States)

Usage

Cart

To add an item to the cart you must post the following info to /cart/items:

To add multiple items send an array containing multiples of the above data in products.

e.g.

products[0][orderable_factory]
products[0][orderable]
products[0][quantity]

Order States

The state of each order is handled by a finite state machine. See http://yohan.giarel.li/Finite/ for details on how the state machine functions.

The states available to the order are configured in config/orders.php. There are a couple of custom properties that can be set on each state:

OrderRepository

The order repository is responsible for fetching the order for the checkout process. The default repo will fetch the order ID from the session and return the order instance. The first screen in the order process is responsible for saving the order ID to the session. The repo must return an instance the implements the Checkoutable interface in the checkout package. There is a CheckoutableOrder model for this purpose that extends the base Order model.

Order Items

Adding items to an order requires that the item implement the Orderable interface.

Customers

The customer model extends the user model and adds relations for orders and addresses. This allows the site to save customer data, allowing them to login and use their saved data/addresses to speed up the checkout process.

In order to use saved addresses the address must be linked to the customer. There is an event listener for this (Bozboz\Ecommerce\Orders\Customers\Addresses\Listeners\LinkAddressToCustomer) that can be triggered by the Bozboz\Ecommerce\Orders\Events\OrderComplete event. This has to be set up manually in the app.

For an example implementation of registered customers see http://gitlab.lab/bozboz/finecut/tree/master/screens

Addresses

For an example of how to implement saved addresses see http://gitlab.lab/bozboz/finecut/blob/master/screens/AddressSelection.php (though you can ignore the stuff about account addresses, that was specific to Finecut)

Refunds

The Refund class will create a copy of the order record in the database and link it to the master record via the parent_order_id column. This allows the original order to remain unchanged to maintain the history.

Events

Notification Emails

The Bozboz\Ecommerce\Orders\Listeners\Notify will trigger every time Bozboz\Ecommerce\Orders\Events\OrderStateTransition is fired. This listener will check to see if a view exists in ecommerce::emails.notifications... with a name the same as the transition. If a view is present then that will be used to send an email to the user who is placing the order along with the email set in 'ecommerce.order_cc_email_address' if present.


All versions of orders with dependencies

PHP Build Version
Package Version
Requires yohang/finite Version ^1.1
venturecraft/revisionable Version ^1.28
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bozboz/orders contains the following files

Loading the files please wait ....