function avia_woocommerce_disable_editor($params)
 {
     if (!current_theme_supports('avia_custom_shop_page')) {
         global $post_ID;
         $shop_page_id = wc_get_page_id('shop');
         if ($post_ID == $shop_page_id) {
             $disabled = __('(disabled)', 'avia_framework');
             $params['visual_label'] = $params['visual_label'] . " " . $disabled;
             $params['default_label'] = $params['default_label'] . " " . $disabled;
             $params['button_class'] = "av-builer-button-disabled";
             $params['disabled'] = true;
             $params['note'] = __('This page is set as the default WooCommerce Shop Overview and therefore does not support the Enfold advanced layout editor', 'avia_framework') . " <br/><a href='http://www.kriesi.at/documentation/enfold/custom-woocommerce-shop-overview/' target='_blank'>(" . __('Learn more') . ")</a>";
         }
     }
     if (avia_backend_get_post_type() == "product") {
         $params['noteclass'] = "av-notice av-only-active";
         $params['note'] = __('Please note that the Advanced Layout Builder for products will not work with all WooCommerce Extensions', 'avia_framework');
     }
     return $params;
 }
function avia_woocommerce_product_elements($elements)
{
    $posttype = avia_backend_get_post_type();
    if (!empty($posttype) && $posttype == 'product') {
        $elements[] = array("slug" => "avia_product_hover", "name" => "Hover effect on <strong>Overview Pages</strong>", "desc" => "Do you want to display a hover effect on overview pages and replace the default thumbnail with the first image of the gallery?", "id" => "_product_hover", "type" => "select", "std" => "", "class" => "avia-style", "subtype" => array("Yes - show first gallery image on hover" => 'hover_active', "No hover effect" => ''));
        $counter = 0;
        foreach ($elements as $element) {
            if ($element['id'] == 'sidebar') {
                $elements[$counter]['required'] = '';
            }
            if ($element['id'] == 'layout') {
                $elements[$counter]['builder_active'] = true;
                // unset($elements[$counter]);
            }
            $counter++;
        }
    }
    return $elements;
}