Get Session Cart and User Logged
-
Hello, I have a Laravel project and a WordPress project into laravel ‘public’ folder.
https://www.mysite.it/ (Laravel)
https://www.mysite.it/wp/ (WordPress)I have this Laravel function
class ProductController extends Controller { public function index(Request $request) { $curl = curl_init(); curl_setopt_array( $curl, array( CURLOPT_URL => "https://site.test/wp/wp-json/cocart/v2/cart/items", CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => array( 'Accept: application/json', 'User-Agent: CoCart API/v2', ) ) ); $response = curl_exec($curl); curl_close($curl); echo $response; } }
But results is always “No items in the cart.”
I think that Laravel cannot read WordPress Sessions.
There is a way?
thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get Session Cart and User Logged’ is closed to new replies.