marshmallow/priceable

Package for handeling prices

v3.0.0 2022-05-10 17:26 UTC

README

alt text

Marshmallow Products

Deze package gaat alle logica houden voor producten. Producten zullen in het algemeen gebruikt worden in combinatie met de Cart of Ecommerce package.

Installatie

composer require marshmallow/priceable

Vendor Publish

...

php artisan vendor:publish --provider="Marshmallow\Priceable\PriceableServiceProvider" --tag="config" --force

Methods

Currency::getUserCurrent();
Currency::getExceptUserCurrent()

Routes

@foreach (\Marshmallow\Priceable\Models\Currency::get() as $currency)
    <a href="{{ route('set-currency', $currency) }}">
        {{ $currency->name }}
    </a>
@endforeach

Available methods

currentPrice() isDiscounted() discountedFrom()

CURRENCY=eur

php artisan db:seed --class=Marshmallow\Product\Database\Seeds\VatRatesSeeder

To do

php artisan marshmallow:resource Price Priceable php artisan marshmallow:resource VatRate Priceable php artisan marshmallow:resource Currency Priceable php artisan marshmallow:resource PriceType Priceable

Tests

Priceable is_can_make_use_of_the_price_facade

Currency //

VAT //

Price it_has_one_currency it_has_one_vat_rate it_makes_use_of_default_vatrate_id it_makes_use_of_default_currency_id it_calculates_including_price_correctly_from_excluding_amount it_calculates_excluding_price_correctly_from_excluding_amount it_calculates_vat_amount_correctly_from_excluding_amount it_calculates_including_price_correctly_from_including_amount it_calculates_excluding_price_correctly_from_including_amount it_calculates_vat_amount_correctly_from_including_amount it_returns_a_carbon_instance_for_valid_from it_returns_a_carbon_instance_for_valid_till

Extra

factory(Marshmallow\Product\Models\Product::class, 10)->create();

Tests during development

php artisan test packages/marshmallow/priceable ...