Pregunta

We want to update stock status with sql query. This query worked and products status does as out of stock in product page. But when i did clearing cache, products is appearing in stock

when i check products in admin panel, products is appearing in stock.

Does magento has function for product status change?

$query = "UPDATE cataloginventory_stock_status SET stock_status = 0 WHERE product_id=".$product_id;

Thanks.

¿Fue útil?

Solución

try this query, in will prevent product appears on the website searching result and although product page can be accessed on the frontend by url, it cannot be added to cart :

$query = "UPDATE cataloginventory_stock_item SET is_in_stock = 0 WHERE product_id=".$product_id;

hope this works

Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange
scroll top