public static function Utility::getTotalPriceMarkupData in Basic cart 8.2
Same name and namespace in other branches
- 8.6 src/Utility.php \Drupal\basic_cart\Utility::getTotalPriceMarkupData()
- 8 src/Utility.php \Drupal\basic_cart\Utility::getTotalPriceMarkupData()
- 8.0 src/Utility.php \Drupal\basic_cart\Utility::getTotalPriceMarkupData()
- 8.3 src/Utility.php \Drupal\basic_cart\Utility::getTotalPriceMarkupData()
- 8.4 src/Utility.php \Drupal\basic_cart\Utility::getTotalPriceMarkupData()
- 8.5 src/Utility.php \Drupal\basic_cart\Utility::getTotalPriceMarkupData()
Get Total price data.
1 call to Utility::getTotalPriceMarkupData()
- CartForm::buildForm in src/
Form/ CartForm.php - Form constructor.
File
- src/
Utility.php, line 392
Class
- Utility
- Utilty functions for basic cart.
Namespace
Drupal\basic_cartCode
public static function getTotalPriceMarkupData() {
$config = Utility::cartSettings();
$price = Utility::getTotalPrice();
$total = Utility::formatPrice($price->total);
$vat_is_enabled = (int) $config
->get('vat_state');
$vat_value = !empty($vat_is_enabled) && $vat_is_enabled ? Utility::formatPrice($price->vat) : 0;
$basic_cart = array(
'total_price' => $total,
'vat_enabled' => $vat_is_enabled,
'vat_value' => $vat_value,
'total_price_label' => $config
->get('total_price_label'),
'total_vat_label' => 'Total VAT',
);
return $basic_cart;
}