0

i use drupal 7 with Commerce module installed. I am searching a couple days to find out a way to change (alter) the presentation (theme) of Checkout page. I mean the first page that someone visit after pressing Checkout button. (Not the review or payment pages).

What is trying to do, is to have only the cart contents on top and below that i want to create a tab system with the following tabs:

  • Login
  • Create Account
  • Complete checkout as a guest

So i need to hide the billing or shipping or any other pane and make them visible only on the third tab.

I think i have some pieces of the puzzle, for example i have tried creating a custom module and playing with hook_commerce_checkout_pane_info_alter to unset some panes and hook_form_commerce_checkout_form_alter to create panes programmatically but i am lost in space...

Another puzzle piece, is the php code of the login form for the first tab(Login) for example:

<?php 
   $elements = drupal_get_form("user_login"); 
   $form = drupal_render($elements);
   echo $form;
?>

I may need your help to make things clearer. I need to reorder panes, add some custom html and javascript to create the tab system and bring some forms there. Where is this canvas, the template that loads everything so to bypass that and create my own ? Where do i have to look, search and study ?

Thank you :)

0

In a custom module you can change the theme like this:

function YOUR_MODULE_custom_theme() {
  if (current_path() == 'checkout') {
    return 'plain';
  }
}

With this approach you need a full new theme (in the above example named plain). You then can directly use it's page.tpl.php. In template_preprocess_page you could add javascript and fill variables with your html (or blocks).

Also you can place the blocks like you want for this theme.

To get the correct current_path you would need to debug a lil. checkout is just guessed by me ..

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.