This patch replaces the commerce_bank_transfer_bank_details() function with a theme function that can be more easily overridden.

Comments

hadsie’s picture

StatusFileSize
new2.56 KB
hadsie’s picture

StatusFileSize
new2.71 KB

This patch can be successfully applied after the patch in #1676822: Token support for payment instructions field

ziobudda’s picture

Hi and thanks for the patch, but why do not use an hook_* before theme() function ? In this way not only the template can change Bank transfer data but other modules have the possibility to change data.

Think to a market place where all "seller" can specify them data bank account. If I can work at "module" level I have a better usability (for developer) than the template level.

I think that a line like this

drupal_alter('commerce_bank_transfer', $oid, $pm);

writed at the first line of commerce_bank_transfer_bank_details() function can be the best thing.

And this is the little function for test:

function zbc_commerce_bank_transfer_alter(&$oid, &$data) {
  
  //If I need I can read entire order : 
  //$order = commerce_order_load($oid);
  
  //Alter $pm data
  //....
  // like 
  $data['settings']['details']['account_owner'] = "I'm a value from profile SELLER";
}

M.