docs/api/source-extension.opencart.catalog.model.total.low_order_fee.html
| 1: | <?php | | 2: | namespace Opencart\Catalog\Model\Extension\Opencart\Total; | | 3: | /** | | 4: | * Class LowOrderFee | | 5: | * | | 6: | * @package Opencart\Catalog\Model\Extension\Opencart\Total | | 7: | */ | | 8: | class LowOrderFee extends \Opencart\System\Engine\Model { | | 9: | /** | | 10: | * Get Total | | 11: | * | | 12: | * @param array<int, array<string, mixed>> $totals | | 13: | * @param array<int, float> $taxes | | 14: | * @param float $total | | 15: | * | | 16: | * @return void | | 17: | */ | | 18: | public function getTotal(array &$totals, array &$taxes, float &$total): void { | | 19: | if ($this->cart->getSubTotal() && ($this->cart->getSubTotal() < (float)$this->config->get('total_low_order_fee_total'))) { | | 20: | $this->load->language('extension/opencart/total/low_order_fee'); | | 21: | | | 22: | $totals[] = [ | | 23: | 'extension' => 'opencart', | | 24: | 'code' => 'low_order_fee', | | 25: | 'title' => $this->language->get('text_low_order_fee'), | | 26: | 'value' => (float)$this->config->get('total_low_order_fee_fee'), | | 27: | 'sort_order' => (int)$this->config->get('total_low_order_fee_sort_order') | | 28: | ]; | | 29: | | | 30: | if ($this->config->get('total_low_order_fee_tax_class_id')) { | | 31: | $tax_rates = $this->tax->getRates($this->config->get('total_low_order_fee_fee'), $this->config->get('total_low_order_fee_tax_class_id')); | | 32: | | | 33: | foreach ($tax_rates as $tax_rate) { | | 34: | if (!isset($taxes[$tax_rate['tax_rate_id']])) { | | 35: | $taxes[$tax_rate['tax_rate_id']] = $tax_rate['amount']; | | 36: | } else { | | 37: | $taxes[$tax_rate['tax_rate_id']] += $tax_rate['amount']; | | 38: | } | | 39: | } | | 40: | } | | 41: | | | 42: | $total += $this->config->get('total_low_order_fee_fee'); | | 43: | } | | 44: | } | | 45: | } | | 46: | |
OpenCart API API documentation generated by ApiGen dev-master