
catalog/controller/extension/feed/myfeed.php
Code: Select all
class ControllerExtensionFeedMyFeed extends Controller {
public function index() {
...
...
$filter_data = array(
'filter_manufacturer_id' => 12,
'filter_quantity' => 1
);
$products = $this->model_catalog_product->getProducts($filter_data);
foreach ($products as $product) {
....
}
}
}
Code: Select all
public function getProducts($data = array()) {
...
...
if (!empty($data['filter_manufacturer_id'])) {
$sql .= " AND p.manufacturer_id = '" . (int)$data['filter_manufacturer_id'] . "'";
}
if (!empty($data['filter_quantity'])) {
$sql .= " AND p.quantity = '" . (int)$data['filter_quantity'] . "'";
}
}
"filter_quantity" - Fail, write all products with quantity ( 0,1,2 ... )
Thanks for help. Jozef