A Magento 2 product normally has one of two statuses: enabled or disabled. Use the following code to check its status programmatically:
|
1 2 3 |
// 1 = aktiviert // 2 = deaktiviert $status = $product->getStatus() |
Fertig!
A Magento 2 product normally has one of two statuses: enabled or disabled. Use the following code to check its status programmatically:
|
1 2 3 |
// 1 = aktiviert // 2 = deaktiviert $status = $product->getStatus() |
Fertig!
The following MySQL query returns the status of every product in the Magento database.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
SELECT cpe.sku, q.product_status FROM catalog_product_entity cpe JOIN (SELECT entity_id AS product_id, value AS product_status FROM catalog_product_entity_int WHERE entity_type_id = (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product') AND attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'status' AND entity_type_id = (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product'))) q ON cpe.entity_id = q.product_id; |
Status 1: active Status 2: not active
Normally Magento does not permit changing an order state to COMPLETE or CLOSED directly. Instead, you receive an error message (The Order State “complete” must not be set manually). You can work around this by overriding Order.php and View.php. 1.…