File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
app/code/Magento/Catalog/Model Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -883,8 +883,8 @@ public function beforeSave()
883883
884884 $ this ->getTypeInstance ()->beforeSave ($ this );
885885
886- $ hasOptions = $ this ->getData ('has_options ' ) === "1 " ;
887- $ hasRequiredOptions = $ this ->getData ('required_options ' ) === "1 " ;
886+ $ hasOptions = $ this ->getData ('has_options ' ) === "1 " && $ this -> isProductHasOptions () ;
887+ $ hasRequiredOptions = $ this ->getData ('required_options ' ) === "1 " && $ this -> isProductHasOptions () ;
888888
889889 /**
890890 * $this->_canAffectOptions - set by type instance only
@@ -934,6 +934,21 @@ public function beforeSave()
934934 parent ::beforeSave ();
935935 }
936936
937+ /**
938+ * Check based on options data
939+ *
940+ * @return bool
941+ */
942+ private function isProductHasOptions () : bool
943+ {
944+ if ($ this ->getData ('options ' ) === null ) {
945+ $ result = true ;
946+ } else {
947+ $ result = is_array ($ this ->getData ('options ' )) && count ($ this ->getData ('options ' )) > 0 ;
948+ }
949+ return $ result ;
950+ }
951+
937952 /**
938953 * Check/set if options can be affected when saving product
939954 *
You can’t perform that action at this time.
0 commit comments