Skip to content

Commit 805a4ab

Browse files
committed
VERSION 3.2.2
1 parent e4d2b68 commit 805a4ab

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

catalog/model/payment/paypal.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,31 @@ public function hasProductInCart(int $product_id, array $option = [], int $subsc
121121
}
122122

123123
public function getCountry(int $country_id): array {
124-
$query = $this->db->query("SELECT *, c.name FROM `" . DB_PREFIX . "country` c LEFT JOIN `" . DB_PREFIX . "address_format` af ON (`c`.`address_format_id` = `af`.`address_format_id`) WHERE `c`.`country_id` = '" . (int)$country_id . "' AND `c`.`status` = '1'");
125-
124+
if (version_compare(VERSION, '4.1.0.1', '>=')) {
125+
$query = $this->db->query("SELECT *, cd.name FROM " . DB_PREFIX . "country c LEFT JOIN " . DB_PREFIX . "country_description cd ON (c.country_id = cd.country_id) LEFT JOIN " . DB_PREFIX . "address_format af ON (c.address_format_id = af.address_format_id) WHERE c.country_id = '" . (int)$country_id . "' AND cd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND c.status = '1'");
126+
} else {
127+
$query = $this->db->query("SELECT *, c.name FROM " . DB_PREFIX . "country c LEFT JOIN " . DB_PREFIX . "address_format af ON (c.address_format_id = af.address_format_id) WHERE c.country_id = '" . (int)$country_id . "' AND c.status = '1'");
128+
}
129+
126130
return $query->row;
127131
}
128132

129133
public function getCountryByCode(string $code): array {
130-
$query = $this->db->query("SELECT *, c.name FROM " . DB_PREFIX . "country c LEFT JOIN " . DB_PREFIX . "address_format af ON (c.address_format_id = af.address_format_id) WHERE c.iso_code_2 = '" . $this->db->escape($code) . "' AND c.status = '1'");
134+
if (version_compare(VERSION, '4.1.0.1', '>=')) {
135+
$query = $this->db->query("SELECT *, cd.name FROM " . DB_PREFIX . "country c LEFT JOIN " . DB_PREFIX . "country_description cd ON (c.country_id = cd.country_id) LEFT JOIN " . DB_PREFIX . "address_format af ON (c.address_format_id = af.address_format_id) WHERE c.iso_code_2 = '" . $this->db->escape($code) . "' AND cd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND c.status = '1'");
136+
} else {
137+
$query = $this->db->query("SELECT *, c.name FROM " . DB_PREFIX . "country c LEFT JOIN " . DB_PREFIX . "address_format af ON (c.address_format_id = af.address_format_id) WHERE c.iso_code_2 = '" . $this->db->escape($code) . "' AND c.status = '1'");
138+
}
131139

132140
return $query->row;
133141
}
134142

135143
public function getZoneByCode(int $country_id, string $code): array {
136-
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone WHERE country_id = '" . (int)$country_id . "' AND (code = '" . $this->db->escape($code) . "' OR name = '" . $this->db->escape($code) . "') AND status = '1'");
144+
if (version_compare(VERSION, '4.1.0.1', '>=')) {
145+
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone z LEFT JOIN " . DB_PREFIX . "zone_description zd ON (z.zone_id = zd.zone_id) WHERE z.country_id = '" . (int)$country_id . "' AND zd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND (z.code = '" . $this->db->escape($code) . "' OR zd.name = '" . $this->db->escape($code) . "') AND z.status = '1'");
146+
} else {
147+
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone z WHERE z.country_id = '" . (int)$country_id . "' AND (z.code = '" . $this->db->escape($code) . "' OR z.name = '" . $this->db->escape($code) . "') AND z.status = '1'");
148+
}
137149

138150
return $query->row;
139151
}

install.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "PayPal",
33
"code": "paypal",
44
"license": "GPL",
5-
"version": "3.2.1",
5+
"version": "3.2.2",
66
"author": "Dreamvention",
77
"link": "https://dreamvention.com/"
88
}

system/config/paypal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
$_['paypal_setting'] = [
3-
'version' => '3.2.1',
3+
'version' => '3.2.2',
44
'partner' => [
55
'production' => [
66
'partner_id' => 'TY2Q25KP2PX9L',

0 commit comments

Comments
 (0)