Click here to Skip to main content
15,868,006 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
function getcartdata($acctoken)
{
	$url = "https://api.us-central1.gcp.commercetools.com/demo-commerce/carts/8d9e4d12-2a5f-4bd4-a4af-97d2bd9b320c";
	$requestmethod = "GET";
	$cartdata = getRequest($url, $requestmethod,$acctoken);
	
	return $cartdata;
}
$cartresult = getcartdata($access_token); 
 $dcart = json_decode($cartresult);  
echo $limit = count($dcart['lineItems']);

Error is Call to undefined function getRequest()
and getting the value in $access_token. The api working fine in postman

What I have tried:

Tried changing the variable sin value but still not working
Posted
Comments
Peter_in_2780 11-Oct-21 2:32am    
The error message is clear. You haven't defined (or included something that defines) a function called getRequest().
Where do think it comes from?
morrisschriss 12-Oct-21 7:37am    
You haven't defined a function called getRequest(). Define getRequest() then try again.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900