Skip to main content
added 8 characters in body; edited title
Source Link
PЯINCƎ
  • 11.7k
  • 3
  • 25
  • 82

remove directory with files How to delete folder after the order ends

Im new in Magento. I, I need to delete a file and its containing folder, which has a name generated by the following code:

$order = Mage::getModel('sales/order')->load($id_order);
$increment = $order->getIncrementId();

if (!file_exists(Mage::getBaseDir('base').'/Ocproveedores/'.$increment)) {
    mkdir(Mage::getBaseDir('base').'/Ocproveedores/'.$increment, 0777, true);  
} 

$tcpdf->Output(Mage::getBaseDir('base').'/Ocproveedores/'.$increment.'/OC-'.$nombreProveedor.'-'.$increment.'-'.$j.'.pdf', 'F');

How can I Deletedelete the folder after ending an order  ? Thanks

Thanks a lot.

remove directory with files

Im new in Magento. I need to delete a file and its containing folder, which has a name generated by the following code:

$order = Mage::getModel('sales/order')->load($id_order);
$increment = $order->getIncrementId();

if (!file_exists(Mage::getBaseDir('base').'/Ocproveedores/'.$increment)) {
mkdir(Mage::getBaseDir('base').'/Ocproveedores/'.$increment, 0777, true); }
$tcpdf->Output(Mage::getBaseDir('base').'/Ocproveedores/'.$increment.'/OC-'.$nombreProveedor.'-'.$increment.'-'.$j.'.pdf', 'F');

How can I Delete the folder after ending an order? Thanks a lot

How to delete folder after the order ends

Im new in Magento, I need to delete a file and its containing folder, which has a name generated by the following code:

$order = Mage::getModel('sales/order')->load($id_order);
$increment = $order->getIncrementId();

if (!file_exists(Mage::getBaseDir('base').'/Ocproveedores/'.$increment)) {
    mkdir(Mage::getBaseDir('base').'/Ocproveedores/'.$increment, 0777, true);  
} 

$tcpdf->Output(Mage::getBaseDir('base').'/Ocproveedores/'.$increment.'/OC-'.$nombreProveedor.'-'.$increment.'-'.$j.'.pdf', 'F');

How can I delete the folder after ending an order  ?

Thanks a lot.

Source Link
xanax
  • 11
  • 2

remove directory with files

Im new in Magento. I need to delete a file and its containing folder, which has a name generated by the following code:

$order = Mage::getModel('sales/order')->load($id_order);
$increment = $order->getIncrementId();

if (!file_exists(Mage::getBaseDir('base').'/Ocproveedores/'.$increment)) {
mkdir(Mage::getBaseDir('base').'/Ocproveedores/'.$increment, 0777, true); }
$tcpdf->Output(Mage::getBaseDir('base').'/Ocproveedores/'.$increment.'/OC-'.$nombreProveedor.'-'.$increment.'-'.$j.'.pdf', 'F');

How can I Delete the folder after ending an order? Thanks a lot