I already solved… by detecting your plugin call.. or error and returning the price thanks by the way and compliments again for the plugin. its wonderfull
my only other question is why in the divi theme it wont set the cursor to the seach bar when i click…. it apear to rapdly open the div search and than switch to the fiboseach but without the cursor on focus…
is there a way to get it?
Hi @sebosfato
I’m glad you managed to solve the problem.
Let’s check if the script below will solve your 2nd problem. This code responds to a click on the element with the ID #et_top_search. If a specific search form container is visible (et_pb_search_visible), after a delay of 300 milliseconds, it checks whether the search input is not already in focus. If it’s not, it sets focus on that input.
add_action( 'wp_footer', function() { ?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('body').on('click', '#et_top_search', function() {
if (jQuery('.et_search_form_container').hasClass('et_pb_search_visible')) {
setTimeout(function() {
if (!jQuery('.et_search_form_container.et_pb_search_visible .dgwt-wcas-search-input').is(':focus')) {
jQuery('.et_search_form_container.et_pb_search_visible .dgwt-wcas-search-input').focus();
}
}, 300);
}
});
});
</script>
<?php }, 9999 );
You have two ways to add this code to your theme:
- Open the
functions.php in your child theme and add the code at the end.
- or install the Code Snippets plugin and apply this code as a snippet.
Regards,
Kris
Hi Thanks a lot i tried here but initially it did not work so i kept trying and found that it worked using this way:
add_action( 'wp_footer', function() { ?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('body').on('click', '.et_pb_menu__search-button', function() { // console.log("Search clicked");
setTimeout(function() {
if (!jQuery('.dgwt-wcas-search-input').is(':focus')) {
jQuery('input.dgwt-wcas-search-input').focus(); // console.log("Search form ");
}
}, 300);
//}
});
});
</script>
<?php }, 9999 );
Perhaps you could add directly to the plugin this function too..
do you have it already? or do you have plans to add to the plugin?
I ask just to not fall in conflict so i can remove from my functions later?
Thanks a lot for the help!!!!
the container may be different because im using the global template of the menu… looks like this
if (jQuery('et_pb_menu__search-container--visible')) {
I found a second minor bug… the add to cart button on the details is getting the background color set for all the woo add to cart buttons… but when im not in a products page it wont get the color of the text.. leaving a total colored button…
i tried to add css to styles but it seem its loaded only when the search comes up or something so its not applied… is there a way to make the transparent background ! important? or to change it without having to reset the add to cart buttons on divi?
Thanks again hope it helps improove functionality..
this is an example of a product page where the add to cart will show correct… https://gardentoy.com.br/produto/diodo-1200v-16a-ultra-rapido-hfa16tb120-30ns/
if you go to the main page or other like about us it wont show the correct color on the text of the add to cart button…
Hi @sebosfato!
Nice that you managed to solve the previous problem.
The class that is added to this button is .added_to_cart. You can style it with CSS like this:
.added_to_cart {
font-size: 14px;
background-color: #0055b8;
border-radius: 50px;
font-weight: bold;
font-style: normal;
text-transform: none;
text-decoration: none;
padding: 0.3em 1em 0.3em 1em !important;
line-height: 1.7em !important;
position: relative;
border: 2px solid;
transition: all 0.2s;
color: #fff !important;
}
.added_to_cart:hover {
padding: 0.3em 2em 0.3em 1em !important;
color: #0055b8 !important;
}
.added_to_cart font {
color: #fff !important;
}
.added_to_cart:hover font {
color: #0055b8 !important;
}
Paste it into Appearance -> Customize -> Additional CSS. If you aren’t familiar with custom CSS, take a look at this video.
Regards,
Kris