-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
46 lines (35 loc) · 740 Bytes
/
functions.php
File metadata and controls
46 lines (35 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
use Hcode\Model\Cart;
use Hcode\Model\User;
function formatPrice($vlprice)
{
if (!$vlprice > 0) {
$vlprice = 0;
}
return number_format($vlprice, 2, ',', '.');
}
function formatDate($date)
{
return date('d/m/Y', strtotime($date));
}
function checkLogin($inadmin = true)
{
return User::checkLogin($inadmin);
}
function getUserName()
{
$user = User::getFromSession();
return $user->getdesperson();
}
function getCartNrQtd()
{
$cart = Cart::getFromSession();
$totals = $cart->getProductsTotals();
return $totals['nrqtd'];
}
function getCartVlSubTotal()
{
$cart = Cart::getFromSession();
$totals = $cart->getProductsTotals();
return formatPrice($totals['vlprice']);
}