Magento‎ > ‎

Disabilitare i prodotti non in una categoria

pubblicato 6 giu 2013, 06:30 da Roberto Gambuzzi   [ aggiornato in data 14 giu 2013, 02:53 ]
update catalog_product_entity_int set value=2 where attribute_id=96 and entity_id not in (select distinct product_id from catalog_category_product)

$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$write->update(
    'catalog_product_entity_int',
    array('value' => Mage_Catalog_Model_Product_Status::STATUS_DISABLED ),
    'attribute_id=96 and entity_id not in (select distinct product_id from catalog_category_product)'
);
Comments