From c0664ecc603ba73e2efa4c2da5cc85deb52c3767 Mon Sep 17 00:00:00 2001 From: Federico Rivollier Date: Thu, 22 Nov 2018 18:38:25 -0300 Subject: [PATCH 1/5] Added notes and tooltip to import behavior field in import form --- .../Block/Adminhtml/Import/Edit/Form.php | 16 ++++++++++++++++ .../Model/Source/Import/Behavior/Basic.php | 4 +++- app/code/Magento/ImportExport/i18n/en_US.csv | 3 +++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php index 8fd73e46608..8f0d41abdc0 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php @@ -113,6 +113,7 @@ protected function _prepareForm() 'class' => $behaviorCode, 'onchange' => 'varienImport.handleImportBehaviorSelector();', 'note' => ' ', + 'after_element_html' => $this->getImportBehaviorTooltip(), ] ); $fieldsets[$behaviorCode]->addField( @@ -252,4 +253,19 @@ protected function getDownloadSampleFileHtml() . ''; return $html; } + + /** + * Get Import Behavior field tooltip + * + * @return string + */ + protected function getImportBehaviorTooltip() + { + $html = '
+ ' + . __('What is this?') + . '
'; + return $html; + } } diff --git a/app/code/Magento/ImportExport/Model/Source/Import/Behavior/Basic.php b/app/code/Magento/ImportExport/Model/Source/Import/Behavior/Basic.php index f28aae9f8ae..7f90e052acc 100644 --- a/app/code/Magento/ImportExport/Model/Source/Import/Behavior/Basic.php +++ b/app/code/Magento/ImportExport/Model/Source/Import/Behavior/Basic.php @@ -39,7 +39,9 @@ public function getCode() public function getNotes($entityCode) { $messages = ['catalog_product' => [ - \Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE => __("Note: Product IDs will be regenerated.") + \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND => __("New product data is added to the existing product data for the existing entries in the database. All fields except sku can be updated."), + \Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE => __("The existing product data is replaced with new data. Exercise caution when replacing data because the existing product data will be completely cleared and all references in the system will be lost."), + \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE => __("Any entities in the import data that already exist in the database are deleted from the database."), ]]; return isset($messages[$entityCode]) ? $messages[$entityCode] : []; } diff --git a/app/code/Magento/ImportExport/i18n/en_US.csv b/app/code/Magento/ImportExport/i18n/en_US.csv index 60c9ee4c5a9..3d7309da9a4 100644 --- a/app/code/Magento/ImportExport/i18n/en_US.csv +++ b/app/code/Magento/ImportExport/i18n/en_US.csv @@ -119,3 +119,6 @@ User,User "Error File","Error File" "Execution Time","Execution Time" Summary,Summary +"New product data is added to the existing product data for the existing entries in the database. All fields except sku can be updated.","New product data is added to the existing product data for the existing entries in the database. All fields except sku can be updated." +"The existing product data is replaced with new data. Exercise caution when replacing data because the existing product data will be completely cleared and all references in the system will be lost.","The existing product data is replaced with new data. Exercise caution when replacing data because the existing product data will be completely cleared and all references in the system will be lost." +"Any entities in the import data that already exist in the database are deleted from the database.","Any entities in the import data that already exist in the database are deleted from the database." From 9f5b771a14d260d3fd9eb7daf69feb580f7f7d31 Mon Sep 17 00:00:00 2001 From: Federico Rivollier Date: Thu, 22 Nov 2018 18:38:25 -0300 Subject: [PATCH 2/5] Added notes and tooltip to import behavior field in import form --- .../Block/Adminhtml/Import/Edit/Form.php | 16 ++++++++++++++++ .../Model/Source/Import/Behavior/Basic.php | 4 +++- app/code/Magento/ImportExport/i18n/en_US.csv | 3 +++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php index 8fd73e46608..8f0d41abdc0 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php @@ -113,6 +113,7 @@ protected function _prepareForm() 'class' => $behaviorCode, 'onchange' => 'varienImport.handleImportBehaviorSelector();', 'note' => ' ', + 'after_element_html' => $this->getImportBehaviorTooltip(), ] ); $fieldsets[$behaviorCode]->addField( @@ -252,4 +253,19 @@ protected function getDownloadSampleFileHtml() . ''; return $html; } + + /** + * Get Import Behavior field tooltip + * + * @return string + */ + protected function getImportBehaviorTooltip() + { + $html = ''; + return $html; + } } diff --git a/app/code/Magento/ImportExport/Model/Source/Import/Behavior/Basic.php b/app/code/Magento/ImportExport/Model/Source/Import/Behavior/Basic.php index f28aae9f8ae..7f90e052acc 100644 --- a/app/code/Magento/ImportExport/Model/Source/Import/Behavior/Basic.php +++ b/app/code/Magento/ImportExport/Model/Source/Import/Behavior/Basic.php @@ -39,7 +39,9 @@ public function getCode() public function getNotes($entityCode) { $messages = ['catalog_product' => [ - \Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE => __("Note: Product IDs will be regenerated.") + \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND => __("New product data is added to the existing product data for the existing entries in the database. All fields except sku can be updated."), + \Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE => __("The existing product data is replaced with new data. Exercise caution when replacing data because the existing product data will be completely cleared and all references in the system will be lost."), + \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE => __("Any entities in the import data that already exist in the database are deleted from the database."), ]]; return isset($messages[$entityCode]) ? $messages[$entityCode] : []; } diff --git a/app/code/Magento/ImportExport/i18n/en_US.csv b/app/code/Magento/ImportExport/i18n/en_US.csv index 60c9ee4c5a9..7de8365ff7a 100644 --- a/app/code/Magento/ImportExport/i18n/en_US.csv +++ b/app/code/Magento/ImportExport/i18n/en_US.csv @@ -119,3 +119,6 @@ User,User "Error File","Error File" "Execution Time","Execution Time" Summary,Summary +"New product data is added to the existing product data for the existing entries in the database. All fields except sku can be updated.","New product data is added to the existing product data for the existing entries in the database. All fields except sku can be updated." +"The existing product data is replaced with new data. Exercise caution when replacing data because the existing product data will be completely cleared and all references in the system will be lost.","The existing product data is replaced with new data. Exercise caution when replacing data because the existing product data will be completely cleared and all references in the system will be lost." +"Any entities in the import data that already exist in the database are deleted from the database.","Any entities in the import data that already exist in the database are deleted from the database." From 16f3763f0eaa28f7858dada13e83e155184bb04e Mon Sep 17 00:00:00 2001 From: Lori Krell Date: Mon, 26 Nov 2018 12:18:10 -0300 Subject: [PATCH 3/5] Update app/code/Magento/ImportExport/i18n/en_US.csv Co-Authored-By: federivo --- app/code/Magento/ImportExport/i18n/en_US.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/ImportExport/i18n/en_US.csv b/app/code/Magento/ImportExport/i18n/en_US.csv index 7de8365ff7a..6c92d22d222 100644 --- a/app/code/Magento/ImportExport/i18n/en_US.csv +++ b/app/code/Magento/ImportExport/i18n/en_US.csv @@ -119,6 +119,6 @@ User,User "Error File","Error File" "Execution Time","Execution Time" Summary,Summary -"New product data is added to the existing product data for the existing entries in the database. All fields except sku can be updated.","New product data is added to the existing product data for the existing entries in the database. All fields except sku can be updated." +"New product data is added to existing product data entries in the database. All fields except SKU can be updated.","New product data is added to existing product data entries in the database. All fields except SKU can be updated." "The existing product data is replaced with new data. Exercise caution when replacing data because the existing product data will be completely cleared and all references in the system will be lost.","The existing product data is replaced with new data. Exercise caution when replacing data because the existing product data will be completely cleared and all references in the system will be lost." "Any entities in the import data that already exist in the database are deleted from the database.","Any entities in the import data that already exist in the database are deleted from the database." From daf78672c11f0b567fd338cd1bd988c251e23824 Mon Sep 17 00:00:00 2001 From: Lori Krell Date: Mon, 26 Nov 2018 12:18:41 -0300 Subject: [PATCH 4/5] Update app/code/Magento/ImportExport/i18n/en_US.csv Co-Authored-By: federivo --- app/code/Magento/ImportExport/i18n/en_US.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/ImportExport/i18n/en_US.csv b/app/code/Magento/ImportExport/i18n/en_US.csv index 6c92d22d222..b950093ee17 100644 --- a/app/code/Magento/ImportExport/i18n/en_US.csv +++ b/app/code/Magento/ImportExport/i18n/en_US.csv @@ -120,5 +120,5 @@ User,User "Execution Time","Execution Time" Summary,Summary "New product data is added to existing product data entries in the database. All fields except SKU can be updated.","New product data is added to existing product data entries in the database. All fields except SKU can be updated." -"The existing product data is replaced with new data. Exercise caution when replacing data because the existing product data will be completely cleared and all references in the system will be lost.","The existing product data is replaced with new data. Exercise caution when replacing data because the existing product data will be completely cleared and all references in the system will be lost." +"All existing product data is replaced with the imported new data. Exercise caution when replacing data. All existing product data will be completely cleared and all references in the system will be lost.","All existing product data is replaced with the imported new data. Exercise caution when replacing data. All existing product data will be completely cleared and all references in the system will be lost." "Any entities in the import data that already exist in the database are deleted from the database.","Any entities in the import data that already exist in the database are deleted from the database." From e877e9a20f07d595d3912cc962c5e87ddeb50e01 Mon Sep 17 00:00:00 2001 From: Lori Krell Date: Mon, 26 Nov 2018 12:18:59 -0300 Subject: [PATCH 5/5] Update app/code/Magento/ImportExport/i18n/en_US.csv Co-Authored-By: federivo --- app/code/Magento/ImportExport/i18n/en_US.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/ImportExport/i18n/en_US.csv b/app/code/Magento/ImportExport/i18n/en_US.csv index b950093ee17..cae4d6e1986 100644 --- a/app/code/Magento/ImportExport/i18n/en_US.csv +++ b/app/code/Magento/ImportExport/i18n/en_US.csv @@ -121,4 +121,4 @@ User,User Summary,Summary "New product data is added to existing product data entries in the database. All fields except SKU can be updated.","New product data is added to existing product data entries in the database. All fields except SKU can be updated." "All existing product data is replaced with the imported new data. Exercise caution when replacing data. All existing product data will be completely cleared and all references in the system will be lost.","All existing product data is replaced with the imported new data. Exercise caution when replacing data. All existing product data will be completely cleared and all references in the system will be lost." -"Any entities in the import data that already exist in the database are deleted from the database.","Any entities in the import data that already exist in the database are deleted from the database." +"Any entities in the import data that match existing entities in the database are deleted from the database.","Any entities in the import data that match existing entities in the database are deleted from the database."