Posted by miccelito on January 16, 2013 at 10:10am
2 followers
Jump to:
| Project: | UC Wish List |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | minor |
| Assigned: | naveenvalecha |
| Status: | closed (fixed) |
Issue Summary
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
#1
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.
#2
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..)#3
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.
#4
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?
#5
Ya :)
#6
fixed