Hi,

how do i show the selected payment method on the review page?
is that possible? I checked the extra pane module for inspiration but i didn't get it to work.

In Germany it is important to see the payment method on review, so ... any Ideas? :)

Thanks a lot,
Tobi

Comments

rszrama’s picture

Why can't you use the default configuration which includes the Payment checkout pane on the Review page? This is actually quite important if you're offering any sort of on-site payment, though I suppose for off-site payment methods it shouldn't matter (since redirect doesn't happen until after the Review page is submitted).

The selected payment method is purely stored in $order->data['payment_method'] I think. You'd need a custom checkout pane for that... maybe it's something we can work into the review callback for the core payment pane.

forward-media’s picture

StatusFileSize
new43.2 KB

I Use off site payment and have a one page checkout, cart, billing, shipping, terms and conditions and payment method is on one site. after insert all informations in germany we have to check that everything is ok before submit the order and pay.

i have a screen for you so that you know how i mean it.

What i now try is: make a module that insert a pane only on the review page witch shows the payment method.

forward-media’s picture

For all these who want to know how i solved this.

i wrote a small module for this, here is the code:

that is the .module code, for more information please ask:

/**
 * Implements hook_theme().
 */
function commerce_bonus_theme($existing, $type, $theme, $path) {
  return array(
    'commerce_bonus_review' => array(
      'render element' => 'elements',
      'path' => drupal_get_path('module', 'commerce_bonus') . '/theme',
      'template' => 'commerce_bonus_review',
    ),
  );
}

/**
 * Implements hook_commerce_checkout_pane_info()
 */
function commerce_bonus_commerce_checkout_pane_info() {
  $panes['commerce_bonus'] = array(
    'title' => t('Payment method'),
    'page' => 'review',
    'weight' => 10,
    'file' => 'includes/commerce_bonus.checkout_pane.inc',
    'base' => 'commerce_bonus_pane',
  );
  return $panes;
}

Here the .inc file:

<?php 

/**
 * Checkout pane callback: returns the cart contents review data for the
 *   Review checkout pane.
 */
function commerce_bonus_pane_review($form, $form_state, $checkout_pane, $order) {
  $payment_method = commerce_payment_method_load(substr($order->data['payment_method'], 0, strpos($order->data['payment_method'], '|', 0)));
  return theme('commerce_bonus_review', array('order' => $order, 'payment' => $payment_method));
}

and here is the theme file:

<?php

/**
 * @file
 * Custom tpl that displays the entity in the review phase.
 */
?>
<div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
  <?php
    print $payment['title'];
  ?>
</div>

hope i could help someone.

Prague man’s picture

Thank you very much! :-)

jimkont’s picture

This is great! thanks!

Is it possible to have this information displayed in the order view/edit form

we have 2 separate offline payment methods
a bank transer option and one to pay the order on the delivery with the postal office (a very simple clone of the example payment module)
when the store admin processes the order he cannot tell which one the user selected

Thanks,
Dimitris

essbee’s picture

Hmmm I'm not getting anything displaying using this method - the template file isnt being called.
What should that file be named?

Cheers,
Sam

essbee’s picture

Hmm just had to move the pane from Review order to Checkout page and then it display - on the Review order page. A little counter intuitive but meh it works.

rszrama’s picture

Yeah, you're dealing with two different things. To have the payment method selected show up on the review pane, there first has to be a selection, which is why it shows on review if you place it on the initial page.

essbee’s picture

But I have two panes, "Payment" which is the pane offering the choice of payment options. Then a second pane "Paymnt Method" that simply displas (per above) the method selected.

I have them both on the Checkout page, but Payment shows on Checkout and Payment Method displays on the Review page.

Either way it works so its all good!

rszrama’s picture

Ok, interesting. I'll see what patch can finally make it in so it's less confusing. : )

zambrey’s picture

Is it possible to get payment settings by some api function?
For example I want to display bank details on review pane but all bank settings are stored in rules configuration. commerce_payment_method_load() doesn't receive that.

I figured out that I can just do some db_query from {rules_config} table and grab data from there but I was just wondering if there's api function that will do this for me? :)

rszrama’s picture

You'd use commerce_payment_method_instance_load() instead and the settings array will be populated.

zambrey’s picture

Many thanks! I couldn't find it myself.

sixelats’s picture

@forward-media Thanks for sharing, just what I was looking for!

My 2 cents to help less experienced users (as myself) to convert the code in a working module:

1. create a folder named commerce_bonus and two subfolders in it named theme and includes
2. create a file commerce_bonus.module in commerce bonus folder and put the code for .module
3. create a file commerce_bonus.checkout_pane.inc in folder commerce_bonus/includes and put the code for .inc
4. create a file commerce_bonus_review.tpl.php in folder commerce_bonus/theme and put the code for the theme file
5. create a file commerce_bonus.info and put the following code in it

; $Id$
name = Commerce Bonus
description = Show payment method on checkout review page
core = 7.x
package = Commerce (Contrib)
dependencies[] = commerce
dependencies[] = commerce_payment

files[]=includes/commerce_bonus.checkout_pane.inc

6. Upload and enable it as any other module
7. Go to Store > Configuration > Checkout settings and move both Payment and Payment Method panes to Checkout page (thanks @essbee).

forward-media’s picture

Thank's sixelats! Perfekt!

CanOne’s picture

Hm tried it twice and followed the instructions from sixelats (#14) but its still not showing the payment method?!

EDIT: I moved the pane to different places..and I cleared the cache multiple times.

EDIT2: Don´t know what happend but its workin now :) Cheers!

ndf’s picture

Hi all,

Created sandbox module with the code from Forward Media and Sixelats.

http://drupal.org/sandbox/nielsdefeyter/1710056

Called this module Commerce Checkout Pane Payment (commerce_checkout_pane_payment).
On the module page there is an explanation howto create a new checkout-page 'choose payment method' with an other contrib-module 'Commerce Checkout Pages'.

falc0shka’s picture

How can i display another fields like credit card number, that had typed on payment checkout page?
Thanks.

rszrama’s picture

You can't, because that information is sent immediately to the payment gateway and not stored server side for security reasons.

forward-media’s picture

The credit card number should NEVER touch your system!!

carsteng’s picture

Hmm I'm using Novalnet Payment method.... So when I put payment info on checkout page or own payment page. After Submit (next Step) the payment is done... no chance to see review page.
Any Tips? Very important that payment is only handled when I click on submit on review page. And on review page I wanna see what payment I have selected one or two steps earlier.

rszrama’s picture

Component: Checkout » Payment
Category: Support request » Feature request
Issue summary: View changes
Status: Active » Needs review
Issue tags: +sprint
StatusFileSize
new2.4 KB

Found this issue, figured it'd be easy enough to add as a core checkout pane callback.

Patch attached.

rszrama’s picture

Status: Needs review » Fixed

Aaaaand committed.

  • rszrama committed 3c852ff on 7.x-1.x
    Issue #1302232 by rszrama: add a review callback for the core Payment...

Status: Fixed » Closed (fixed)

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

jcisio’s picture

Category: Feature request » Bug report
Status: Closed (fixed) » Active

Sorry to reopen (I'm not sure if I should open new issue). commerce_payment_update_7103() is broken because commerce_checkout is not a dependency of commerce_payment. I run into the error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xxx.commerce_checkout_pane' doesn't exist

jcisio’s picture

Status: Active » Needs review
StatusFileSize
new800 bytes
rszrama’s picture

Category: Bug report » Feature request
Status: Needs review » Closed (fixed)
mirondi’s picture

StatusFileSize
new1.76 KB
mirondi’s picture

mirondi’s picture