1
Answers
Vote up!
0
Vote down!

Checkout-review tab

Hi there !!

How can i remove the checkout review tab pattern and replace it by div and stuff ?
I've tried to edit commerce_checkout_progress.module but I did not find the "review" lines ...

I'm not a great php dev, i'm pretty bad actually ... So if you know the answer, try to be "educationalist" (don't know if it's the correct translate... I'm french :D ).

Thx !! :D

Asked by: MrCastor
on January 29, 2014

1 Answer

Vote up!
0
Vote down!

I find it !! : (profiles/commerce_kickstart/modules/contrib/commerce/modules/checkout/includes/commerce_checkout.pages.inc) <- paste into my subtheme template.php

/**
* Themes the optional checkout review page data.
*/
function theme_commerce_checkout_review($variables) {
$form = $variables['form'];

// Turn the review data array into table rows.
$rows = array();

foreach ($form['#data'] as $pane_id => $data) {
// First add a row for the title.
$rows[] = array(
'data' => array(
array('data' => $data['title'], 'colspan' => 2),
),
'class' => array('pane-title', 'odd'),
);

// Next, add the data for this particular section.
if (is_array($data['data'])) {
// If it's an array, treat each key / value pair as a 2 column row.
foreach ($data['data'] as $key => $value) {
$rows[] = array(
'data' => array(
array('data' => $key .':', 'class' => array('pane-data-key')),
array('data' => $value, 'class' => array('pane-data-value')),
),
'class' => array('pane-data', 'even'),
);
}
}
else {
// Otherwise treat it as a block of text in its own row.
$rows[] = array(
'data' => array(
array('data' => $data['data'], 'colspan' => 2, 'class' => array('pane-data-full')),
),
'class' => array('pane-data', 'even'),
);
}
}

return theme('table', array('rows' => $rows, 'attributes' => array('class' => array('checkout-review'))));
}

Only one problem left : how can i get divs with specific class instead of table, tr and td ?
I can't read php ...

Answer by: MrCastor
Posted: Jan 31, 2014