I am using the Ubercart module. When the user clicks on "Add to Cart" I want to add the item only if the cart is empty for that item. If the cart already has that item, I want to remove it.
I thought the way to do this would be to write my own module which I named removeproduct. This is the first custom module I have written and I am having trouble with my hook functions. I can get "removeproduct_form_alter" and "removeproduct_help" to work, but when I try to hook into Ubercart, using the following:
function uc_add_to_cart($nid, $qty, $data) {
$txt="in add to cart";
echo $txt;
}
I don't see my debugging text.
I have also tried calling the function: "removeproduct_uc_add_to_cart" and "uc_cart_uc_add_to_cart" but that also doesn't work.