Last active
October 24, 2022 09:49
-
-
Save ichaykin/b588e1d3a2eb5a9aa4f24136abe7f781 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/commerceml/controllers/frontend/commerceml.php b/app/addons/commerceml/controllers/frontend/commerceml.php | |
index 564d2f4f25..89febb4e8d 100644 | |
--- a/app/addons/commerceml/controllers/frontend/commerceml.php | |
+++ b/app/addons/commerceml/controllers/frontend/commerceml.php | |
@@ -36,6 +36,8 @@ if (empty($_SERVER['PHP_AUTH_USER'])) { | |
exit; | |
} | |
+fn_define('COMMERCEML_IMPORT', true); | |
+ | |
/** @var \Tygh\Web\Session $session */ | |
$session = Tygh::$app['session']; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/commerceml/src/Bootstrap.php b/app/addons/commerceml/src/Bootstrap.php | |
index 1a21ad7f8e..50abf9b82f 100644 | |
--- a/app/addons/commerceml/src/Bootstrap.php | |
+++ b/app/addons/commerceml/src/Bootstrap.php | |
@@ -127,7 +127,14 @@ class Bootstrap implements BootstrapInterface, HookHandlerProviderInterface | |
'onGetFeedbackData' | |
], | |
/** @see \Tygh\Addons\CommerceML\HookHandlers\ProductHookHandler::onUpdateProductFeaturesValuePre() */ | |
- 'update_product_features_value_pre' => [ProductHookHandler::class, 'onUpdateProductFeaturesValuePre'] | |
+ 'update_product_features_value_pre' => [ProductHookHandler::class, 'onUpdateProductFeaturesValuePre'], | |
+ 'update_product_prices' => static function ($product_id, &$_product_data, $company_id, &$skip_price_delete) { | |
+ // phpcs:disable SlevomatCodingStandard.ControlStructures.EarlyExit | |
+ if (defined('COMMERCEML_IMPORT')) { | |
+ $skip_price_delete = true; | |
+ $_product_data['create'] = true; | |
+ } | |
+ } | |
]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/commerceml/src/Importers/ProductImporter.php b/app/addons/commerceml/src/Importers/ProductImporter.php | |
index f5e47996a3..fcef5a3868 100644 | |
--- a/app/addons/commerceml/src/Importers/ProductImporter.php | |
+++ b/app/addons/commerceml/src/Importers/ProductImporter.php | |
@@ -510,10 +510,6 @@ class ProductImporter | |
} | |
} | |
- if (!isset($product_data['price'])) { | |
- $product_data['price'] = 0; | |
- } | |
- | |
return $product_data; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment