Homepage › Forum › Product Support › Motor › Too Many Product Categories in menu Shop
- This topic has 15 replies, 3 voices, and was last updated 7 years, 5 months ago by
tinhbeng.
-
AuthorPosts
-
7 years, 5 months ago #16656
Hi,
We have too many Product Categories in the main menu Shop. The result is that the visitor can't scroll down and many 1st and 2nd level Categories are not viewable.
Is it possible to display a vertical scrollbar in the 2nd level of Categories? I attached 2 screenshots for you to understand the issue.
Thank you
7 years, 5 months ago #16661Hi,
Please send me link your site (Set as private reply).
I will help you check.
Thanks
7 years, 5 months ago #16664This reply has been marked as private.7 years, 5 months ago #16667This reply has been marked as private.7 years, 5 months ago #16668This reply has been marked as private.7 years, 5 months ago #16676Sorry for the delayed reply.
- Product category in the main menu Shop: you go to Theme Options -> Custom CSS & Script -> add these lines to Custom JS: http://prntscr.com/k44ieq
jQuery(document).ready(function($){
var submenu = $('.menu_style_dropdown.level-1 > ul');
submenu.each(function(){
var seft = $(this);
seft.parents('.level-0').mouseover(function(){
var height = seft.height();
if(height > 200){
seft.css({"max-height": "200px", "overflow-y": "scroll","overflow-x":"hidden"});
}
})
})
})
***** Related product:
- To add the product "Cross Sell" to the Single product, you can do the following:
1. Create a child theme. https://codex.wordpress.org/Child_Themes
2. Add this function to the functions.php in Child theme:
if ( class_exists( 'WC_Query' ) ) {
function show_cross_sell_in_single_product(){
$crosssells = get_post_meta( get_the_ID(), '_crosssell_ids',true);
if($crosssells):
$args = array(
'post_type' => 'product',
'posts_per_page' => -1,
'post__in' => $crosssells
);
$products = new WP_Query( $args );
ob_start();
if ( $products ) : ?>
<section class="related products">
<h2><?php esc_html_e( 'Related Product', 'woocommerce' ); ?></h2>
<?php woocommerce_product_loop_start(); ?>
<?php while ( $products->have_posts() ) : $products->the_post();
wc_get_template_part( 'content', 'product' );
endwhile; // end of the loop. ?>
<?php woocommerce_product_loop_end(); ?>
</section>
<?php endif;
$content = ob_get_contents();
wp_reset_postdata();
return $content;
endif;
}
add_action('woocommerce_after_single_product', 'show_cross_sell_in_single_product', 10, 2);
}
Best regards,
tinhbeng.
7 years, 5 months ago #16680This reply has been marked as private.7 years, 5 months ago #16684This reply has been marked as private.7 years, 5 months ago #16737This reply has been marked as private.7 years, 5 months ago #16738Hi again,
Thanks for your feedback.
Please check again your website because it blocks our IP, we cannot access it.
Here is our IP: 103.238.69.133
Check it, then feedback us soon.
Best Regards,
YoloTheme
7 years, 5 months ago #16741This reply has been marked as private.7 years, 5 months ago #16750Hi again,
Please see the attached image to check the problem which we are facing.
Thank you.
YoloTheme
7 years, 5 months ago #16759This reply has been marked as private.7 years, 5 months ago #16767Hi,
With Related product, you can add these lines:
.related .product-item-wrap{
float: left;
}
- You can refer this jquery library to custom scroll bar:
http://manos.malihu.gr/jquery-custom-content-scroller/
7 years, 5 months ago #16780This reply has been marked as private. -
AuthorPosts
You must be logged in and have valid license to reply to this topic.
