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

CommentFileSizeAuthor
#5 1502774-default-same-address.patch2.13 KBlongwave
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave’s picture

Category: support » feature

Not 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.

Neo13’s picture

It would be great to see setting that billing information is the same as delivery by default implemented in Ubercart core.

TR’s picture

Version: 7.x-3.0-rc4 » 7.x-3.x-dev
Priority: Normal » Minor

If 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.

Neo13’s picture

I was not able to do this myself. Is anybody willing to help please?

longwave’s picture

Status: Active » Needs review
FileSize
2.13 KB
Neo13’s picture

Status: Needs review » Reviewed & tested by the community

I tried the patch and it seems to be working fine. Thank you very much!

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks for testing.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Neo13’s picture

Status: Closed (fixed) » Needs work

This 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.

longwave’s picture

Category: feature » support
Status: Needs work » Postponed (maintainer needs more info)

The 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.

Neo13’s picture

Yes, 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.

TR’s picture

Status: Postponed (maintainer needs more info) » Fixed
MegaChriz’s picture

Ubercart 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?

MegaChriz’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.