| @@ 768-772 (lines=5) @@ | ||
| 765 | { |
|
| 766 | $ret = array(); |
|
| 767 | $criteria = new CriteriaCompo(); |
|
| 768 | if (is_array($product_id)) { |
|
| 769 | $criteria->add(new Criteria('attribute_product_id', '(' . implode(',', $product_id) . ')', 'IN')); |
|
| 770 | } else { |
|
| 771 | $criteria->add(new Criteria('attribute_product_id', $product_id, '=')); |
|
| 772 | } |
|
| 773 | if (is_array($attributesIds) && count($attributesIds) > 0) { |
|
| 774 | $criteria->add(new Criteria('attribute_id', '(' . implode(',', array_keys($attributesIds)) . ')', 'IN')); |
|
| 775 | } |
|
| @@ 761-765 (lines=5) @@ | ||
| 758 | if (Oledrion_utils::getModuleOption('nostock_display') == 0) { // Se limiter aux seuls produits encore en stock |
|
| 759 | $criteria->add(new Criteria('product_stock', 0, '>')); |
|
| 760 | } |
|
| 761 | if (is_array($category)) { |
|
| 762 | $criteria->add(new Criteria('product_cid', '(' . implode(',', $category) . ')', 'IN')); |
|
| 763 | } elseif ($category > 0) { |
|
| 764 | $criteria->add(new Criteria('product_cid', (int)$category, '=')); |
|
| 765 | } |
|
| 766 | if ($excludedProduct > 0) { |
|
| 767 | $criteria->add(new Criteria('product_id', $excludedProduct, '<>')); |
|
| 768 | } |
|