On the add product page I have removed the default multiselect box with product categories and put in my own checkboxes.
When the form is submitted it inserts into the ec_products table and into the term_node table. My problem is that there is a bit of code that is still running after my inserts that is deleting everything for that node id in the term_node table which i just added. I assume it then trys to add what would have been selected by the multiselect box. I cant find what is doing this.
I have replaced the product_save function with this:
function product_save($node) {
//$node->is_recurring = ($node->price_interval) ? 1 : 0;
//$fields = product_fields();
/* Be very sure that we have a product entry to update! */
if (db_result(db_query('SELECT COUNT(vid) FROM {ec_product} WHERE vid = %d', $node->vid))) {
db_query("UPDATE {ec_product} SET
item='%s',
description='%s',
inciChemicalName='%s',
businessManager='%s',
itemGroup='%s',
supplierName='%s',
productFunction='%s',
specification='%s',
safetyDataSheet='%s',
productType='%s',
maximum_order=%d,
deleted='%s'
WHERE nid = %d",