I think the function getOrder in file catalog/model/checkout/order.php should use a database query like this (my changes are highlighted in red) in OpenCart 1.3.4:
public function getOrder($order_id) {
$query = $this->db->query("SELECT *, c1.iso_code_2 AS shipping_iso_code_2, c1.iso_code_3 AS shipping_iso_code_3, c2.iso_code_2 AS payment_iso_code_2, c2.iso_code_3 AS payment_iso_code_3, z1.code AS shipping_zone_code, z2.code AS payment_zone_code FROM `" . DB_PREFIX . "order` o LEFT JOIN " . DB_PREFIX . "country c1 ON (o.shipping_country_id = c1.country_id) LEFT JOIN " . DB_PREFIX . "country c2 ON (o.payment_country_id = c2.country_id) LEFT JOIN " . DB_PREFIX . "zone z1 ON (o.shipping_zone_id = z1.zone_id) LEFT JOIN " . DB_PREFIX . "zone z2 ON (o.payment_zone_id = z2.zone_id) WHERE o.order_id = '" . (int)$order_id . "'");
return $query->row;
}
The original query delivered the wrong values for:
shipping_iso_code_3
shipping_zone_code
putting the values from the payment address instead of from the shipping address into these fields.
This in turn broke the SagePay Direct (which calls the getOrder) when the customer's payment address is from the UK, while his shipping address is in the USA.
shipping_iso_code_3
shipping_zone_code
putting the values from the payment address instead of from the shipping address into these fields.
This in turn broke the SagePay Direct (which calls the getOrder) when the customer's payment address is from the UK, while his shipping address is in the USA.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Who is online
Users browsing this forum: No registered users and 8 guests