Skip to content

Fatal error: Call to a member function getStock() on a non-object in Mplusqapiclient.php on line 605 #3

Open
@dswmedia

Description

@dswmedia

I am using the following code like suggested on the development portal:

// Then we initialize the variables
$branchNumber = 1;
$articleNumbers = 4542;
$amountChanged = -3;

// Then we call the getStock() function wrapped in a try/catch block to intercept any exceptions.
try {
if (false !== $mplusqapiclient->updateStock($branchNumber, $articleNumber, $amountChanged)) {
exit('Stock succesfully updated.');
} else {
exit('Unable to update stock.');
}
} catch (MplusQAPIException $e) {
exit($e->getMessage());
}

This results in:

Fatal error: Call to a member function getStock() on a non-object in Mplusqapiclient.php on line 605

Yes I am sure that i am using the right articleNumber.

Also there is a typo on the $articleNumbers vs $articleNumber

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions