-
Notifications
You must be signed in to change notification settings - Fork 0
/
commanderegistresousitemdel.php
90 lines (73 loc) · 3.01 KB
/
commanderegistresousitemdel.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
require_once("./stpiadmin/includes/includes.php");
require_once("./stpiadmin/includes/classes/commande/clscommande.php");
require_once("./stpiadmin/includes/classes/commande/clscommandesession.php");
$objCommande = new clscommande();
$objCommandeSession = new clscommandesession();
$objTexte = new clstexte("./texte/checkout");
$objRegistre =& $objCommande->stpi_getObjRegistre();
if (!isset($_GET["nbSousItemID"]))
{
exit;
}
if (!isset($_SESSION["stpiObjCommandeRegistreSession"]))
{
print("<span style=\"color:#FF0000;\">" . $objTexte->stpi_getArrErrTxt("emptycart") . "</span><br/>\n");
exit;
}
if (!$objCommandeSession = $objCommandeSession->stpi_getObjCommandeRegistreSessionFromSession())
{
print("<span style=\"color:#FF0000;\">" . $objTexte->stpi_getArrErrTxt("emptycart") . "</span><br/>\n");
exit;
}
if (!$objRegistre->stpi_setNbID($objCommandeSession->stpi_getNbRegistreID()))
{
exit;
}
$arrObjCommandeSousItem = array();
$arrObjCommandeSousItemSession = $objCommandeSession->stpi_getArrObjCommandeSousItemSession();
foreach ($arrObjCommandeSousItemSession as $objCommandeSousItemSession)
{
if ($_GET["nbSousItemID"] != $objCommandeSousItemSession->stpi_getNbSousItemID())
{
$objCommandeSousItemNew = new clscommandesousitem();
if (!$objCommandeSousItemNew->stpi_setNbPrix($objCommandeSousItemSession->stpi_getNbPrix()))
{
exit;
}
if (!$objCommandeSousItemNew->stpi_setNbQte($objCommandeSousItemSession->stpi_getNbQte()))
{
exit;
}
if (!$objCommandeSousItemNew->stpi_setNbSousItemID($objCommandeSousItemSession->stpi_getNbSousItemID()))
{
exit;
}
$arrObjCommandeSousItem[$objCommandeSousItemSession->stpi_getNbSousItemID()] = $objCommandeSousItemNew;
}
}
if (empty($arrObjCommandeSousItem))
{
unset($_SESSION["stpiObjCommandeRegistreSession"]);
print("redirect");
exit;
}
$objCommande->stpi_setArrObjCommandeSousItem($arrObjCommandeSousItem);
$arrObjCommandeSousItemSession = array();
foreach ($arrObjCommandeSousItem as $objCommandeSousItem)
{
$objCommandeSousItemSessionNew = new clscommandesousitemsession();
$objCommandeSousItemSessionNew->stpi_setNbPrix($objCommandeSousItem->stpi_getNbPrix());
$objCommandeSousItemSessionNew->stpi_setNbQte($objCommandeSousItem->stpi_getNbQte());
$objCommandeSousItemSessionNew->stpi_setNbSousItemID($objCommandeSousItem->stpi_getNbSousItemID());
$arrObjCommandeSousItemSession[$objCommandeSousItem->stpi_getNbSousItemID()] = $objCommandeSousItemSessionNew;
}
$objCommandeSession->stpi_setArrObjCommandeSousItemSession($arrObjCommandeSousItemSession);
$objCommandeSession->stpi_setNbSousTotal($objCommande->stpi_getNbSousTotalFromArrObjCommandeSousItem());
$objCommandeSession->stpi_setNbSousItemQte($objCommande->stpi_getNbQteFromArrObjCommandeSousItem());
$objCommandeSession->stpi_setNbPrixRabais($objCommande->stpi_getNbPrixRabaisFromArrObjCommandeSousItem());
if ($objCommandeSession->stpi_setObjCommandeRegistreSessionToSession())
{
print("redirect");
}
?>