Skip to content

Instantly share code, notes, and snippets.

@deivisonarthur
Created July 21, 2012 17:44
Show Gist options
  • Save deivisonarthur/3156529 to your computer and use it in GitHub Desktop.
Save deivisonarthur/3156529 to your computer and use it in GitHub Desktop.
Boleto Magento cód 05
<!-- Deivison -->
<?php
/* Original comentado
if ($e->source_model) {
// determine callback for the source model
$factoryName = (string)$e->source_model;
$method = false;
if (preg_match('/^([^:]+?)::([^:]+?)$/', $factoryName, $matches)) {
array_shift($matches);
list($factoryName, $method) = array_values($matches);
}
$sourceModel = Mage::getSingleton($factoryName);
if ($sourceModel instanceof Varien_Object) {
$sourceModel->setPath($path);
}
if ($method) {
if ($fieldType == 'multiselect') {
$optionArray = $sourceModel->$method();
} else {
$optionArray = array();
foreach ($sourceModel->$method() as $value => $label) {
$optionArray[] = array('label' => $label, 'value' => $value);
}
}
} else {
$optionArray = $sourceModel->toOptionArray($fieldType == 'multiselect');
}
$field->setValues($optionArray);
}
*/
/*Colocar esse no lugar*/
if ($e->source_model) {
$sourceModel = Mage::getSingleton((string)$e->source_model);
if ($sourceModel instanceof Varien_Object) {
$sourceModel->setPath($path);
}
if(is_object($sourceModel)){
$field->setValues($sourceModel->toOptionArray($fieldType == 'multiselect'));
} else {
Mage::log($e->source_model);
}
}
?>
<!-- Deivison -->
Para não apresentar o erro ao entrar em meios de pagamentos na adm
8º – Ao entrar em métodos de pagamentos na administração do Magento, provavelmente ele apresentará o erro: Fatal error: Call to a member fun in app/code/core/Mage/Adminhtml/Block/System/Config/Form.php on line 427
É necessário trocar parte do código que esta em app/code/core/Mage/Adminhtml/Block/System/Config/Form.php on line 427
como no tutorial em http://www.9764.in/Index/read/qid/302835
Coloque aqui o cód acima BoletoMagento05.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment