WOOT - WooCommerce Active Products Tables

How to insert in top menu woot_button shortcode?

You can see results on the top menu of the site https://demo.products-tables.com/ -> click on ‘Hottest Products

Do next:

  • Create on WOOT admin page new shortcode [woot]
  • Open settings of the new shortcode -> tab ‘Predefinition‘ -> ‘Products ids‘ -> Using comma, set products ids you want to show in the table. Example: 23,99,777. Set -1 if you do not want to use it.
  • Remember ID of the new created shortcode
  • Go to page ‘wp-admin/nav-menus.php
  • On the top right corner click on ‘Screen Options
  • On the opened tab check checkbox ‘Description
  • Create new linkĀ  and name it as ‘Hottest Products
  • In the created menu textarea ‘Description‘ paste shortcode:[woot_button id=9 title=’Hottest Products’ popup_title=’Todays Hottest Products. Time is Limited!!’ help_title=’Shipping conditions’ help_link=’__set_shipping_link_here_if_you_need_it__’]
  • Save menu
  • Open file functions.php of the current WordPress theme and paste there next code:
    add_filter('walker_nav_menu_start_el', function($item_output, $item) {
        if (!is_object($item) || !isset($item->object)) {
            return $item_output;
        }
    
        if (substr_count($item->description, 'woot_button')) {
            $item_output = do_shortcode($item->description);
        }
    
        return $item_output;
    }, 20, 2);