Issue
$carts= Cart::leftjoin('products', 'products.id', '=', 'carts.productid')
->leftjoin('sellers', 'sellers.id', '=', 'products.seller')
->select('products.*','carts.productid as productid','carts.userid as userid','carts.quantity as cartquantity','carts.subtotal as subtotal','carts.id as cartid','sellers.id as sellerid')->where('carts.userid',$_SESSION['salmonlightsuserid'])->get();
$data1 = array('carts'=>"$carts",'subtotal'=>"$subtotal",'totalquantity'=>"$totalquantity",'primaryaddress'=>"$primaryaddress");
$useremail=$_SESSION['salmonlightsuseremail'];
Mail::send('order-email-template',$data1, function($message) use($useremail){
$message->to($useremail)->subject
('Order');
$message->from('noreply@gamil.com');
});
It gives error in order-email-template.blade.php Error is:- Invalid argument supplied for foreach() @foreach($carts as $cartsnew)
Solution
You don't need double quotes.
Must be 'carts' => $carts
.
Answered By - Nikita Ivanov
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.