Download the PHP package justinholtweb/craft-present without Composer

On this page you can find all versions of the php package justinholtweb/craft-present. 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 craft-present

Present

Product bundles and build-your-own-box for Craft Commerce 5.

A variant is one thing with one SKU and one stock figure. A bundle is several things that are picked, stocked and shipped separately, and sold as one. Present is built around that difference rather than around it.

What makes it different

Every other bundle plugin for Craft sells a bundle as one line item. That is a reasonable place to start and a dead end: Commerce commits stock per purchasable and records fulfilment per line item, so a single-line bundle can never decrement the right stock, can never be partly shipped, and can never be taxed correctly when its contents are taxed at different rates.

Present puts a container line item plus one real line item per component in the cart — the same shape WooCommerce Product Bundles uses, and the reason it can do things variants cannot:

A variant A single-line bundle Present
Stock comes off the right SKU ✓ ✗ ✓
Sells out when its contents do n/a ✗ ✓
Can be partly shipped ✗ ✗ ✓
Mixed tax rates inside one box ✗ ✗ ✓
Shopper picks the contents ✗ sometimes ✓

Requirements

Craft CMS 5.3+, Craft Commerce 5.0+, PHP 8.2+.

Installation

Editions

Lite is free and is a complete bundle plugin: bundle types and bundle elements, fixed slots with a list of choices, both pricing modes, slot and option discounts, the stock rollup, and the Twig API.

Pro ($99, $79/year renewal) adds the things that need a shopper in the loop or a warehouse at the other end:

Pro settings on a Lite install are ignored, not obeyed. They stay in the database untouched, the control panel says which ones are being ignored, and upgrading restores them. A store that lapses does not keep selling boxes it can no longer validate.

Quick start

Make a bundle type under Present → Bundle Types, then a bundle under Present → Bundles. A bundle needs at least one slot; each slot is a thing that goes in the box and a list of what may go there.

The simplest possible template

That renders the box builder: pickers for every slot, live pricing, live stock, min/max enforced, and an add-to-cart button. It has no dependencies and inherits nothing from the control panel.

Building the form yourself

For a build-your-own box, post quantities instead: selection[fillings][{{ option.id }}] = 3.

Showing boxes in the cart

Component line items are real line items, so a cart template that loops over cart.lineItems without knowing about Present will list a box's contents as separate rows. Two helpers fix that:

Remove a whole box with present/cart/remove and its groupKey, never by deleting a line item.

Stock

Without a configuration this is the optimistic answer: whether some box can still be built. Pass a configuration for the exact one.

Fulfilment

Documentation

justinholt.com/plugins/craft-present/docs, or in this repository:

Console

Testing

74 integration checks, run against a real Craft + Commerce install:

The suite is idempotent and self-cleaning. tests/integration/sweep.php clears fixtures left by a run that was killed part-way.

Licence

The Craft License. See LICENSE.md. Lite is free; Pro is a paid edition licensed through the Craft Plugin Store.


All versions of craft-present with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
craftcms/cms Version ^5.3.0
craftcms/commerce Version ^5.0.0
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 justinholtweb/craft-present contains the following files

Loading the files please wait ...