Magento2: Tier prices data should be array, but actually other type is received

Created on 14 Mar 2019  路  11Comments  路  Source: magento/magento2

Preconditions (*)


1.2.2.6
2.

Steps to reproduce (*)


1.After importing advanced pricing, cannot save any changes to the products on the backend. Error message reads, "Tier prices data should be array, but actually other type is received" Using the following columns.
2.sku,tier_price_website,tier_price_customer_group,tier_price_qty,tier_price,tier_price_value_type

Expected result (*)

  1. Should be able to save changes on the item on the backend. Only way to make changes is to import the updates.
    2.

Actual result (*)

  1. Error message is "Tier prices data should be array, but actually other type is received"
  2. No changes are saved
Format is valid

Most helpful comment

After debugging
vendor/magento/module-eav/Model/ResourceModel/ReadHandler.php
we found that tier_price value is getting from "catalog_product_entity_decimal" table. as key value format. Which is not correct, magento2 has other table for tier price. It should come in Array.

In our case data was migrated from magento1 to magento2.

Solution:

To check tier_price attribute_id from "eav_attribute" table, search
"SELECT * FROMeav_attributeWHERE attribute_code="tier_price"
which is 91.

And then search entry for 91 attribute_id value from catalog_product_entity_decimal

SELECT * FROM catalog_product_entity_decimal WHERE attribute_id=91

And then delete entry from table.

Its work for me.

All 11 comments

Hi @thsdoug. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@thsdoug do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

Hello, I was able to replicate the cause of issue. It happened because I accidentally chose "Products" for Entity Type instead of using "Advanced Pricing" when importing. I also found a workaround to saving changes on the backend by reimporting the product and using "Replace" on the Import Behavior. The problem is that it creates a new Entity ID, which I'm trying to avoid. Is there another way to resolve the issue without using Replace?

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • _Next steps are available in case you are a member of Community Maintainers._

  • [ ] 6. Add label Issue: Confirmed once verification is complete.

  • [ ] 7. Make sure that automatic system confirms that report has been added to the backlog.

Hi @thsdoug thank you for you report, i'm closing this as this is non-issue.

Hi @thsdoug thank you for you report, i'm closing this as this is non-issue.

Hi @engcom-backlog-nazar, why did you close this? I'm still having an issue on how to resolve it without having to use the Replace on the Import Behavior.

After debugging
vendor/magento/module-eav/Model/ResourceModel/ReadHandler.php
we found that tier_price value is getting from "catalog_product_entity_decimal" table. as key value format. Which is not correct, magento2 has other table for tier price. It should come in Array.

In our case data was migrated from magento1 to magento2.

Solution:

To check tier_price attribute_id from "eav_attribute" table, search
"SELECT * FROMeav_attributeWHERE attribute_code="tier_price"
which is 91.

And then search entry for 91 attribute_id value from catalog_product_entity_decimal

SELECT * FROM catalog_product_entity_decimal WHERE attribute_id=91

And then delete entry from table.

Its work for me.

Thank you for helping me find a fix, @khasru. I will give it a shot.

Thank you @khasru for a fix. Just encountered same problem on a Magento 2.3.3 after trying to use the admin to BULK update Action on products Advanced Prices. The Tier Prices did not stick and locked products so they could not be updated. Deleting those entries allowed them to function again. (I also had imported data from 1.9 to M2).
Cheers.

what about magento 2.3.3 , its not working

what about magento 2.3.3 , its not working

Thank you @khasru for a fix. It's working in 2.3.4

Was this page helpful?
0 / 5 - 0 ratings