Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TMP-2023-24-048
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maneesha Fernando
TMP-2023-24-048
Commits
3e86014d
Commit
3e86014d
authored
Oct 31, 2023
by
Maneesha Fernando
Committed by
GitHub
Oct 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete update-cart.php
parent
9930ea52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
45 deletions
+0
-45
update-cart.php
update-cart.php
+0
-45
No files found.
update-cart.php
deleted
100644 → 0
View file @
9930ea52
<?php
//if (session_status() !== PHP_SESSION_ACTIVE) {session_start();}
if
(
session_id
()
==
''
||
!
isset
(
$_SESSION
)){
session_start
();}
include
'config.php'
;
$product_id
=
$_GET
[
'id'
];
$action
=
$_GET
[
'action'
];
if
(
$action
===
'empty'
)
unset
(
$_SESSION
[
'cart'
]);
$result
=
$mysqli
->
query
(
"SELECT qty FROM products WHERE id = "
.
$product_id
);
if
(
$result
){
if
(
$obj
=
$result
->
fetch_object
())
{
switch
(
$action
)
{
case
"add"
:
if
(
$_SESSION
[
'cart'
][
$product_id
]
+
1
<=
$obj
->
qty
)
$_SESSION
[
'cart'
][
$product_id
]
++
;
break
;
case
"remove"
:
$_SESSION
[
'cart'
][
$product_id
]
--
;
if
(
$_SESSION
[
'cart'
][
$product_id
]
==
0
)
unset
(
$_SESSION
[
'cart'
][
$product_id
]);
break
;
}
}
}
header
(
"location:cart.php"
);
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment