Well the catalog view won't work as that is very much hardcoded to pp_standard.tpl
Actually, that I've already pretty much addressed in all of my payment modules. Instead of listing them out like the core ones:
Code: Select all
<form action="<?php echo $action; ?>" method="post" id="checkout">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="<?php echo $business; ?>" />
<input type="hidden" name="item_name" value="<?php echo $item_name; ?>" />
<input type="hidden" name="currency_code" value="<?php echo $currency_code; ?>" />
....
</form>
I use a simple array in the payment controller:
Code: Select all
$this->data['fields'] = array();
$this->data['fields']['cmd'] = '_cart';
$this->data['fields']['upload'] = '1';
$this->data['fields']['business'] = $this->config->get('pp_standard_email');
$this->data['fields']['currency_code'] = $currency;
And then a simple for loop in the tpl:
Code: Select all
<form action="<?php echo $action; ?>" method="post" id="checkout">
<?php foreach ($fields as $key => $value) { ?>
<input type="hidden" name="<?php echo $key; ?>" value="<?php echo $value; ?>" />
<?php } ?>
</form>
I used this template for ALL my payment modules except the ones that collect credit card data onsite, which i have a slightly different template. Tho with some simple changes the same template could be used for both.
And call it personal preference.... But I CAN'T STAND comments like this:
Code: Select all
/**
* Module name
*
* @var protected string $modulename
*/
protected $modulename;
/**
* Class constructor
*
* Determines current module name
*/
public function __construct() {
$this->modulename = basename(__FILE__, '.php');
}
It makes me want to jab a fork in my eye. I know it is popular but it is absolutely horrendous.
What is wrong with a cleaner method:
Code: Select all
//Module name
protected $modulename;
//Class constructor. Determines current module name
public function __construct() {
$this->modulename = basename(__FILE__, '.php');
}
even multiline comments looks much cleaner with:
Code: Select all
//Module name
//This is the name of the module
protected $modulename;
//Class constructor. Determines current module name
public function __construct() {
$this->modulename = basename(__FILE__, '.php');
}
Nobody should be that friendly with the asterisk key as php devs are