Skip to content

Advanced/Tier Pricing thousand separators corrupt quantities on save (e.g. qty of 1,000 on save becomes 1) #6002

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

Closed
Part-A opened this issue Aug 5, 2016 · 6 comments
Assignees

Comments

@Part-A
Copy link

Part-A commented Aug 5, 2016

Bug is apparent in version 2.1, I have not checked earlier versions.

System set to a language that uses , (comma) as a thousands separator.

When creating a product with a advanced/tiered pricing structure, naturally, quantities of 1000 or above may be required. However, if a product is revisited and saved the quantities of 1000 and above are truncated at the displayed thousands separator: 1,000 becomes 1, 2,000 becomes 2, etc.

Steps to reproduce are:

  1. Create or open a product
  2. Open Advanced pricing and create tiered pricing entries with 'Quantity' set to 1000 or above.
  3. Save and close the product
  4. Re-open the product, save and close the product (there is no need to open the 'Advanced Pricing' Panel)
  5. Re-open the product, open the 'Advanced Pricing' panel. All quantities of 1000 and above will have been truncated.
@Part-A
Copy link
Author

Part-A commented Aug 8, 2016

Additionally, the same bug affects the 'weight' field

@paales
Copy link
Contributor

paales commented Aug 9, 2016

Duplicate of #5745

@odubovyk odubovyk self-assigned this Aug 22, 2016
@Part-A
Copy link
Author

Part-A commented Aug 22, 2016

This issue can be corrected temporarily (until an official bug release) by amending lines 107 and 108 of General.php

This file can be found in the generally (composer or downloaded from webste) installed version, at:
vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/General.php

or in the version on GitHub at:
app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php

Change:
$value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE_QTY] = $this->formatNumber((int)$value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE_QTY]);
to

$value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE_QTY] = (int)$value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE_QTY];
This is for Magento 2.1. I have not as yet looked into the weight field.

Do not simply comment out the line as the casting to an int is required.

@paales
Copy link
Contributor

paales commented Aug 24, 2016

@Part-A Technically the QTY field doesn't have to be an int, it can be a float as well. To convert to a number, do $value * 1.

@senthilengg
Copy link

senthilengg commented Sep 2, 2016

To add to it, if you upload advanced pricing using csv ( bulk upload ) then go a head and view the same product in the catalog --> product section --> Advanced Pricing . It shows with thousands separator now try to save.

Expected Result
Product should be saved.
Actual Result
We found a duplicate website, tier price, customer group and quantity.

@miakusha
Copy link
Contributor

Closed as duplicate #5745
Issue has been fixed

gabrieldagama pushed a commit to gabrieldagama/magento2 that referenced this issue Aug 31, 2020
[honey] MC-32659: MyAccount :: Order Details :: Order Details by Order Number with additional different product types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants