Skip to content

Instantly share code, notes, and snippets.

View christianschoenmakers's full-sized avatar

Christian Schoenmakers christianschoenmakers

  • Tilburg, Netherlands
View GitHub Profile
@christianschoenmakers
christianschoenmakers / 0_reuse_code.js
Created March 8, 2017 15:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@christianschoenmakers
christianschoenmakers / gist:ad3713a6336a7b2dcc31da71fecefec5
Created September 1, 2018 08:41
FacetWP - only index product variations
// Facet WP - Only index variations and added hook to append main product data to variation product data
add_filter( 'facetwp_indexer_query_args', function( $args ) {
$args['post_type'] = array('product_variation');
return $args;
});
@christianschoenmakers
christianschoenmakers / .php
Created September 1, 2018 08:42
FacetWP - map taxonomies of parent product to variation
add_filter( 'facetwp_indexer_row_data', function( $rows, $params ) {
$extra_taxonomies = array(
'producttype' => 'product-type', // Facet WP facet name => taxonomy name
);
// Check if facet name is extra taxonomy
if ( array_key_exists($params['facet']['name'], $extra_taxonomies) ){
// Set taxonomy to check