Jump to content

Error when Editing a product


kongking

Recommended Posts

Posted (edited)

Hello everyone. How're you doing?

I'm facing the following bug when editing a product that was received (without any errors) from my ERP.

The error occurs only on products that were received from ERP. When I create manually a product using Prestashop interface (function Add Product), it does not happen. 

Video of the Problem:  https://www.dropbox.com/scl/fi/9ldlnlsh9lnslpowueszo/NAO-APAGAR-ERRO-PRESTASHOP-INTEGRA-O-TINY.mp4?rlkey=qu3udufxcpjtgg7eie6r7vwnw&st=pr35n5aq&dl=0

PS: DON'T care about the text I wrote on the video, it's for my ERP support. But you can understand the video anyway... they anwered it's not ERP error, but to look after Prestashop support to get why this error is ocurring.

Please, is there someone who could debug and track what could be the problem?

Thank you.

Edited by kongking (see edit history)
Link to comment
Share on other sites

Posted (edited)

you  should  compare an erp product to manually added product, here is some basic steps on how to do this:

 

How to Compare Product Entries in PrestaShop

1. Identify Sample Products

  • Select one product manually created in the PrestaShop back office.
  • Select one or more products imported from the ERP that show the editing issue.

2. Access the Database

  • Use a database management tool (such as phpMyAdmin or Adminer) connected to your PrestaShop database.
  • Products are primarily stored in the ps_product table, but product information is often spread across related tables:
  • ps_product_lang (localized names/descriptions)
  • ps_product_shop (shop associations)
  • ps_stock_available
  • ps_category_product
  • ps_product_attribute (for combinations/variants)
  • ps_image (for product images)

3. Query the Data

  • Use the product IDs to view all fields for each product across relevant tables.
  • For example, to see a product with ID 123:

SELECT * FROM ps_product WHERE id_product = 123; SELECT * FROM ps_product_lang WHERE id_product = 123;

Note: Export the rows as CSV or Excel files if easier to compare.

4. Look for Key Differences

  • Missing Fields: Are there any null or missing values in the ERP-imported product that are present in the manual product?
  • Data Format: Are there strange or unexpected values (e.g., numbers where text should be, or vice versa)?
  • Associations: Is the imported product linked to the correct categories, languages, shops, and stock records?
  • Default Values: Are default fields (like visibility, active status, price, etc.) set the same way?
  • Combinations/Variants: If you use combinations, check ps_product_attribute and related tables.

5. Check for “Orphaned” or Incomplete Data

  • Sometimes an ERP import creates a product entry but forgets a related table, such as missing entries in ps_product_lang or ps_stock_available.
  • These “orphaned” records can break the product edit page.

6. Compare Product Metadata

  • Also compare:
  • Images (ps_image table)
  • SEO fields (meta_title, meta_description, link_rewrite)
  • Custom fields, features, and tags

7. Test Editing After Fixes

  • If you spot a discrepancy, try manually updating the field(s) in the database for one affected product.
  • Then test editing it in the PrestaShop admin to see if the issue is resolved.
  • If successful, adjust your ERP import process or perform a batch fix for all products.
Edited by El Patron (see edit history)
  • Like 1
Link to comment
Share on other sites

Posted (edited)

Hi El Patron. Thank you for your very detailed answer. So. I have compared both products and realized that it was the column id_tax_rules_group. ERP sends value 1  for this column, but as I DON'T USE taxes rules and taxes in PRESTASHOP (the table tax_rules_group is empty), it should be 0. So, I recommend that even though, there is a value different of 0, prestashop needs to force an update to the tables: "product" and "product_shop" (that there is this "id_tax_rules_group" column) or ignore this value... maybe some kind of treatment. (check if user has turned off the "use taxes?" option on "Menu > International > Taxes" page, if OFF, ignore any id_tax_rules_group on those tables... something like that. Is it possible? So that it's a prestashop bug.

I updated both tables "product" and "product_shop", put 0 on id_tax_rules_group value. And tried to update the product on the admin panel of prestashop (edit product page), saved...and it worked!

01 - Erro Tiny Prestashop.jpg

02 - Continuacao Erro Tiny Prestashop.jpg

Imagem 018.jpg

Edited by kongking (see edit history)
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...