File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,36 @@ public function __construct(
106106 */
107107 public function getEcommPageType (): string
108108 {
109+ if ('other ' === $ this ->ecommPageType ) {
110+ $ fullActionName = $ this ->request ->getFullActionName ();
111+ switch ($ fullActionName ) {
112+ case 'cms_index_index ' :
113+ $ this ->ecommPageType = 'home ' ;
114+ break ;
115+ case 'catalog_category_view ' :
116+ $ this ->ecommPageType = 'category ' ;
117+ break ;
118+ case 'catalog_product_view ' :
119+ $ this ->ecommPageType = 'product ' ;
120+ break ;
121+ case 'checkout_cart_index ' :
122+ $ this ->ecommPageType = 'cart ' ;
123+ break ;
124+ case 'checkout_index_index ' :
125+ $ this ->ecommPageType = 'checkout ' ;
126+ break ;
127+ case 'contact_index_index ' :
128+ $ this ->ecommPageType = 'contact ' ;
129+ break ;
130+ case 'catalogsearch_result_index ' :
131+ $ this ->ecommPageType = 'searchresults ' ;
132+ break ;
133+ case 'cms_page_view ' :
134+ $ this ->ecommPageType = 'cmspage ' ;
135+ break ;
136+ }
137+ }
138+
109139 return $ this ->ecommPageType ;
110140 }
111141
Original file line number Diff line number Diff line change 1818
1919class BeginCheckout extends AbstractDataLayer implements BeginCheckoutInterface
2020{
21+ /**
22+ * @var string
23+ */
24+ protected $ ecommPageType = 'checkout ' ;
25+
2126 /**
2227 * @var ItemInterface
2328 */
Original file line number Diff line number Diff line change 1818
1919class ViewItem extends AbstractDataLayer implements ViewItemInterface
2020{
21+ /**
22+ * @var string
23+ */
24+ protected $ ecommPageType = 'product ' ;
25+
2126 /**
2227 * @var ItemInterface
2328 */
You can’t perform that action at this time.
0 commit comments