Hi,
I have an Enfold+ woocommerce website.
On a product page when you open on mobile you see the sidebar first and you have make too much scroll to reach the product description. I tried some solutions from the forum, but did not work.
What I am trying to do is move the description right after the product image and then the sidebar.
Thanks!
Hey Cherryadvertising,
Please have a look at the following thread:
If you need further assistance please let us know.
Best regards,
Victoria
Hi, the suggested solution is not working.
Hi,
Sorry for the late reply, to move the sidebar below the description for products on mobile, Try adding this code to the end of your functions.php file in Appearance > Editor:
function custom_script(){
?>
<script>
(function($) {
$(document).ready(function(){
var width = $(window).width()
if ($(width <= 767)) {
$('#top.single-product .sidebar').detach().insertAfter('#top.single-product .single-product-summary');
} else{}
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'custom_script');
Then clear your browser cache and check.
Best regards,
Mike
Hi,
thanks, works perfect.
But now the change happens also on desktop too.
Can we make it so it is only reflected on mobile?
Thanks!
Hi Cherryadvertising,
This line:
if ($(width <= 767)) {
should be
if (width <= 767) {
Please it like that.
Best regards,
Victoria
That works :-)
Thanks!
Hi,
Thanks @Victoria, @Cherryadvertising glad this is helping, unless there is anything else we can help with on this issue, shall we close this then?
Best regards,
Mike