Fix update et showbasket on multiple coupons
This commit is contained in:
parent
272a4fd276
commit
97fa456a0a
1 changed files with 11 additions and 3 deletions
|
|
@ -328,6 +328,13 @@ class PanierController extends Controller
|
|||
}
|
||||
if(isset($request->refsite) && $request->refsite != ""){
|
||||
$refsite = $request->refsite;
|
||||
if($refsite != $campagne->camp_siteId){
|
||||
return Response::json([
|
||||
'Statut' => 'KO',
|
||||
'Code' => 103,
|
||||
'Message' => 'La campagne ne correspond à aucune campagnes du site'
|
||||
]);
|
||||
}
|
||||
}else{
|
||||
$error = true;
|
||||
}
|
||||
|
|
@ -540,8 +547,9 @@ class PanierController extends Controller
|
|||
$response->Commune = $contact->contact_ville;
|
||||
|
||||
$allPanierContent = $panier->panierContents()->get();
|
||||
$panCont = [];
|
||||
foreach($allPanierContent as $panierContent){
|
||||
$panCont = [];
|
||||
|
||||
$coupon = Coupon::where(['coupon_id' => $panierContent->panier_content_couponId])->first();
|
||||
if($coupon){
|
||||
array_push($panCont, $coupon->coupon_code." - ".$coupon->coupon_name." (x".$panierContent->panier_content_quantity.")");
|
||||
|
|
@ -638,9 +646,9 @@ class PanierController extends Controller
|
|||
$response->Email = $contact->contact_email;
|
||||
$response->CodePostal = $contact->contact_cp;
|
||||
$response->Commune = $contact->contact_ville;
|
||||
|
||||
$panCont = [];
|
||||
foreach($allPanierContent as $panierContent){
|
||||
$panCont = [];
|
||||
|
||||
$coupon = Coupon::where(['coupon_id' => $panierContent->panier_content_couponId])->first();
|
||||
if($coupon){
|
||||
array_push($panCont, $coupon->coupon_code." - ".$coupon->coupon_name." (x".$panierContent->panier_content_quantity.")");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue