Sellissimo

Customize unit prices and add an order charge

Apply volume or account pricing before discounts and add a named fee that follows the order through refunds and reporting.

Browse guides
On this page

Change the price of an individual unit#

Implement Sellissimo\Core\Contracts\UnitPriceProvider in your add-on. Register the instance with $registry->unitPrice('volume', $provider) and enable volume in unit_price_providers in config/sellissimo.php.

For example, this method prices a pack of paper at USD 1.25 per unit when the buyer orders ten or more:

public function unitPrice(int $amount, array $product, array $line, array $cart): ?int
{
    if ($cart['currency'] === 'USD' && $product['sku'] === 'PAPER' && $line['qty'] >= 10) {
        return 125;
    }

    return null;
}

Providers run in configured order. Each receives the preceding unit price, starting with the catalog offer. Return null to keep it or an integer from 0 to 99,999,999 in minor units to replace it. Use the verified customer ID in the cart for account pricing. Staff-entered draft prices take precedence. Public catalog pages and price filters use the catalog price. Show the buyer’s actual price from the private quote or cart tag.

Add a handling fee to the whole order#

Generate a package in the store and install it locally:

php artisan sellissimo:make-extension charge "Handling"
composer config repositories.handling path addons/sellissimo/handling-charge
composer require store-extensions/handling-charge:@dev

The generated provider registers handling with orderCharge. Add 'order_charge_providers' => ['handling'] to the store configuration. In its OrderChargeProvider::charge($publicQuote, $site, $customer) implementation, return a label and amount, for example ['label' => 'Handling', 'amount' => 250] for USD 2.50. Check the currency before returning that amount. Return null or a zero amount to omit the fee. An optional tax_class applies the class’s billing-address rate and inclusive setting.

Quoting can call either type of provider repeatedly. Keep these calculations free of external side effects. On the final quote, check charges['handling'] for its label, subtotal, tax and total. The overall order total already includes the fee. Preview a paid-order amendment to see it recalculated. In a refund, choose the fee as the target (@charge:handling in the data). The sales report lists net order charges separately.

All guides in Build a storefront