$errors = $product->getErrors(); $errorMessage = Cart66Common::showErrors($errors, "<p><b>" . __("The product could not be saved for the following reasons", "cart66") . ":</b></p>"); } elseif ($errorCode == 66101) { // File upload failed $errors = $product->getErrors(); $errorMessage = Cart66Common::showErrors($errors, "<p><b>" . __("The file upload failed", "cart66") . ":</b></p>"); } Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Product save failed ({$errorCode}): " . strip_tags($errorMessage)); } } elseif (isset($_GET['task']) && $_GET['task'] == 'edit' && isset($_GET['id']) && $_GET['id'] > 0) { $id = Cart66Common::getVal('id'); $product->load($id); } elseif (isset($_GET['task']) && $_GET['task'] == 'delete' && isset($_GET['id']) && $_GET['id'] > 0) { $id = Cart66Common::getVal('id'); $product->load($id); $product->deleteMe(); $product->clear(); } elseif (isset($_GET['task']) && $_GET['task'] == 'xdownload' && isset($_GET['id']) && $_GET['id'] > 0) { // Load the product $id = Cart66Common::getVal('id'); $product->load($id); // Delete the download file $setting = new Cart66Setting(); $dir = Cart66Setting::getValue('product_folder'); $path = $dir . DIRECTORY_SEPARATOR . $product->download_path; unlink($path); // Clear the name of the download file from the object and database $product->download_path = ''; $product->save(); } $data['products'] = $product->getNonSubscriptionProducts('where id>0', null, '1');