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.
If we add this line:
'#attributes' => array('class' => 'node-add-to-wishlist'),
to this function:
function uc_wishlist_form_alter(&$form, &$form_state, $form_id) {
if (strpos($form_id, 'uc_product_add_to_cart_form_') === 0) {
// Add the wish list button to the add to cart form.
$form['wishlist'] = array(
'#type' => 'submit',
'#attributes' => array('class' => 'node-add-to-wishlist'),
'#value' => t('Add to wish list'),
'#submit' => array('uc_wishlist_add_to_wishlist_submit'),
);
}
we can style off the class when there are multiple products on a page, instead of the ID, which should be unique in the scope of any document in valid HTML.
Comments
Comment #1
naveenvalechaClosing because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.