By lipinponmala007 on
Hi,
i have alterd the uc_view_form using form_alter and added anew button to this 'cancel' form but i want to arrange the form in such a way that ithe cancel button should be coming first (before continue shopping). i found that there is a theme_funtion which makes the form as it is but hoe to override this? my button is always coming in a different
any comments are welcome thanks in advance.
Comments
Do you want to change the layout in the Theme Layer?
Do you want to make the change in the module or in the theme?
If the module includes a preprocess method (see http://api.drupal.org/api/search/6/preproces). That means you can perform your override in the theme layer (template.php).
You can add #weight to each
You can add #weight to each of the buttons in your hook_form_alter() that will set the position of the buttons. Lower weights will come first, higher weights will come after.
Contact me to contract me for D7 -> D10/11 migrations.
Thank you for your efforts to
Thank you for your efforts to helping me.. Please forgive me if am asking foolish questions.I was building a module. i generated a button with this module which will come with a form of other module. i wanted to change the button order . the theme function that generating that form was
theme_uc_cart_view_form($form)
so there were already to groups of buttons which is coming inside two
$output .= '
. drupal_render($form) .'
.$cs_element.'
';
my button should come inside "
Ofcourse i had tried the '#weight' arrangements earlier. but the weight is effecting with respect to the other buttons in side the "
I know that with hacking the core i can achieve this. But wondering why a special"
I'm sorry, I have no idea
I'm sorry, I have no idea what you mean by all that.
Contact me to contract me for D7 -> D10/11 migrations.
Thank you for your efforts to
sorry jay... it was a mistake from me...on that post
Thank you for your efforts to helping me.. Please forgive me if am asking foolish questions.I was building a module. i generated a button with this module which will come with a form of other module. i wanted to change the button order . the theme function that generating that form was
theme_uc_cart_view_form($form)
so there were already to groups of buttons which is coming inside two div s inside
my button should come inside "div id="continue-shopping-button" but after the mymodule_form_alter function my button is outputing on div id="update-checkout-buttons"' .Also using the css, the both div will come in a raw with "div id="continue-shopping-button" on left side and " div id="continue-shopping-button"' on right side;
Ofcourse i had tried the '#weight' arrangements earlier. but the weight is effecting with respect to the other buttons in side the "div id="update-checkout-buttons' so the arrangements still not as like my required.
I know that with hacking the core i can achieve this. But wondering why a special" div" is always selected.
p.s i have removed the <> from divs becvause i found it is making conflict with the text editor of this site.
By calling
By calling drupal_render($form), you are rendering the entire form, which means that your element is already rendered at that point and therefore isn't accessible after this point.
Your best bet is to do this with #weight, and set a #weight on ALL the buttons, so that they are in the order you want.
If you show the actual $form definition for the buttons you want to order, it would be easier to give specific help.
Contact me to contract me for D7 -> D10/11 migrations.
i already tried setting
i already tried setting different buttun weights for each but couldn't achieve the goal so may i post the true codes
in uc_cart.module. i had the following functions.
in my smart_order_watch.module
Which buttons are you trying
Which buttons are you trying to change, and what order are you trying to put them in?
Contact me to contract me for D7 -> D10/11 migrations.
the required order is [Save
the required order is [Save Order] [continue shopping] [update cart] [checkout] the weight arrangements gave me
[continue shopping] [Save Order] [update cart] [checkout]
Try changing
Try changing this:
to this:
You may have to play with the weight of $form['buttons'], but this should group all your buttons together in the order you want.
Contact me to contract me for D7 -> D10/11 migrations.
worked!!!!! absolutly nice!!!
Dear Jay Matwichuk
I don't know how to thank you......But, Thank you verymuch..i'll do study drupal and PHP more and will try to help a person in future.
No worries. Stuff like this
No worries. Stuff like this can be hard to figure out when you are learning, glad to help.
Contact me to contract me for D7 -> D10/11 migrations.