Cart class
Cart
Post form data to /cart.
License and addons are save for each product. If you add to an existing product in the cart, it will change license/addon/uri for this product. Otherwise new product will be added.
If you post via javascript, you need to prefix form data name field with:
- font_[…]
- The cart saves bot UUID and URI. URI to make lookup fast.
- Value needs to be formatted like this,
UUID,URI
- license_[…]
- Product can have multiple licenses added, for exampe webfont, desktop and so on.
- Value needs to be formatted like this,
UUID,license_id
- addon_[…]
$cart->addProduct( $uuid, $uri, $license, $addon)
addProduct( string $uuid, ?string $uri, array $licenses, array $addons )
removeProduct( string $uuid )
- removeLicense( string $uuid, string $license )
- Remove license id from product in cart.
removeAddon( string $uuid, string $addon )
- getProducts()
- Returns cart products with licenses and addons for each item. As comma seperated string with
$cartItem->licenses()
and$cartItem->addons()
. - return
Kirby\Cms\Collection
getNumItems ()
getProductLicenses( string $uuid )
hasProduct( string $uuid )
hasLicense( string $uuid, array $licenses )
updateProduct( string $uuid, ?string $uri, ?array $licenses, ?array $addons )
clearEmptyLicenses() – remoes all fonts in cart without any license added.
clearCart()
getPaylink() – for now, this returns a Paddle paylink.
getLicensee() – return order licensee
setLicensee( string $licensee ) – set order licensee.
getTitle() – return cart title used in Paddle receipt/invoice.
getPassthrough() – encryptet passthrough includes all info needed to fullfill a purchase.
getSubtotal() – Cart sub total, without VAT applied.