File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
app/code/Magento/Bundle/Model/ResourceModel Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -92,29 +92,29 @@ protected function _afterSave(AbstractModel $object)
9292 {
9393 parent ::_afterSave ($ object );
9494
95- $ condition = [
96- 'option_id = ? ' => $ object ->getId (),
97- 'store_id = ? OR store_id = 0 ' => $ object ->getStoreId (),
98- 'parent_product_id = ? ' => $ object ->getParentId ()
99- ];
100-
10195 $ connection = $ this ->getConnection ();
102- $ connection ->delete ($ this ->getTable ('catalog_product_bundle_option_value ' ), $ condition );
103-
10496 $ data = new DataObject ();
10597 $ data ->setOptionId ($ object ->getId ())
10698 ->setStoreId ($ object ->getStoreId ())
10799 ->setParentProductId ($ object ->getParentId ())
108100 ->setTitle ($ object ->getTitle ());
109101
110- $ connection ->insert ($ this ->getTable ('catalog_product_bundle_option_value ' ), $ data ->getData ());
102+ $ connection ->insertOnDuplicate (
103+ $ this ->getTable ('catalog_product_bundle_option_value ' ),
104+ $ data ->getData (),
105+ ['title ' ]
106+ );
111107
112108 /**
113109 * also saving default fallback value
114110 */
115111 if (0 !== (int )$ object ->getStoreId ()) {
116112 $ data ->setStoreId (0 )->setTitle ($ object ->getDefaultTitle ());
117- $ connection ->insert ($ this ->getTable ('catalog_product_bundle_option_value ' ), $ data ->getData ());
113+ $ connection ->insertOnDuplicate (
114+ $ this ->getTable ('catalog_product_bundle_option_value ' ),
115+ $ data ->getData (),
116+ ['title ' ]
117+ );
118118 }
119119
120120 return $ this ;
You can’t perform that action at this time.
0 commit comments