Skip to content
Permalink
Browse files

Fix for API cart delete with GET method

  • Loading branch information...
abantecart committed Mar 10, 2016
1 parent 7d85a51 commit ed807585c60b64ca08c4dc560c568f68486ab2fe
Showing with 14 additions and 5 deletions.
  1. +14 −5 public_html/storefront/controller/api/checkout/cart.php
@@ -55,9 +55,11 @@ public function post() {
}
//request to remove
if (isset($request['remove'])) {
if (isset($request['remove']) && is_array($request['remove']) ) {
foreach (array_keys($request['remove']) as $key) {
$this->cart->remove($key);
if($key) {
$this->cart->remove($key);
}
}
}
@@ -128,13 +130,20 @@ public function post() {
public function delete() {
$request = $this->rest->getRequestParams();
if (isset($request['remove'])) {
$count = 0;
if (isset($request['remove']) && is_array($request['remove'])) {
foreach (array_keys($request['remove']) as $key) {
$this->cart->remove($key);
if($key) {
$this->cart->remove($key);
$count++;
}
}
}
}
$this->rest->setResponseData( array('success' => "$count removed" ) );
$this->rest->sendResponse(200);
return null;
}
public function put() {

0 comments on commit ed80758

Please sign in to comment.
You can’t perform that action at this time.