Skip to content

Commit

Permalink
price rule and country fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GytisZum committed Dec 20, 2023
1 parent 897170f commit f523bc4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Repository/PriceRuleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function getByCarrierReference(
);

/* param needed to filter out by countries to get specific price rules for that country address */
if ($includeCountryCheck) {
if ($includeCountryCheck && $deliveryAddress->id_country) {
$query->innerJoin(
'dpd_price_rule_zone',
'prz',
Expand All @@ -105,10 +105,10 @@ public function getByCarrierReference(
'prz.`id_dpd_zone` = zr.`id_dpd_zone`'
);

$query->where('zr.`id_country`= ' . $deliveryAddress->id_country);
$query->where('zr.`id_country`= ' . (int) $deliveryAddress->id_country);
}

$query->where('prc.`id_reference`="' . (int)$carrierReference . '" OR prc.`all_carriers`="1"');
$query->where('prc.`id_reference`="' . (int) $carrierReference . '" OR prc.`all_carriers`="1"');
$query->where('pr.active = 1');
$query->orderBy('pr.position ASC');

Expand Down

0 comments on commit f523bc4

Please sign in to comment.