function uc_shipping_shipment_delete in Ubercart 6.2
Same name and namespace in other branches
- 5 shipping/uc_shipping/uc_shipping.module \uc_shipping_shipment_delete()
- 7.3 shipping/uc_shipping/uc_shipping.module \uc_shipping_shipment_delete()
Delete a shipment.
2 calls to uc_shipping_shipment_delete()
- uc_shipping_package_cancel_confirm_submit in shipping/
uc_shipping/ uc_shipping.admin.inc - Form submission handler for uc_shipping_package_cancel_confirm().
- uc_shipping_shipment_delete_confirm_submit in shipping/
uc_shipping/ uc_shipping.admin.inc - Submit handler for uc_shipping_shipment_delete_confirm().
File
- shipping/
uc_shipping/ uc_shipping.module, line 572
Code
function uc_shipping_shipment_delete($shipment_id) {
$shipment = uc_shipping_shipment_load($shipment_id);
foreach ($shipment->packages as $package) {
if (file_exists($package->label_image)) {
file_delete($package->label_image);
}
}
db_query("UPDATE {uc_packages} SET sid = NULL, tracking_number = NULL, label_image = NULL WHERE sid = %d", $shipment_id);
db_query("DELETE FROM {uc_shipments} WHERE sid = %d", $shipment_id);
module_invoke_all('shipment', 'delete', $shipment);
}