document.write("
<?php
function storeFilter($meta_query) {
$i = new My_Internal_Class;
$url = CRM_ROOT . "stores/getStoreCatalogue/" . $_GET["sid"];
$cid = $i->chReq($url);
$meta_query[] = array(
'post_type' => 'product',
'meta_query' => array(
array(
'key' => '_product_attributes',
'value' => "_cid_$cid"."_",
'compare' => 'LIKE',
'type' => 'product'
)
)
);
return $meta_query;
}
add_filter( 'woocommerce_product_query_meta_query', 'storeFilter', 9 );
?>
functions.php - Snippet hosted by \"Cacher\"
");