Skip to content
  • Hot
  • Top
  • New
2
votes

You have ... votes left in this category for this week!

FWW Recommended Products

Krzysztof shared this feature

March 31, 2020

Youtube, Google Play Store and other big boys websites show on their homepages recommended products based on recently viewed products. We can do something similar based on product categories and attributes.

e.g. user visits:

1) Product ID 1:
– product_cat – Mens
– pa_brand – Nike
– pa_colour – White

and

2) Product ID 2:
– product_cat – Mens
– pa_brand – adidas
– pa_colour – Black

FWW Recommended Products widget shows products:

– product_cat – Mens
– pa_brand – Nike OR adidas
– pa_colour – White OR Black
– exclude – Product IDs 1 and 2 // not sure if this is actually necessary

———————————

‘tax_query’ => array(
‘relation’ => ‘OR’,
array(
‘taxonomy’ => ‘product_cat’,
‘field’ => ‘slug’,
‘terms’ => array(‘mens’),
),
array(
‘taxonomy’ => ‘pa_brand’,
‘field’ => ‘slug’,
‘terms’ => array(‘nike’,’adidas’),
),
array(
‘taxonomy’ => ‘pa_colour’,
‘field’ => ‘slug’,
‘terms’ => array(‘black’,’white’),
),
),

I think this is doable and similar to the FWW Recently Viewed Products (Ajax) widget.

It would be nice to have access to this query – just an array of product IDs would be enough – so we can use it in custom templates.

Leave a Reply

Your email address will not be published. Required fields are marked *

CYBERFUNDAY 40% discount coupon extended to Friday 9th December + join our Discord community and read the rules for an extra 20% discount coupon.