@@ -22,14 +22,51 @@ class AddToCartRedirectForInsights
2222 */
2323 private $ requestInfoFilter ;
2424
25+ /**
26+ * @var StoreManagerInterface
27+ */
28+ protected $ storeManager ;
29+
30+ /**
31+ * @var ProductRepositoryInterface
32+ */
33+ protected $ productRepository ;
34+
35+ /**
36+ * @var Session
37+ */
38+ protected $ checkoutSession ;
39+
40+ /**
41+ * @var StockRegistryInterface
42+ */
43+ protected $ stockRegistry ;
44+
45+ /**
46+ * @var ManagerInterface
47+ */
48+ protected ManagerInterface $ eventManager ;
49+
50+ /**
51+ * @var ConfigHelper
52+ */
53+ protected ConfigHelper $ configHelper ;
54+
2555 public function __construct (
26- protected StoreManagerInterface $ storeManager ,
27- protected ProductRepositoryInterface $ productRepository ,
28- protected Session $ checkoutSession ,
29- protected StockRegistryInterface $ stockRegistry ,
30- protected ManagerInterface $ eventManager ,
31- protected ConfigHelper $ configHelper ,
32- ) {}
56+ StoreManagerInterface $ storeManager ,
57+ ProductRepositoryInterface $ productRepository ,
58+ Session $ checkoutSession ,
59+ StockRegistryInterface $ stockRegistry ,
60+ ManagerInterface $ eventManager ,
61+ ConfigHelper $ configHelper
62+ ) {
63+ $ this ->storeManager = $ storeManager ;
64+ $ this ->productRepository = $ productRepository ;
65+ $ this ->checkoutSession = $ checkoutSession ;
66+ $ this ->stockRegistry = $ stockRegistry ;
67+ $ this ->eventManager = $ eventManager ;
68+ $ this ->configHelper = $ configHelper ;
69+ }
3370
3471 /**
3572 * @param Cart $cartModel
@@ -41,7 +78,7 @@ public function __construct(
4178 * @throws LocalizedException
4279 * @throws NoSuchEntityException
4380 */
44- public function beforeAddProduct (Cart $ cartModel , int | Product $ productInfo , array | int | DataObject $ requestInfo = null )
81+ public function beforeAddProduct (Cart $ cartModel , $ productInfo , $ requestInfo = null )
4582 {
4683 // First, check is Insights are enabled
4784 if (!$ this ->configHelper ->isClickConversionAnalyticsEnabled ($ this ->storeManager ->getStore ()->getId ())) {
0 commit comments