Hi All!
Not sure if this is a problem at all, but i've faced this once applying a checkout totals.
Each of totals has it's sort order which is adjusted in the admin panel.
But this may not affect the actual order of totals being applied to the final value.
Code: Select all
$results = $this->model_checkout_extension->getExtensions('total');
foreach ($results as $result) {
$this->load->model('total/' . $result['key']);
$this->{'model_total_' . $result['key']}->getTotal($total_data, $total, $taxes);
}
Code: Select all
class ModelCheckoutExtension extends Model {
function getExtensions($type) {
$query = $this->db->query("SELECT * FROM extension WHERE `type` = '" . $this->db->escape($type) . "'");
return $query->rows;
}
}
So the order of totals list depends not on the actual sort order, but on the way how the list of total extensions is being retrieved from the base.
My problem was that the shipping was not applied to final total, because it's extenision's ID was higher than the final's one.
So:
1) Total's ID changed to the higher value in the database
2)
Code: Select all
class ModelCheckoutExtension extends Model {
function getExtensions($type) {
$query = $this->db->query( "SELECT * FROM extension WHERE `type` = '" . $this->db->escape($type) . "' ORDER BY extension_id ASC" );
return $query->rows;
}
}
P.S. I've been fixing a store made not by me and had a little time, so I'm not sure about OC's version (some kind of 1.2.* i guess)
and not sure that something is not going wrong after my interruption.
Also this problem may be fixed already, not sure
THANKS!