![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/job-board.corals.io/Corals/modules/Marketplace/Classes/ |
<?php namespace Corals\Modules\Marketplace\Classes; use Corals\Modules\Marketplace\Traits\CartOptionsMagicMethodsTrait; /** * Class CartFee. */ class CartFee { use CartOptionsMagicMethodsTrait; public $locale; public $amount; public $taxable; public $tax; public $internationalFormat; /** * CartFee constructor. * * @param $amount * @param $taxable * @param array $options */ public function __construct($amount, $taxable = false, $options = []) { $this->amount = floatval($amount); $this->taxable = $taxable; $this->tax = isset($options['tax']) ? $options['tax'] == 0 ? config('shoppingcart.tax') : $options['tax'] : config('shoppingcart.tax'); $this->options = $options; } /** * Gets the formatted amount. * * @param bool $format * @param bool $withTax * * @return string */ public function getAmount($format = true, $withTax = false) { $total = $this->amount; if ($withTax) { $total += $this->tax * $total; } return ShoppingCart::formatMoney($total, $this->locale, $this->internationalFormat, $format); } }