I had the same situation you had. I wanted to automatically add free items to each user's shopping cart. I am running version 4.0.12. Here is the reply I got from tech support. Hope it helps.
Please perform following steps :
1. Open '<xcart_root_dir>/cart.php' file.
2. Replace :
Code:
---
} elseif($from == 'partner' && $productid) {
func_header_location($xcart_catalogs['customer']."/product.php?productid= ".$productid);
}
}
#
# DELETE PRODUCT FROM THE CART
#
---
with
Code:
---
} elseif($from == 'partner' && $productid) {
func_header_location($xcart_catalogs['customer']."/product.php?productid= ".$productid);
}
if ($productid<>%ID%)
func_header_location($xcart_catalogs['customer']."/cart.php?mode=add&productid= %ID%&amount=1");
}
#
# DELETE PRODUCT FROM THE CART
#
---
Just replace %ID% with the ID of 'free' product.
For example :
--
if ($productid<>16126)
func_header_location($xcart_catalogs['customer']."/cart.php?mode=add&productid= 16126&amount=1");
--
--