Hi,
I’m going to display product parent category in WC Single layout with custom loopers but it returns “Uncategorized” as result.
I have used this code in functions.php:
/**
* Parent category with Loopers
*/
add_filter('cs_looper_custom_parentcat', function($result, $args)
{
$parent_cat=$args['parent_cat'];
$cat_args= get_terms(['taxonomy' => 'product_cat','hide_empty' => false, 'parent' => 0]);
$parentcat = $cat_args;
return $parentcat;
}, 10, 2);
and placed this code in JSON window:
$parent_cat=$args['parent_cat'];
and on Text element I enabled Looper Consumer with One item.
Could you please guide me to debug the process?
Thanks in advance.
Omid