Jump to content

StockAvailable::setQuantity - Error when called outside backoffice


bdesprez

Recommended Posts

Hi everyone,

I face a problem since PrestaShop has changed the stock management.

I work on a module which is called by webservices. I added a new element to centralize calls...

One of the functionnality is to update products informations like price, stock etc.
When the module receive informations it calls StockAvailable::setQuantity when the stock value has changed.

When the method is called, an error occured :

[PHP Notice #8] Use of undefined constant _PS_BO_ALL_THEMES_DIR_ - assumed '_PS_BO_ALL_THEMES_DIR_' (\{...}/override\/classes\/controller\/AdminController.php, line 444)

I think it's because of StockManager which need the employee to make the stock movment.

My question is quite simple : Is it possible to update the product stock outside a backoffice context?

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