magento - Delete Product after Order -
i need delete ordered products programmatically after users order finished.
some ideas @ point can hook in solve ?
here's link how set observers (you'll need create own module this).
the event want listen sales_order_place_after
, , when declare observer it, code called after order placed.
and can add code observer
to delete product in magento use following code.
this code delete product
<?php mage::register("issecurearea", 1); $product_id = 2; //use own product id try{ mage::getmodel("catalog/product")->load( $product_id )->delete(); }catch(exception $e){ echo "delete failed"; } ?>
Comments
Post a Comment