Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit c0664ec

Browse files
committed
Added notes and tooltip to import behavior field in import form
1 parent 365e400 commit c0664ec

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ protected function _prepareForm()
113113
'class' => $behaviorCode,
114114
'onchange' => 'varienImport.handleImportBehaviorSelector();',
115115
'note' => ' ',
116+
'after_element_html' => $this->getImportBehaviorTooltip(),
116117
]
117118
);
118119
$fieldsets[$behaviorCode]->addField(
@@ -252,4 +253,19 @@ protected function getDownloadSampleFileHtml()
252253
. '</a></span>';
253254
return $html;
254255
}
256+
257+
/**
258+
* Get Import Behavior field tooltip
259+
*
260+
* @return string
261+
*/
262+
protected function getImportBehaviorTooltip()
263+
{
264+
$html = '<div class="admin__field-tooltip tooltip">
265+
<a class="admin__field-tooltip-action action-help" target="_blank" title="What is this?"
266+
href="https://docs.magento.com/m2/ce/user_guide/system/data-import.html"><span>'
267+
. __('What is this?')
268+
. '</span></a></div>';
269+
return $html;
270+
}
255271
}

app/code/Magento/ImportExport/Model/Source/Import/Behavior/Basic.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ public function getCode()
3939
public function getNotes($entityCode)
4040
{
4141
$messages = ['catalog_product' => [
42-
\Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE => __("Note: Product IDs will be regenerated.")
42+
\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."),
43+
\Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE => __("The existing product data is replaced with new data. <b>Exercise caution when replacing data because the existing product data will be completely cleared and all references in the system will be lost.</b>"),
44+
\Magento\ImportExport\Model\Import::BEHAVIOR_DELETE => __("Any entities in the import data that already exist in the database are deleted from the database."),
4345
]];
4446
return isset($messages[$entityCode]) ? $messages[$entityCode] : [];
4547
}

app/code/Magento/ImportExport/i18n/en_US.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,6 @@ User,User
119119
"Error File","Error File"
120120
"Execution Time","Execution Time"
121121
Summary,Summary
122+
"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."
123+
"The existing product data is replaced with new data. <b>Exercise caution when replacing data because the existing product data will be completely cleared and all references in the system will be lost.</b>","<b>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.</b>"
124+
"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."

0 commit comments

Comments
 (0)