I want to run checking code on a Ubercart product field attribute before allowed to proceed with the checkout. The code could run right below or in conjunction with the "required" - not empty - check.

But looking at the attributes module I do not see where it runs from. Trying to use the Ubercart Field Attributes module to do this on the fly with Ajax and JQuery my code is running without syntax error but also the form_set_error is not working as I am trying to use an Ajax callback.

No message comes up on the product form.

Both the attributes and field attributes work to throw the errors if the fields are empty as should be, but if I knew where the "required" error could originate I could piggyback my code there for this singular product class item

The Ubercart forums pages seem to be down

Can anyone point me to where that "required" checkbox code is in the attributes system ??

  • 1
    Ubercart module uc_attribute adds all attributes to the uc_product_add_to_cart_form form in uc_attribute_uc_form_alter function. Here you can see the _uc_attribute_alter_form function call which returns the form elements for product attributes. So you will need to attach custom validate function to the uc_product_add_to_cart_form (via hook_form_alter) and then you will be able to validate attribute values submitted while adding product to the cart. However it is not clear to me if this is exactly what you have problem with. – Juraj Nemec Apr 20 at 20:34
  • OK - that makes sense, it will be a challenge to implement this for that one product class, but it appears to be the right direction and I can hack it out. – wilburunion Apr 21 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.