Api: Language Problem In 4.12.1

Hi!

I have a PHP script which calls the API

- to create a vendor first

- and, second, sets the vendor status to active ("A") in order to trigger the vendor's administration creation.

Everything worked fine in version 4.11.5:

The mails to the vendor administrator were sent in the language (e.g. German) in which the lang_code was set in the API call:

$language = 'de';
$vendor_data["lang_code"] = $language;
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($vendor_data));

In the administration everything looks fine:

Vendors language is German:

[attachment=14727:vendor1.PNG]

Vendor's administrator language is also German:

[attachment=14728:vendor2.PNG]

Till version 4.12.1 the mails sent out to the vendor's administrator are always in English.

Does anyone know why?

Looking forward to your answer!

Best regard

hummer

vendor1.PNG

vendor2.PNG

Dear all,

to make it more clear. These are the two API calls (performed by the Google Advanced REST client).

Please take notice of the "lang_code" which is set to "de".

POST /api/vendors/ HTTP/1.1
Host: www.example.com:443
Content-Type: application/json
authorization: Basic ...
content-length: 249

{
“storefront”: “api”,
“status”: “N”,
“lang_code”: “de”,
“company”: “Test Company”,
“address”: “Street 1”,
“zipcode”: “10002”,
“city”: “Berlin”,
“country”: “DE”,
“url”: “www.example.com”,
“email”: “example@example.com
}

PUT /api/vendors/227 HTTP/1.1
Host: www.example.com:443
Content-Type: application/json
authorization: Basic ...
content-length: 21

{
“status”: “A”
}

Result in version 4.11.5: email sent out to the vendor's administrator is in German (depending on the value submitted via lang_code).
Result in version 4.12.1: email sent out to the vendor's administrator is in English (always).
Can anybody help me to sort this out?
Best regards
hummer

So did you try?

PUT /api/vendors/227 HTTP/1.1
Host: www.example.com:443
Content-Type: application/json
authorization: Basic ...
content-length: 21

{
“status”: “A”,
“lang_code”: “de”,
}

Hi eComLabs,

Thanks for pointing this out, I've tried that too. But the result is the same, the mail is sent always in English (in version 4.12.1). In version 4.11.5 it works as expected (language depends on set lang_code of the first API call, the vendor creation part).

Is that a bug? In version 4.12.1 some things have changed regarding language, haven't they?

Best regards

hummer

Try to post it to the bug tracker and wait for the answer from CS-Cart team

Thank you eComLabs!

I just did that:

https://forum.cs-cart.com/tracker/issue-7870-api-language-problem-in-4121/

Best regards

hummer