Hi All,
Again I expect I am missing the obvious here. I want to add a wrapper around the quantity section of the "add to cart" form. Now I could hard code this by adding the following line to "uc_product.module" (around line1476):
$form['div_tag'] = array('#type' => 'markup', '#value' => '<div class="qty-wrapper">');This does indeed work and gives me the following code:
<div class="qty-wrapper">
<div id="edit-qty-11-wrapper" class="form-item">
<label for="edit-qty-11">Quantity: </label>
<input type="text" class="form-text" value="1" size="5" id="edit-qty-11" name="qty" maxlength="6">
</div>
</div>This is exactly what I want. Now I want to do this properly and not hack core files. Hence I have created my own module with form alter:
function mymodule_form_alter(&$form, &$form_state, $form_id) {
if (substr($form_id, 0, 27) == 'uc_product_add_to_cart_form') {
$form['div_tag'] = array('#type' => 'markup', '#value' => '<div class="qty-wrapper">');
}
}I know this is being called and I can see the new item in the list when I do a DPM / DSM. However, it fails to wrap around, or indeed print at all. The only difference I can see is the position in the list.
So the question is, what am I doing wrong?
I would be very greatful for any pointers.
Regards,
Nick
