Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $productIDs = array();
- foreach($this->theVariables['products'] as $product) {
- $productIDs[] = $product['productID'];
- }
- $strSQL = 'SELECT
- DISTINCT(technical_data_values.name) AS value, technical_data_types.name AS type,
- technical_data_values.value_id, technical_data_values.type_id
- FROM product_has_technical_data_values
- INNER JOIN technical_data_values
- ON technical_data_values.value_id = product_has_technical_data_values.value_id
- INNER JOIN technical_data_types
- ON technical_data_types.type_id = technical_data_values.type_id
- WHERE product_id
- IN(' . implode(', ', $productIDs) . ')
- ORDER BY technical_data_types.name, technical_data_values.name';
- $runSQL = $dbA->query($strSQL);
- ?>
- <script>
- $(document).ready(function() {
- var checked = new String();
- $('.filter-data').change(function() {
- if($(this).attr('checked')) {
- $('.product-overview').fadeOut(150);
- checked += '.' + $(this).attr('id');
- filter();
- } else {
- checked = checked.replace('.' + $(this).attr('id'), '');
- filter();
- }
- });
- function filter() {
- checked.length > 0 ? $(checked).fadeIn(100) : $('.product-overview').fadeIn(250);
- }
- });
- </script>
- <?php if($dbA->count($runSQL) > 0) { ?>
- <div class="right-box">
- <h2>Narrow Your Search</h2>
- <?php
- while($row = $dbA->fetch($runSQL)) {
- echo $row['type'] !== $lastType ? '<h3 style="padding: 4px; padding-top: 20px;">' . $row['type'] . '</h3>' . "\n" : '';
- $lastType = $row['type'];
- ?>
- <input class="filter-data" type="checkbox" id="tdt<?php echo $row['type_id']; ?>v<?php echo $row['value_id']; ?>"> <?php echo $row['value']; ?> <br />
- <?php } ?>
- </div>
- <?php
- }
- ?>
Add Comment
Please, Sign In to add comment