Download the PHP package marshmallow/cart without Composer

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

alt text

Ecommerce Shopping Cart

Version Issues Licence

This package contains all the logic you need to make use of a shopping cart in your Laravel application. It also contains all the Nova resources you need to manage your store. We use this package at Marshmallow for a lot of customers and add new functionalities when ever we need them. If you wish to use this, please do so and let us know if you have any issues.

Installation

Composer

You can install this package via the following composer command.

Migrate

You need to run the migration from this package to create all the tables we need to do some ecommerce magic.

Middleware

Please add the following middle ware to your web group to make sure the cart is available on every route. If you wish to include this middleware to a select set of route you can do so.

Nova

Run the commands below to publish all the Nova resources that you need to manage all the ecommerce stuff.

Seed tables

We have created seeders for ecommerce site in the Netherlands. If you are running a dutch shop, you can run these seeders. If not, don't run these. Just create your own via the Nova resources you've just created.

Envoirment file

Make sure you set the CURRENCY value in you .env file to match the currency you are using.

Events

This package triggers a set of events which you can listen to in your application if you wish to do so.

Name Description
CustomerCreated This will be triggered once a new customer has been created.
OrderCreated This will be triggerd once a new order has been created.

Discounts

Setup

To use the discount module, you first need to make sure you have run all the migrations.

Create the Nova resource

You need to publish the Nova resource to be able to create new discount code's in Nova. Run the command below.

Publish the new config

There is a new config file that handles defaults for the discount functionalities. Run the command below to publish the new config file.

Key Description
voucher.min_length The minimum required length of a voucher code
voucher.exclude_rules The exlusion rules for the code generator
default.vat_rate The default vat rate we need to use for the discount
default.currency The default currency we need to use for the discount

Usage

Adding a discount

To add the discount to a shopping cart, you need to create your own route/endpoint to handle this. You can use the example code below to active the discount. If all is oke, the $response will be empty. If something went wrong this method will return an error message containing the reason why we couldn't add the discount to the cart.

Deleting a discount

If you made the customer to be able to delete an activated discount from the shopping cart, you will again have to create your own route/endpoint for this. You can then use the example code below to remove the discount from the card.

Cart methods

With the introduction of the discount methods you might need to update the methods that are used in your shopping cart to display cart totals. Please see the new methods below.

Cart methods

Item methods

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of cart with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
marshmallow/nova-flexible Version ^v2.0.0
marshmallow/nova-field-string-generator Version ^v2.0.0
marshmallow/priceable Version ^v3.0.0
marshmallow/products Version ^v3.0.0
marshmallow/payable Version ^v2.0.0
marshmallow/dataset-country Version ^v1.2.2
marshmallow/addressable Version ^v1.6.1
marshmallow/nova-tabs Version ^2.0.3
laravel/nova Version ^4.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 marshmallow/cart contains the following files

Loading the files please wait ....