1

I'm using Magento2. When I add a new product with a price of 416000000 the price is reset to 100000000 after save. How can I fix it?

1

This is due to the restriction on database level where the product price is stored in a colum of type decimal(12,4). This means there can be 8 digits to the left of the decimal point (12-4) and 4 to the right of the decimal point.

If you want to change this, wou will have to modify all tables and columns where the price is stored and set the type of the colums to at least decimal(13,4) according to your example.

Check out these tables where the product price, quote and quote item totals, order and order item totals price are stored and identify colums which you need to update (no guarantee for completeness):

catalog price table

  • table catalog_product_entity_decimal, column value

quote and sales tables

  • table sales_order, quite a lot of columns. Most important are the base_* and total_* colums, grand_total, subtotal.
  • table sales_order_item
  • table sales_order_payment
  • table sales_invoice and sales_invoice_item
  • table sales_creditmemo and sales_creditmemo_item
  • table quote, similar/the same colums as in the sales_order table
  • table quote_item

index tables

  • table catalog_product_index_price, column price
  • table catalog_product_index_price_tmp, column price
  • table catalog_product_index_price_final_tmp, column price

also check out the other index tables for bundle, configurable and downloadable products (if needed).

I hope this helps you getting started with it. I'd say that's a lot of work to update all the colums in your database.

Also you have to do some intensive testing to see and check if the price gets somewhere reset again after updating all your columns.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.