Product groups/variations

Sometimes, it's necessary to categorize product outputs into distinct groups. For instance, when writing an article about a phone model, you might also want to include offers for accessories. Alternatively, you might display prices for different colors of the same product. In such cases, creating separate product groups can be very useful.

Check the Smart Groups feature to create and assign product groups using AI.

How to Use Groups

  1. Add the groups you need at the top of the Content Egg metabox.

  1. Search and add products, then assign them to the corresponding groups.

  1. Pro tip: When searching for products, use the special syntax "keyword -> group name". After saving the post, the group will be automatically assigned to the product. This syntax also works for auto-update keywords.

  1. Select the group in the shortcode builder. The shortcode will then display only products with the assigned groups. You can also use multiple groups separated by commas.

  1. There are special templates for group output. These templates will automatically create tabs for each group. You can also set the order of tabs in the group shortcode parameter.

[content-egg-block template=offers_logo_groups] 
[content-egg-block template=offers_list_groups groups="PlayStation 5 Digital,PlayStation 5 Disc Edition"]

Static groups

If you want certain product groups to be available for all posts by default, you can use the cegg_static_product_groups filter.

Add the following code to your theme’s functions.php file (preferably in a child theme):

add_filter('cegg_static_product_groups', function ($groups, $post_id) {
    $groups[] = 'Top Picks';
    $groups[] = 'Editor\'s Choice';
    $groups[] = 'Limited-Time Deals';
    return $groups;
}, 10, 2);

Last updated