Jump to content

Errors in product_lang after product->update()


BeJay

Recommended Posts

Hi all,

 

For a future module I was exploring how to update the ps_product and ps_product_lang tables.

 

I collected the data with this constructor: new Product(2, false, 6)

First parameter is product_id

Second parameter not essential in this problem.

Third parameter is language_id, in this way the data for that language is also collected.

I have six languages installed.

 

There are two fields in the products_lang table that I use, link_rewrite and name.

According to the Product class these two are the required fields for this table.

 

For testing I used these values

link_rewrite = '0123456789'

name = '9876543210'

 

One would expect the record for product_id = 2 and language_id = 6 in the product_lang table to contain these two values after the update. The other languages would remain unchanged.

 

I got the following instead (just skipping the non essential fields):

 

record for language 1, link_rewrite = 1, name = 8

2, 2, 7

3, 3, 6

4, 4, 5

5, 5, 4

6, 6, 3

 

So all six languages have changed, but the fields contain just one character, and the characters are in the order of the fields I supplied, excluding the first character.

 

I have provided two files

AdminTest.php for the admin\tab directory

test.php for the root of prestashop

 

Where am I going wrong?

test.zip

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...