@@ -76,6 +76,8 @@ class Product
7676 */
7777 protected bool $ handleStockInVariants = false ;
7878
79+ protected array $ detailViewParameter = [];
80+
7981 public function __construct (
8082 string $ productType ,
8183 int $ productId ,
@@ -85,7 +87,8 @@ public function __construct(
8587 TaxClass $ taxClass ,
8688 int $ quantity ,
8789 bool $ isNetPrice = false ,
88- FeVariant $ feVariant = null
90+ FeVariant $ feVariant = null ,
91+ array $ detailViewParameter = []
8992 ) {
9093 $ this ->productType = $ productType ;
9194 $ this ->productId = $ productId ;
@@ -95,6 +98,7 @@ public function __construct(
9598 $ this ->taxClass = $ taxClass ;
9699 $ this ->quantity = $ quantity ;
97100 $ this ->isNetPrice = $ isNetPrice ;
101+ $ this ->detailViewParameter = $ detailViewParameter ;
98102
99103 if ($ feVariant ) {
100104 $ this ->feVariant = $ feVariant ;
@@ -729,4 +733,19 @@ public function setHandleStockInVariants(bool $handleStockInVariants): void
729733 {
730734 $ this ->handleStockInVariants = $ handleStockInVariants ;
731735 }
736+
737+ public function getDetailViewParameter (): array
738+ {
739+ return $ this ->detailViewParameter ;
740+ }
741+
742+ public function setDetailViewParameter (array $ detailViewParameter ): void
743+ {
744+ $ this ->detailViewParameter = $ detailViewParameter ;
745+ }
746+
747+ public function addDetailViewParameter (string $ key , int |string $ value ): void
748+ {
749+ $ this ->detailViewParameter [$ key ] = $ value ;
750+ }
732751}
0 commit comments