I have a some dropdown fields on on my commerce checkout page where the key is different than the value. I need this to be the case, because at checkout completion, I am submitting the values to an external database, and it expects the key value, not the display value.

However, I've found that the review page is listing the values (which is an uninteligble code and therefore useless to the user). I have not found a way to change this. If you inspect the array building the review page, it contains an array element 'data' which stores all the markup, and I see no way of modifying the display.

How can I display the dropdown keys on the review page?

EDIT: To perhaps make this a little eaiser: by backtracing, I found that this function

customer_profile_type_ui/includes/customer_profile_type_ui.checkout_pane.inc:74:function customer_profile_type_ui_pane_review($form, $form_state, $checkout_pane, &$order) {

was calling this one

commerce/modules/customer/includes/commerce_customer.checkout_pane.inc:315:function commerce_customer_profile_pane_review($form, $form_state, $checkout_pane, $order) {

If you examine the code there, you will see that the review pane is being populated directly from the profile object, and the profile object is only storing the values (which makes sense). So, is there any way for me to obtain the keys?


You could use


and set a different 'review' callback for the relevant checkout pane.

You can then control the output from your review callback.

See hook_commerce_checkout_pane_info for the option detail there.

You could also try theming the review page with

  • THEME_NAME_preprocess_commerce_checkout_review(&$variables) {} or
  • THEME_NAME_commerce_checkout_review(&$variables) {}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.