Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there a way to have an option (or options) checked by default under a particular attribute?
Thanks for any help!
Comments
Comment #2
TR CreditAttribution: TR commentedPlease be more specific and describe exactly what you're trying to do. This could mean several things and I don't feel like trying to guess and answer them all.
Comment #3
m.roma CreditAttribution: m.roma commentedHave a checkbox option for an attribute already "checked" when they arrive on a given product's page. i.e. default setting set to TRUE.
Comment #4
TR CreditAttribution: TR commentedNo, there's no way to do that built into Ubercart. By default all checkbox options will be unchecked on a product page. It should be simple to do what you want for a particular product via hook_form_alter(), and that will work if you only have a small number of products that need this, but for a large number of products all having a different set of checks you would have to patch uc_attribute. This might be a good new feature.