Voting starts in March for the Drupal Association Board election.
Hi Ubercart maintainers,
I'm trying to pass a custom form validation function for a quantity field on an add to cart form.
Essentially, my clients do not want to have any user be able to purchase more than 10 products from them, and if they enter more than 10, be prompted with a message that instructs the customer to call the sales department. This would normally be as straightforward as passing a validation function with a message if the form_state quantity is greater than 10, but it seems that Ubercart for Drupal 7 appends the NID for each form ID, making them unique. So, instead of being able to set a validation function for uc_add_to_cart_form as the form ID, as I see it I'd have to write a function for every product, which is pretty unsustainable.
Any idea how I can fetch a global form ID for a product's add to cart form?
Also, none of the contrib modules for this task work in any capacity, so a custom solution is the only way at this point.