Download the PHP package revinners/shopware6-add-to-basket-plugin without Composer

On this page you can find all versions of the php package revinners/shopware6-add-to-basket-plugin. 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 shopware6-add-to-basket-plugin

Add to basket plugin for Shopware 6

The plugin provides a simple API endpoint to add products to the shopping cart.

If you'd like to learn more or work with us, visit our website at revinners.com for more information.

Installation

Usage

Call the API endpoint with the SKU and quantity of the product to add. The endpoint will return a JSON response.

Endpoint: /add-to-basket
Method: GET
Parameters:

Example Request

Example Responses

Cart info

Returns a summary of the current session's cart (item count and totals). Read-only — it does not modify the cart.

Endpoint: /cart-info
Method: GET
Parameters: none

The cart is resolved from the current storefront session cookie, so the request must be sent same-origin with credentials (the cookie). This is the same consumption model as /add-to-basket.

Example Request

Example Response

Response fields

Field Type Description
success bool Always true for a successful response.
count int Total quantity of the eligible line items (sum of quantities) — the usual basket-badge number.
lineItemCount int Number of distinct line items in the cart (all types).
totalPrice string Gross total of the eligible line items, formatted with 2 decimals and a . separator (e.g. "123.45").
netPrice string Net total of the eligible line items, same formatting as totalPrice.
currencyId string ID of the sales-channel currency the totals are expressed in.
appliedDiscounts array One entry per applied promotion (after Shopware's exclusions). Each: percentage (declared % for percentage discounts, otherwise effective share of the item value), isPercentage (bool), hasCode (bool — true for redeemed coupon codes, false for automatic promotions), promotionId (string|null). Lets the storefront tell which discount is actually active.

Note: the totals sum all line items regardless of type (a cart may hold several product-like types), except the battery deposit (battery_deposit) and promotions (promotion), which are left out of count, totalPrice and netPrice. The thresholds are meant to be compared against the value of the items themselves, so an applied discount must not lower it. Shipping/delivery costs are excluded implicitly because they are not line items. For an empty cart all numeric values are 0 / "0.00".

Testing

License

This plugin is licensed under the MIT License. You are free to use, modify, and distribute this software in accordance with the terms of the license.

For more details, see the LICENSE file included in this repository.

About us

At Revinners, we specialize in building e-commerce shops and developing custom plugins based on the Shopware 6 platform. Our goal is to deliver efficient, scalable, and tailored solutions to meet the unique needs of online businesses.

If you'd like to learn more or work with us, visit our website at revinners.com for more information.


All versions of shopware6-add-to-basket-plugin with dependencies

PHP Build Version
Package Version
Requires shopware/core Version ~6.6.0
php Version >=8.2
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 revinners/shopware6-add-to-basket-plugin contains the following files

Loading the files please wait ...