summaryrefslogtreecommitdiffstats
path: root/commerce_search_api_et.install
blob: 564a89628f3d7e75df0ba47db56325069b38375e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
 * @file
 * commerce_search_api_et.install
 */

/**
 * Implements hook_install().
 *
 * @see commerce_kickstart_search_install()
 */
function commerce_search_api_et_install() {
  drupal_static_reset();
  $default_theme = variable_get('theme_default', 'omega_kickstart');
  _block_rehash($default_theme);
  try {
    // Put the search block in the branding region.
    db_update('block')
      ->fields(array(
        'region' => 'branding',
        'status' => (int) '1',
      ))
      ->condition('module', 'views')
      ->condition('delta', '3dc7fa29e5bf935c0dbc271fbe9e7bbc')
      ->condition('theme', $default_theme)
      ->execute();
    // Put the facets blocks in the right place.
    db_update('block')
      ->fields(array(
        'region' => 'sidebar_first',
        'pages' => 'products',
        'visibility' => BLOCK_VISIBILITY_LISTED,
        'status' => (int) '1',
      ))
      ->condition('module', 'facetapi')
      ->condition('delta', '0', '<>')
      ->condition('theme', $default_theme)
      ->execute();
    // Set the Price facet block weight.
    db_update('block')
      ->fields(array(
        'title' => 'Price',
        'weight' => '-1',
      ))
      ->condition('module', 'facetapi')
      ->condition('delta', 'JJxX1AGk0T8LaEseJt5QjNvJU0laclrM')
      ->condition('theme', $default_theme)
      ->execute();
  }
  catch (Exception $e) {
    watchdog_exception('block', $e);
    throw $e;
  }
}