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.
Is it possible to set checkout form in this way? So when user open checkout form, billing address items would be collapsed?
I tried it in hook_form_alter
<?php
$form['panes']['billing']['copy_address']['#default_value'] = TRUE;
$form['panes']['billing']['#collapsed'] = TRUE;
?>
Checkboxed is checked but billing is not collapsed.
IS it possible to set this?
thanks
Tomas
Comment | File | Size | Author |
---|---|---|---|
#5 | 1502774-default-same-address.patch | 2.13 KB | longwave |
Comments
Comment #1
longwaveNot sure why your custom code doesn't work, it would help if you posted an entire function rather than a snippet.
http://drupal.org/project/uc_checkout_tweaks provides this feature in 6.x, it could be forward ported and added to core in 7.x, so changing this to a feature request.
Comment #2
Neo13 CreditAttribution: Neo13 commentedIt would be great to see setting that billing information is the same as delivery by default implemented in Ubercart core.
Comment #3
TR CreditAttribution: TR commentedIf you would like to create a patch for this we can evaluate it. This is very easy to do with hook_form_alter() in a custom module.
Comment #4
Neo13 CreditAttribution: Neo13 commentedI was not able to do this myself. Is anybody willing to help please?
Comment #5
longwaveComment #6
Neo13 CreditAttribution: Neo13 commentedI tried the patch and it seems to be working fine. Thank you very much!
Comment #7
longwaveCommitted, thanks for testing.
Comment #9
Neo13 CreditAttribution: Neo13 commentedThis seems to have stopped working. I have checkbox "Use the same address for billing and delivery by default. " in administration checked but it is not working - billing address pane is still being shown. It is on completely new installation. Could you please look into this? Thanks in advance.
Comment #10
longwaveThe billing pane is still shown; the option checks the "my address is the same" checkbox by default on whichever pane is second out of billing and delivery. This works as expected for me on a new install with the panes in either order. A screenshot of your checkout and your checkout settings page might help figure out what the problem is.
Comment #11
Neo13 CreditAttribution: Neo13 commentedYes, thats what I meant, it was not checked by default. I have figured it out, it does not work with Ubercat Addresses module and Extra Fields Checkout Pane. I use it to add some required fields to billing address in my country. But when I check it manually it does work.
Comment #12
TR CreditAttribution: TR commentedComment #13
MegaChriz CreditAttribution: MegaChriz commentedUbercart Addresses needs to override the checkout panes in order to be able to provide extra address fields on both the checkout pane and the checkout review page. Unfortunately, I can not always keep up to date with changes in Ubercart regarding the address checkout panes. Just found this one because I search for "address" in the Ubercart issue queue every now and then. Can you file an issue in the Ubercart Addresses issue queue?
Comment #14
MegaChriz CreditAttribution: MegaChriz commentedFor Ubercart Addresses, see this issue: #1843562: Support checkbox "My billing information is the same as my delivery information." checked by default