Having two or more products - with "Add to wish list" button - on same page (i.e. a views block showing related products) would break strict w3 validation, since the input buttons are using same id.

Wouldn't it be better in some way to change
<input id="edit-wishlist" class="form-submit ">
to
<input class="form-submit edit-wishlist">
?

Comments

Anonymous’s picture

Priority: Normal » Minor

Hi miccelito,
You are right.As I am very much friendly with this module.This happened due to the code as this will add Add to Wishlist button in the Add to cart form using the form alter.As this is not a big issue so I changed its Priority to minor.

miccelito’s picture

Great you're very familar with the module. Then maybe you can tell where in the codes I can remove the id="edit-wishlist" part. (Adding a new class is easy so that's not a problem tho..)

Anonymous’s picture

Assigned: Unassigned »
Status: Active » Needs review

Hi miccelito,
Replace the code at line 265 in uc_wishlist.module file.

$form['wishlist'] = array(
  '#type' => 'submit',
  '#value' => t('Add to wish list'),
  '#submit' => array('uc_wishlist_add_to_wishlist_submit'),
);

with

$form['wishlist'] = array(
  '#type' => 'submit',
  '#value' => t('Add to wish list'),
  '#id' => 'edit-wishlist-'. $form['nid']['#value'],
  '#attributes' => array(
    'class' => 'node-add-to-wishlist',
  ),
  '#submit' => array('uc_wishlist_add_to_wishlist_submit'),
);

This will do it.

miccelito’s picture

Did your mean

$form['wishlist'] = array(
  '#type' => 'submit',
  '#value' => t('Add to wish list'),
  '#id' => 'edit-wishlist-'. $form['nid']['#value'],
  '#attributes' => array('class' => 'node-add-to-wishlist'),
  '#submit' => array('uc_wishlist_add_to_wishlist_submit'),
);

Right?

Anonymous’s picture

Ya :)

Anonymous’s picture

Status: Needs review » Closed (fixed)

fixed