Fixed a segfault (Reproducable with PHP 5.3 and PHP 5.4)

- Fixed segmentation fault -> Assoc array was given to DB select. We need only the keys.
- Fixed TODO: Used constants insteat of hard coded values for visibility
- Removed unused $productIndexes variable