Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 14351: Product import doesn't change Enable Qty Increments field #14352

Conversation

simpleadm
Copy link
Contributor

@simpleadm simpleadm commented Mar 24, 2018

Product import doesn't change Enable Qty Increments field

Description

\Magento\CatalogImportExport\Model\Import\Product::_setStockUseConfigFieldsValues method rely on Use Config Settings property name will be with use_config_ prefix, but for enable_qty_increments filed it is named as use_config_enable_qty_inc.

Fixed Issues (if relevant)

  1. Product import doesn't change Enable Qty Increments field #14351: Product import doesn't change Enable Qty Increments field

Steps to reproduce

  1. Create simple product with 'Test Simple' SKU
  2. Fill Quantity, Stock Status and required fields
  3. Make sure that Enable Qty Increments ('Advanced Inventory') marked as Use Config Settings
  4. Go to System > Data transfer: Import > Import products
  5. Select Import Behavior: Add/Update
  6. Use attached csv file

Example files

"sku","qty","manage_stock","enable_qty_increments","qty_increments"
"Test Simple",88,"Use Config",1,2

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@@ -2636,7 +2636,10 @@ private function _setStockUseConfigFieldsValues($rowData)
{
$useConfigFields = [];
foreach ($rowData as $key => $value) {
$useConfigName = self::INVENTORY_USE_CONFIG_PREFIX . $key;
$useConfigName = $key === 'enable_qty_increments'
? 'use_config_enable_qty_inc'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest using the static definition instead of the hardcoded 'enable_qty_increments' value.

Magento\CatalogInventory\Api\Data\StockItemInterface::ENABLE_QTY_INCREMENTS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for suggestion, it makes sense.
I thought about it, but ignored in favor of consistency, e.g. \Magento\CatalogImportExport\Model\Import\Product::$defaultStockData doesn't use constants etc.

Any way, suggested changes were implemented.

@mzeis mzeis removed their assignment Apr 29, 2018
@rogyar rogyar self-assigned this Apr 29, 2018
@rogyar
Copy link
Contributor

rogyar commented May 2, 2018

Hi @simpleadm. There's a merge conflict in one of the files. Please, merge the updated 2.3-develop branch into your branch, resolve conflicts and push once again. Thank you

@simpleadm
Copy link
Contributor Author

Hi @rogyar ,
Conflicts were resolved.

@magento-engcom-team magento-engcom-team added this to the May 2018 milestone May 10, 2018
@magento-engcom-team magento-engcom-team added partners-contribution Pull Request is created by Magento Partner Partner: Convert labels May 10, 2018
@okorshenko okorshenko removed this from the May 2018 milestone May 31, 2018
@simpleadm
Copy link
Contributor Author

@magento-engcom-team any updates?

@magento-engcom-team
Copy link
Contributor

Hi @simpleadm. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.3.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants