Back to Top

Prestashop – Error while creating products using webservices

Updated 26 March 2015

I had been struggling while creating products on pretsashop, via web-services.

The error i`m getting are –

Error 1 – [PHP Notice #8] Undefined index: (/var/www/prestashop/1609/classes/Product.php, line 4879)

Error 2 – [PHP Warning #2] array_splice() expects parameter 2 to be long, string given (/var/www/prestashop/1609/classes/Product.php, line 4881)

I thought the problem is in the way i am doing to create the products, but when i deeply check the problem and look inside some Core files of prestashop version

Searching for an experienced
Prestashop Company ?
Find out More

I found these above issue(s), which when fixed by me obvious, everything is worked like a charm for me

Now, I want to share it with all of you. May be it will help someone like me n save his/her time, I`lso want this forum to except it as a patch to this version.

Here is the fix –

Fix for Error 1 -
File name - Product.php
Line number - line 4846
class name - getWsPositionInCategory()
Replace return 0; in place of return '';
Fix to Error 2 -
File name - Product.php
Line number - line 4881
class name - setWsPositionInCategory()
Replace "array_splice($result, (int)$position, 0, $save);"
in place of "array_splice($result,$position, 0, $save);"

I have also post it on prestashop forum also –

That`s it !!! I hope it will help someone.

[stextbox id=”info”]Your opinions, comments and suggestions are important to keep the page updated and interesting. [/stextbox]


Current Product Version - Prestashop

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*

Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home