-
AuthorPosts
-
December 7, 2015 at 1:56 pm #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?
ThanksRegards,
SalvatoreDecember 7, 2015 at 4:53 pm #548106Hey 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!
ElliottDecember 9, 2015 at 10:21 am #549576Hi 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.
Cheers,
SalvatoreDecember 11, 2015 at 2:09 am #550797Hey!
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!
ElliottDecember 11, 2015 at 9:49 am #550904Hi,
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.
December 14, 2015 at 12:00 am #551858Hi!
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!
ElliottMarch 8, 2016 at 3:09 am #594724I’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.
March 9, 2016 at 1:14 am #595253I’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)
March 9, 2016 at 1:40 am #595259Figured 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
March 9, 2016 at 6:06 am #595314August 10, 2016 at 3:23 am #670575I would like to know too. Can;t pay for plugins right now
August 12, 2016 at 9:59 pm #672084Hi,
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,
AndySeptember 8, 2017 at 4:57 pm #849644September 9, 2017 at 8:36 am #849887 -
AuthorPosts
- You must be logged in to reply to this topic.