/**
 * Callback for dealing with Primary Sidebar loading
 *
 * Intercepts GSS code flow, so that Shop page can be dealt with, then
 * hands back control to the GSS function for loading primary sidebars.
 * Effectively, it's just a more complex version of ss_do_sidebar()
 *
 * Checks if we're on the product archive and a GSS sidebar has been
 * assigned in the Shop WP Page editor, then, if both true, loads the relevant
 * GSS sidebar on the Shop Page.
 * If either of the above conditions return false, we hand back control to GSS
 * by executing the normal ss_do_one_sidebar() function.
 *
 * @since 0.9.0
 *
 * @uses woocommerce_get_page_id()
 *
 */
function gencwooc_ss_do_sidebar()
{
    $bar = '_ss_sidebar';
    $shop_id = woocommerce_get_page_id('shop');
    if (is_post_type_archive('product') && ($_bar = get_post_meta($shop_id, $bar, true))) {
        dynamic_sidebar($_bar);
    } else {
        /** Hand back control to GSS */
        if (!ss_do_one_sidebar($bar)) {
            genesis_do_sidebar();
        }
    }
}
/**
 * Display primary sidebar.
 *
 * Display custom sidebar if one exists, else display default primary sidebar.
 *
 * @since 0.9.0
 */
function ss_do_sidebar()
{
    if (!ss_do_one_sidebar('_ss_sidebar')) {
        genesis_do_sidebar();
    }
}