Home › Forums › WoodMart support forum › Related products
Related products
- This topic has 11 replies, 2 voices, and was last updated 6 years, 9 months ago by MoeMauphie.
-
AuthorPosts
-
February 21, 2018 at 7:52 am #41359
MoeMauphieParticipantHi there,
Could please tell me how and based on what factors the related products are chosen? Is there there anyway to modify it?
February 21, 2018 at 8:16 am #41366
MoeMauphieParticipantI’d like to show products from the same category and brand. Is it possible?
Regards
February 21, 2018 at 8:43 am #41372
Artem TemosKeymasterHello,
You can read the information about the related products section in WooCommerce plugin’s documentation https://docs.woocommerce.com/document/related-products-up-sells-and-cross-sells/
Regards
February 21, 2018 at 9:17 am #41377
MoeMauphieParticipantThanks for your reply,
I read it and I tried to use this code but to no avail. Could you please see if it’s compatible with your theme?
function custom_related_product_args ( $args ){ global $product; $cats = wc_get_product_terms( $product->id, 'product_cat', array( 'fields' => 'slugs' ) ); $brands = wc_get_product_terms( $product->id, 'pa_brand', array( 'fields' => 'slugs' ) ); unset( $args['post__in'] ); $args['tax_query'] = array( 'relation' => 'AND', array( 'taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => $cats, ), array( 'relation' => 'AND', array( 'taxonomy' => 'pa_brand', 'field' => 'slug', 'terms' => $brands, ), ) ); return $args; } add_filter('woocommerce_related_products_args', 'custom_related_product_args');
Many Thanks,
February 21, 2018 at 9:53 am #41391
Artem TemosKeymasterDoes this code works correctly with default WordPress theme?
February 22, 2018 at 6:11 am #41535
MoeMauphieParticipantI can’t test it with the default theme at the moment, because when I change the theme and go back to Woodmart, I lose some settings.
I’ll try to find some developer to help me with that.
Thanks guys
February 22, 2018 at 9:20 am #41583
Artem TemosKeymasterOK, contact us if you will have any extra questions.
February 22, 2018 at 10:04 am #41588
MoeMauphieParticipantMeanwhile, could please add the owl slider feature for upsells and crosssells in your future updates?
Many Thanks
February 22, 2018 at 10:43 am #41606
Artem TemosKeymasterBut this function is already implemented in our theme. Carousel for upsells and related products can be enabled in Theme Settings -> Product page -> Show / Hide elements.
Cross-sells carousel is enabled by default.February 22, 2018 at 11:34 am #41621
MoeMauphieParticipantI didn’t see a separate option for upsells, so by setting “Related product view” to slider, it will be enabled for both upsells and related products, is my assumption right?
That’s great by the way.February 22, 2018 at 1:07 pm #41637
Artem TemosKeymasterYes, this option works for both sections. Probably, we should mention this information there.
February 22, 2018 at 1:48 pm #41652
MoeMauphieParticipantThanks a lot,
-
AuthorPosts
The topic ‘Related products’ is closed to new replies.
- You must be logged in to create new topics. Login / Register