Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #547977

    Hi,

    How can I set product hover enabled by default in woocommerce products?
    There is a function to be added in functions.php file?
    Thanks

    Regards,
    Salvatore

    #548106

    Hey integraing!

    I’m sorry but I’m not sure I understand. Your referring to the product images? Can you send us a link to your page and take a screenshot highlighting what your trying to do?

    Cheers!
    Elliott

    #549576

    Hi Elliot!

    When I add a new woocommerce product, I want to enable hover effect on overview pages by default.
    Hover effect on overview pages replace the default thumbnail with the first image of the gallery on mouse hover.

    Here are screenshots of the setting when I add/edit a woocommerce product. The setting box is positioned in the lower right.

    off
    on

    Cheers,
    Salvatore

    #550797

    Hey!

    Try flipping the array elements on line 179 in /enfold/config-woocommerce/config.php.

    "subtype" => array("Yes - show first gallery image on hover" => 'hover_active', "No hover effect" => ''));
    
    "subtype" => array("No hover effect" => '', "Yes - show first gallery image on hover" => 'hover_active' ));
    

    Cheers!
    Elliott

    #550904

    Hi,

    The file isn’t /enfold/config-woocommerce/config.php but /enfold/config-woocommerce/admin-options.php.
    However it doesn’t worked, then I changed line 177 from
    "std" => "",
    to
    "std" => "hover_active",
    and it worked.

    Now my question is: can I do this change directly by adding code in functions.php instead of edit code in config-woocommerce/admin-options.php? (for future theme updates)

    Thanks

    Regards,
    Salvatore

    • This reply was modified 8 years, 11 months ago by integraing.
    #551858

    Hi!

    Not sure if this will work but you can try it. You can place it in your child theme functions.php file.

    add_action( 'after_setup_theme', 'enfold_customization_product_switch' );
    function enfold_customization_product_switch(){
        remove_filter('avf_builder_elements','avia_woocommerce_product_elements');
    	add_filter('avf_builder_elements', 'avia_woocommerce_product_elements2');
    }
    
    function avia_woocommerce_product_elements2($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;
    }

    Cheers!
    Elliott

    #594724

    I’m curious about this as well – I don’t want to edit theme files – there has to be a way to hook in via child theme functions.php file right?

    The above solutions didn’t work.

    #595253

    I’m guessing you’ll need to inject this into the database somehow – unless you want to revisit all your products (I have over 500 so that won’t work)

    #595259

    Figured this out – use this plugin

    http://codecanyon.net/item/woocommerce-advanced-bulk-edit/8011417?s_rank=1

    Add a custom field called “_product_hover” – set it to “hover_active” value.

    Bam done

    #595314

    Hey!


    @supernovadm
    Thank you for sharing the tip. We really appreciate it :)

    Cheers!
    Vinay Kashyap

    #670575

    I would like to know too. Can;t pay for plugins right now

    #672084

    Hi,

    follow Elliott’s suggestions from the beginning of this thread. If this doesn’t work for you then you would need to hire a freelance developer or buy the plugin mentioned.

    Best regards,
    Andy

    #849644

    Hello Andy,

    i use WPML and the product hover dont work. Can i fix this?

    Thank you.

    Mirko

    #849887

    Hi Mirko,

    Please post a link to your site and point out the problem so that we can have a closer look.

    Best regards,
    Rikard

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.