forse i problemi della funzione money li ho risolti adesso però mi esce questo
codice:
public static function cart($items = []) {
$output = [];
if(count($items) > 0) {
foreach($items as $item) {
$out = [
'id' => $item['id'],
'name' => ucwords($item['name']),
'price' => str_replace('eu', '€', number_format('%!.2n', $result, floatval($product['price']))),
'quantity' => $item['quantity'],
'subtotal' => str_replace(('eu', '€', number_format('%.2n',floatval($item['subtotal']))),
'link' => SITE_URL . 'product/' . $item['slug'],
'image' => SITE_URL . 'public/assets/images/' . $item['image']
];
$output[] = $out;
}
}
return $output;
}
Codice PHP:
'subtotal' => str_replace(('eu', '€', number_format('%.2n',floatval($item['subtotal']))),