Wie kann ich meinen Produktfilter dazu bringen, Ergebnisse in einer Produkttabelle zu zeigen? Mit Woot anf Woof/Husky vePhp

PHP-Programmierer chatten hier
Guest
 Wie kann ich meinen Produktfilter dazu bringen, Ergebnisse in einer Produkttabelle zu zeigen? Mit Woot anf Woof/Husky ve

Post by Guest »

Ich verwende einen Woot -Produktfilter für WooCommerce und versuche, Suchergebnisse in Husky -Produkttabelle (verwendet werden) für WooCommerce zu zeigen. Code -Analphabet mit Divi Theme Builder. Ich sagte mir, ich solle diesen Code für die Integration zwischen Woot und Woof in functions.php einfügen, aber er betrifft nichts.

Code: Select all

add_filter("woot_profile_extend", function($profile, $action, $shortcode_args) {

if ('woot_woocommerce_tables' === $action) {

if (isset($shortcode_args['filter_provider'])) {

if ($shortcode_args['filter_provider'] === 'woof') {
if (array_key_exists('WOOF', $GLOBALS)) {
global $WOOF;
$profile[0]['filter_provider'] = 'woof';
$profile[0]['filter_data'] = $WOOF->get_request_data();

add_action('woot_filter_provider_woof', function ($args, $filter_data) {
if (!is_array($filter_data)) {
$filter_data = json_decode($filter_data, true);
}

if (!empty($filter_data) AND is_array($filter_data)) {
foreach (array_keys($filter_data) as $key) {
if (is_integer($key)) {
unset($filter_data[$key]);
}
}
}

//***
//here is clean WOOF functionality
global $WOOF;
if ((isset($filter_data[$WOOF->get_swoof_search_slug()]) OR isset($filter_data['min_price'])) AND count($filter_data) > 1) {

unset($filter_data['paged']);
$_GET = $filter_data;
$_REQUEST['perpage'] = -1; //for getting all products ids in WOOF predict filtration

if (isset($filter_data['post_title']) AND!empty($filter_data['post_title'])) {
woot()->filter->provider($filter_data);
}

$WOOF->woof_products_ids_prediction(true);
$ids = $_REQUEST['woof_wp_query_ids'];

if ($ids) {
$args['post__in'] = $ids;
} else {
unset($args['post__in']);
}
}

return $args;
}, 10, 2);
}
}

}
}

return $profile;
}, 10, 3);

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post