Closed (outdated)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
User experience
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2012 at 15:23 UTC
Updated:
30 Dec 2023 at 11:47 UTC
Jump to comment: Most recent
Comments
Comment #1
rszrama commentedThe problem is not every payment method has "payment details" (such as the credit card form for such payment methods). Without that radio button, there would be no indication at all. I'm open to ideas for what exactly this could look like, but my hunch is this should most likely be solved on a one-off basis when you're doing your theming.
Comment #2
djdevinThanks - that makes sense. Maybe payment modules can flag their methods as such (requiring user input), and then that allows some sort of option in the admin UI to show/hide the label. If I think of something I'll post a patch, for now this is pretty minor.
Comment #3
rszrama commentedOk, great. If you're interested in seeing how I've done this before, I actually do hide the "Credit card" option in some circumstances if configured via the Card on File module.
Comment #4
JulienD commentedThis can easily be done by attaching a css rules inline or in a dedicated file with a hook_form_alter() to the payment form.
Just below the code to include into a custom module to catch the payment form and to attache it a css rule inline.
@rszrama: Do you think that feature need to be ported as a patch for commerce_payment or this should be done by end user during theming ?
Comment #5
shushu commentedWhat about just grab the code and make a minor module out of it ?
Comment #6
rosell.dk commentedHere is a much more clean way:
function yourmodulename_form_commerce_checkout_form_review_alter(&$form, &$form_state, $form_id) {
$form['commerce_payment']['#access'] = FALSE;
}
I suppose one could make a module out of this. Perhaps with the option to only hide the selector when there is only one payment method.
I'm not confident if the payment selector might be put into another form in checkout settings. Then it might be part of the commerce_checkout_form_checkout_alter instead. Then do this:
function yourmodulename_form_commerce_checkout_form_checkout_alter(&$form, &$form_state, $form_id) {
$form['commerce_payment']['#access'] = FALSE;
}
Comment #7
rszrama commentedClosing this out as I wouldn't make such a change in the 1.x branch now but we did fix this in 2.x. : )
Comment #8
thursday_bw commentedHuh?
This clearly is not fixed, I've come to this issue after hours of detective work for an issue on commerce_paypal module: Paypal smart buttons showing on cart page not review or payment page
Expecting a sitebuilder to add CSS to their theme to get a module to work with a single payment gateway out of the box is just not the correct solution here, in my humble opinion, the fact that I spent days pulling my hair out to wind up here on this issue is a testament to that.
"when there is only one payment method available, the radio for selection shouldn't appear." 100% when there is only one payment method available the selection for it should not appear, that's just, is that debatable? how so?
Perhaps in the case of commerce_paypal it is the responsibility of commerce_paypal to take care of this issue? I'm not sure.
What do we do to resolve this issue? should the commerce module hide the payment information panel if only one payment option is available? that's confusing too because it makes the 'payment inforamation' pane being enabled in the checkout flow confusing as heck if it doesnt' actually appear in this context, it would be enabled but not visible.
I think it does make sense that the sitebuilder could hide the payment information panel from the checkout flow via config, doing so causes breakage in the commerce_paypal module, so having said that I am thinking it is commerce_paypal's responsibility to deal with this scenario
but It's worth communicating it.
Comment #9
thursday_bw commented