-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
40 lines (34 loc) · 893 Bytes
/
functions.php
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
<?php
use \Hcode\Model\User;
use \Hcode\Model\Cart;
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']);
}
?>