geniv/nette-order-control

Order control class for Nette Framework

v1.0.1 2018-12-19 18:45 UTC

This package is auto-updated.

Last update: 2020-09-19 23:22:51 UTC


README

Installation

$ composer require geniv/nette-order-control

or

"geniv/nette-order-control": ">=1.0.0"

require:

"php": ">=7.0.0"

Include in application

content of IOrderControl:

//const:
IOrderControl::CURRENCY_CZK
IOrderControl::CURRENCY_EUR
IOrderControl::CURRENCY_USD
IOrderControl::CURRENCY_GBP

//method:
setPrice(float $price): IOrderControl;
setVat(float $vat): IOrderControl;
setCurrency(string $currency): IOrderControl;

getCurrency(): string;
getPrice(): float;
getVat(): float;

getPriceVat($priceAndVat = false): float;
getPriceTotal($priceAndVat = false): float;

setPayment(string $name, float $price, float $vat): IOrderControl;
getPaymentName(): string;
getPaymentPrice(): float;
getPaymentPriceVat($priceAndVat = false): float;

setDelivery(string $name, float $price, float $vat): IOrderControl;
getDeliveryName(): string;
getDeliveryPrice(): float;
getDeliveryPriceVat($priceAndVat = false): float;

getOrderNumber(array $items, int $zeros = self::ZEROS): string;

php usage:

$orderControl = new OrderControl();
$orderControl->setPrice($this->price);
$orderControl->setVat($this->vat);
$orderControl->setCurrency($this->currency);

$orderControl->setPayment($item['driver'], $item['price'], $this->vat);

$orderControl->setDelivery($item['driver'], $item['price'], $this->vat);

latte usage:

{$orderControl->getPrice()}
{$orderControl->getPriceVat(true)}