Download the PHP package syscover/shoppingcart without Composer

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

Advanced ShoppingCart to Laravel 5.3

Total Downloads

Installation

1 - After install Laravel framework, insert on file composer.json, inside require object this value

and execute on console:

2 - Register service provider, on file config/app.php add to providers array

And register alias, on file config/app.php add to aliases array

3 - Execute publish command

To run laravel testing

publish testing files

and run the test using the following command:

General configuration environment values

We indicate configuration variables available, to change them what you should do from the file environment variables .env

Set product price tax [default value 1]

Defines the types of prices that are introduced in products, this option is consulted when you create or update a product You have this values:

Set shipping price tax [default value 1]

Defines the types of prices that are introduced in shipping prices, this option is consulted when you create or update a shipping price

Set product display price tax [default value 1]

Defines how you want display product prices You have this values:

Set shipping display price tax [default value 1]

Defines how you want display shipping prices

The Item Cart gives you the following methods to use:

To add items we have create a Item object with this properties:

Add car item to cart, you need create Item objects to add cart, you can use a Item object or Items array if you want add various elements.

We have created TaxRule object to calculate tax from shopping cart, this object has this properties:

Cart is ready to TaxRule object, you can add tax rules to each cartItem object. You can add only one TaxRule or various with a array tax rules

Once defined the rules, you can change them using this method

Of course, you can also reload other rules if necessary

Remember this, if you reset taxRules or add new tax rules to item, you must force calculate amounts from subtotal

To update quantity from a item you have setQuantity method, you'll pass the update method the rowId and the new quantity

If you want to update more attributes of the item, you can pass Item object to the update method with rowId from item to update.

To remove element from the cart, the remove() method on the cart and pass it the rowId

If you want to get the cart items, you have getCartItems method. This method will return a Collection of CartItems which you can iterate over and show the content to your customers.

If you want to get quantity from each items, you can use getQuantity method over each item

If you want to get an item from the cart using its rowId, you can simply call the get() method on the cart and pass it the rowId.

If you want to completely remove the content of a cart, you can call the destroy method on the cart. This will remove all CartItems from the cart for the current cart instance.

Get the subtotal price, without tax

Get tax amount from all items

To get total price

To set shipping amount

To get shipping amount

To know if cart contain any item transportable, you have method

Get the number of items in the cart, total items

To find an item in the cart, you can use the search() method. As you can see the Closure will receive two parameters. The first is the CartItem to perform the check against. The second parameter is the rowId of this CartItem.

The method will return a Collection containing all Items that where found

This way of searching gives you total control over the search process and gives you the ability to create very precise and specific searches.

The package also supports multiple instances of the cart. The way this works is like this: You can set the current instance of the cart with CartProvider::instance('newInstance'), at that moment, the active instance of the cart is newInstance, so when you add, remove or get the content of the cart, you work with the newInstance instance of the cart. If you want to switch instances, you just call CartProvider::instance('otherInstance') again, and you're working with the otherInstance again.

The default cart instance is called default, so when you're not using instances, CartProvider::instance()->getCartItems(); is the same as CartProvider::instance('default')->getCartItems().

So a little example:

We have created PriceRule object to apply discounts over items cart

With this constants from PriceRule class, you can define discount type

To set price rules you can use addCartPriceRule methop

Scenarios to consider when applying to the pricing rules


All versions of shoppingcart with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.4
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 syscover/shoppingcart contains the following files

Loading the files please wait ....