I’m making a customized component the place I must load woo-commerce product classes as dropdown (in visible composer component edit choice)
however I get this error. can somebody inform me the place is the issue?
right here is the code:
<?php
add_shortcode('woo_my_cat_sub_cat_show_element_code','woo_my_cat_sub_cat_show_element_functions');
operate woo_my_cat_sub_cat_show_element_functions($atts,$content material){
extract(shortcode_atts(array(
'woo_my_cat_list' => '',
),$atts));
ob_start();?>
<!-- I'll do the frontend right here -->
<?php
return ob_get_clean();
}
if(function_exists('vc_map')){
/***
* dynamic fields for the component
*/
$args = array(
'taxonomy' => 'product_cat',
// 'quantity' => $quantity,
// 'orderby' => $orderby,
// 'order' => $order,
// 'hide_empty' => $hide_empty,
//'embrace' => 59,
'dad or mum' => 0,
);
$product_categories = get_terms($args);
$dropdown_cats_array = array();
foreach( $product_categories as $single ){
$dropdown_cats_array[$single->name] = $single->term_id;
}
vc_map(array(
'identify' => 'Subcategory',
'base' => 'woo_my_cat_sub_cat_show_element_code',
'class' => 'Customized Component',
'params' => array(
array(
'param_name' => 'woo_my_cat_list',
'heading' => 'Choose Class',
'kind' => 'dropdown',
'worth' => $dropdown_cats_array,
"description" => "Please Select the category, which subcategories you want to show on the page.",
),
)
));
}
?>
And right here is the error I get: