454 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Microlancer Beta Tester
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

I am trying to display cross sell products in woocommerce by category e.g.

$args = array(
   'post_type' => 'product',
   'ignore_sticky_posts' => 1,
   'posts_per_page' => 1,
   'no_found_rows' => 1,
   'orderby' => 'name',
   'post__in' => $crosssells,
   'product_cat' => 'mattresses',
   );

The product needs to be a cross sell and in the exact category to be displayed but the above code displays the product from the category even if it’s not a cross sell.

Any ideas?

454 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Microlancer Beta Tester
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

anyone able to help with this, driving me crazy trying to find a solution

454 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Microlancer Beta Tester
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

bump, this is the only thing holding me back launching the website (and getting paid).

Am I looking at this the wrong way?

by
by
by
by
by
by