Skip to content

Commit 7319b02

Browse files
committed
Fix bug.
1 parent ee00afa commit 7319b02

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

model/store/product.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function getProductRelated($product_id, $limit = 4)
2323
'sort' => '',
2424
'order' => '',
2525
'start' => 0
26-
)
26+
)
2727
);
2828
}
2929

@@ -32,7 +32,7 @@ public function getProductImages($product_id)
3232
$product = new Product($product_id, true, $this->context->language->id, $this->context->shop->id);
3333

3434
$images = Db::getInstance()->ExecuteS(
35-
'SELECT `id_image` FROM `' . _DB_PREFIX_ . 'image` WHERE `id_product` = ' . (int) ($product_id)
35+
'SELECT `id_image` FROM `' . _DB_PREFIX_ . 'image` WHERE `id_product` = ' . (int)($product_id)
3636
);
3737
foreach ($images as $key => $image_id) {
3838
$images[$key]['image'] = $this->context->link->getImageLink(
@@ -127,14 +127,14 @@ public function getProducts($data = array())
127127
$sql->leftJoin('product_shop', 'ps', 'ps.`id_product` = p.`id_product`');
128128
$sql->leftJoin('product_lang', 'pl', 'pl.`id_product` = p.`id_product`');
129129
$sql->where('p.`active` = 1');
130-
$sql->where('pl.`id_lang` = ' . (int) $this->context->language->id);
130+
$sql->where('pl.`id_lang` = ' . (int)$this->context->language->id);
131131

132132
if (!empty($data['filter_category_id']) && $data['filter_category_id'] > 0) {
133-
$sql->where('p.`id_category_default` = ' . (int) $data['filter_category_id']);
133+
$sql->where('p.`id_category_default` = ' . (int)$data['filter_category_id']);
134134
}
135135

136136
if (!empty($data['filter_ids'])) {
137-
$sql->where('p.`id_product` IN ' . "('" . implode("','", (int)$data['filter_ids']) . "')");
137+
$sql->where('p.`id_product` IN ' . "('" . pSQL(implode("','", $data['filter_ids'])) . "')");
138138
}
139139

140140
if (!empty($data['filter_special'])) {
@@ -143,9 +143,9 @@ public function getProducts($data = array())
143143

144144
if (!empty($data['filter_search'])) {
145145
$sql->where("pl.`name` LIKE '%" .
146-
pSQL($data['filter_search']) . "%' OR pl.description LIKE '%" .
147-
pSQL($data['filter_search']) . "%' OR pl.description_short LIKE '%" .
148-
pSQL($data['filter_search']) . "%'");
146+
pSQL($data['filter_search']) . "%' OR pl.description LIKE '%" .
147+
pSQL($data['filter_search']) . "%' OR pl.description_short LIKE '%" .
148+
pSQL($data['filter_search']) . "%'");
149149
}
150150

151151
$sql->orderBy($sort . ' ' . $data['order']);
@@ -166,13 +166,13 @@ public function getTotalProducts($data = array())
166166
$sql->leftJoin('product_shop', 'ps', 'ps.`id_product` = p.`id_product`');
167167
$sql->leftJoin('product_lang', 'pl', 'pl.`id_product` = p.`id_product`');
168168
$sql->where('p.`active` = 1');
169-
$sql->where('pl.`id_lang` = ' . (int) $this->context->language->id);
169+
$sql->where('pl.`id_lang` = ' . (int)$this->context->language->id);
170170

171171
if (!empty($data['filter_category_id']) && $data['filter_category_id'] > 0) {
172-
$sql->where('p.`id_category_default` = ' . (int) $data['filter_category_id']);
172+
$sql->where('p.`id_category_default` = ' . (int)$data['filter_category_id']);
173173
}
174174
if (!empty($data['filter_product_ids'])) {
175-
$sql->where('p.`id_product` IN ' . "('" . implode("','", (int)$data['filter_product_ids']) . "')");
175+
$sql->where('p.`id_product` IN ' . "('" . pSQL(implode("','", $data['filter_product_ids'])) . "')");
176176
}
177177

178178
if (!empty($data['filter_special'])) {
@@ -185,9 +185,9 @@ public function getTotalProducts($data = array())
185185

186186
if (!empty($data['filter_search'])) {
187187
$sql->where("pl.`name` LIKE '%" .
188-
pSQL($data['filter_search']) . "%' OR pl.description LIKE '%" .
189-
pSQL($data['filter_search']) . "%' OR pl.description_short LIKE '%" .
190-
pSQL($data['filter_search']) . "%'");
188+
pSQL($data['filter_search']) . "%' OR pl.description LIKE '%" .
189+
pSQL($data['filter_search']) . "%' OR pl.description_short LIKE '%" .
190+
pSQL($data['filter_search']) . "%'");
191191
}
192192

193193
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);

0 commit comments

Comments
 (0)