Jump to content

Marcus_Marzullus

Members
  • Content count

    2
  • Joined

  • Last visited

Profile Information

  • Real Name
    Marcus
  • Gender
    Male
  1. Marcus_Marzullus

    Optional Related Products, Version 4.0

    Anita just found a bug related to this: 2) Add code to [catalog/]admin/categories.php, case 'delete_product_confirm': to remove all Related Product entries containing the removed product. Find, on or around line 154: if ($product_categories['total'] == '0') { tep_remove_product($product_id); } } Replace with: if ($product_categories['total'] == '0') { tep_remove_product($product_id); } /* Optional Related Products (ORP) */ tep_db_query("delete from " . TABLE_PRODUCTS_RELATED_PRODUCTS . " where pop_products_id_master = '" . (int)$product_id . "'"); tep_db_query("delete from " . TABLE_PRODUCTS_RELATED_PRODUCTS . " where pop_products_id_slave = '" . (int)$product_id . "'"); //ORP: end } This is not a good place for the two queries lines above. If a user deletes a whole category (tree), all products in the category tree will be deleted but TABLE_PRODUCTS_RELATED_PRODUCTS entries WILL NOT be deleted. The right place for the two queries is inside the tep_remove_product function that is called in both cases: single product delete or whole category tree delete. Have a nice day Marcus
×