21 \
Magento\Quote\Model\Quote\Address\RateRequest $request
33 'website_id = :website_id' 35 [
'dest_country_id DESC',
'dest_region_id DESC',
'dest_zip DESC',
'condition_value DESC']
41 $orWhere =
'(' . implode(
44 "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = :postcode",
45 "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = ''",
48 "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = '*'",
49 "dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = '*'",
50 "dest_country_id = '0' AND dest_region_id = :region_id AND dest_zip = '*'",
51 "dest_country_id = '0' AND dest_region_id = 0 AND dest_zip = '*'",
52 "dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = ''",
53 "dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = :postcode",
54 "dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = '*'" 60 if (is_array($this->request->getConditionName())) {
62 foreach (range(0, count($this->request->getConditionName())) as $conditionNumber) {
63 $bindNameKey = sprintf(
':condition_name_%d', $conditionNumber);
64 $bindValueKey = sprintf(
':condition_value_%d', $conditionNumber);
65 $orWhere[] =
"(condition_name = {$bindNameKey} AND condition_value <= {$bindValueKey})";
69 $select->where(implode(
' OR ', $orWhere));
72 $select->where(
'condition_name = :condition_name');
73 $select->where(
'condition_value <= :condition_value');
84 ':website_id' => (int)$this->request->getWebsiteId(),
85 ':country_id' => $this->request->getDestCountryId(),
86 ':region_id' => (int)$this->request->getDestRegionId(),
87 ':postcode' => $this->request->getDestPostcode(),
91 if (is_array($this->request->getConditionName())) {
93 foreach ($this->request->getConditionName() as $conditionName) {
94 $bindNameKey = sprintf(
':condition_name_%d',
$i);
95 $bindValueKey = sprintf(
':condition_value_%d',
$i);
96 $bind[$bindNameKey] = $conditionName;
97 $bind[$bindValueKey] = $this->request->getData($conditionName);
101 $bind[
':condition_name'] = $this->request->getConditionName();
102 $bind[
':condition_value'] = round($this->request->getData($this->request->getConditionName()), 4);
113 return $this->request;
prepareSelect(\Magento\Framework\DB\Select $select)
__construct(\Magento\Quote\Model\Quote\Address\RateRequest $request)