@@ -62,7 +62,10 @@ public function __construct(
6262 */
6363 protected $ config = [])
6464 {
65- $ this ->setSessionKey (sprintf ('%s.conditions.%s ' , array_get ($ this ->config , 'cartInstance ' , 'default ' ), $ this ->name ));
65+ $ this ->setSessionKey (sprintf ('cart-conditions.%s.%s ' ,
66+ array_get ($ this ->config , 'cartInstance ' , 'default ' ),
67+ array_get ($ this ->config , 'name ' , $ this ->name ),
68+ ));
6669 $ this ->fillFromConfig ($ this ->config );
6770 }
6871
@@ -72,6 +75,7 @@ public function fillFromConfig($config): void
7275 $ this ->name = array_get ($ config , 'name ' , $ this ->name );
7376 $ this ->priority = array_get ($ config , 'priority ' , $ this ->priority );
7477 $ this ->removeable = array_get ($ config , 'removeable ' , $ this ->removeable );
78+ $ this ->sessionKey = array_get ($ config , 'sessionKey ' , $ this ->sessionKey );
7579
7680 if ($ metaData = array_get ($ config , 'metaData ' )) {
7781 Session::put ($ this ->getSessionKey (), $ metaData );
@@ -287,6 +291,8 @@ public function toArray()
287291 'label ' => $ this ->label ,
288292 'priority ' => $ this ->priority ,
289293 'removeable ' => $ this ->removeable ,
294+ 'sessionKey ' => $ this ->sessionKey ,
295+ 'config ' => $ this ->config ,
290296 'metaData ' => Session::get ($ this ->getSessionKey (), []),
291297 ];
292298 }
0 commit comments