the problem is that the recordset you are using for the add to cart button is in the body of the page inside a repeat region, it does not exist when the add to cart button code is running.
create another recordset that that queries the products table, and use that recordset for the bindings in the add to cart button behavior.