a bug!
There's a small error in the function that is used to delete attributes, which only manifests when the product has Download Files attached to it.
To fix it, edit this file:
/admin/includes/functions/general.php
around line 2082, you'll see the following code.
Make the following change by adding the ->fields text as shown:
Code:
////
// Delete all product attributes
function zen_delete_products_attributes($delete_product_id) {
global $db;
// delete associated downloads
$products_delete_from= $db->Execute("select pa.products_id, pad.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id='" . $delete_product_id . "' and pad.products_attributes_id= pa.products_attributes_id");
while (!$products_delete_from->EOF) {
$db->Execute("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id = '" . $products_delete_from->fields['products_attributes_id'] . "'");
$products_delete_from->MoveNext();
}
$db->Execute("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $delete_product_id . "'");
}
Bookmarks