Answer the question
In order to leave comments, you need to log in
How to check item in session?
There is a product "Box", it may include a different composition and in a different sequence.
It is necessary to recalculate the basket when adding to the basket (session).
If the composition and sequence match, then add the quantity, and if not, then create a new element.
Please tell me how to properly structure the session so that it is more convenient to check.
Answer the question
In order to leave comments, you need to log in
Store boxes as arrays and then compare:
if ($a === $b){
// коробки идентичны
}
$session = Yii::$app->session;
$in = $seession->get('some_id');
if($in == $new){
echo 'товары одинаковые';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question