1

I've a site developed with Drupal commerce.

I'm using the context filter to display a block with related products. I want to display 4 products, first ones I've selected with entity field, if there aren't (or not enough) ones that have the same category, even if these are not enough I want ones that have the category with the same parent of my product.

To do this I used a view and set the contextual filters with Views Module Contextual Filters OR. With my contextual filter I'm able to extract the related products, then the products of the same category, but can't extract products that have the same parent category. Also I can't order my products, first related ones, then the ones with the same categories, etc.

I am attaching a screenshot for clarity.

enter image description here

Any suggestions? Thank you

  • You need Taxonomy Term with Depth as a contextual filter instead of Has Taxonomy Term ID, it should be available considering your relationships. – Marcel Apr 9 '16 at 5:03
  • It's ok. Now I need to order my products... first related ones, then the ones with the same categories, etc. There is any module to do this? – NiBa Apr 13 '16 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.