'woocommerce_main_header', 'checkout' => 'woocommerce_checkout_header', ); protected const REPLACED_FOOTERS = array( 'main' => 'woocommerce_main_footer', 'checkout' => 'woocommerce_checkout_footer', ); protected function __construct() { parent::__construct(); if ( self::is_current_niche() ) { add_filter( 'brandy_product_demo_cats', array( $this, 'change_demo_cats' ) ); } } public static function get_niche_data() { $data = array( 'id' => self::NICHE_ID, 'title' => __( 'Demo WooCommerce store', 'brandy' ), 'img' => 'https://images.wpbrandy.com/uploads/wc-site-thumb-compress-img.webp', 'demo_url' => 'https://images.wpbrandy.com/uploads/wc-site-preview-compress-img.png', 'plan' => 'free', 'tags' => array( 'ecommerce' ), 'supports' => array( 'gutenberg' ), 'template' => array( 'woocommerce' => array( 'product_layout' => 'option_1', 'product_thumb_size' => 'size_2', 'single_product' => array( 'product_gallery_viewport_image_ratio' => 1, 'product_gallery_thumb_image_width' => 100, 'product_gallery_thumb_image_height' => 100, ), ), 'headers' => array( BRANDY_TEMPLATE_DIR . '/inc/Niches/WooCommerce/sample-data/sample-header.json', BRANDY_TEMPLATE_DIR . '/inc/Niches/WooCommerce/sample-data/checkout-header.json', ), 'footers' => array( BRANDY_TEMPLATE_DIR . '/inc/Niches/WooCommerce/sample-data/sample-footer.json', BRANDY_TEMPLATE_DIR . '/inc/Niches/WooCommerce/sample-data/checkout-footer.json', ), 'button' => array( 'primary_hover_color' => '#ffffff', 'primary_hover_background_color' => 'var(--wp--preset--color--brandy-primary-text)', 'primary_box_shadow' => array( 'enabled' => true, 'type' => 'custom', 'custom_value' => array( 'color' => '#FF7F091A', 'x' => 0, 'y' => 5, 'blur' => 35, 'spread' => 0, ), ), 'primary_hover_box_shadow' => array( 'enabled' => true, 'type' => 'custom', 'custom_value' => array( 'color' => 'rgba(0,0,0,.1)', 'x' => 0, 'y' => 7, 'blur' => 35, 'spread' => 0, ), ), 'outline_hover_color' => '#ffffff', 'outline_hover_background_color' => 'var(--wp--preset--color--brandy-primary-text)', 'outline_box_shadow' => array( 'enabled' => false, 'type' => 'custom', 'custom_value' => array( 'color' => 'rgba(47, 112, 179, .2)', 'x' => 0, 'y' => 7, 'blur' => 25, 'spread' => 0, ), ), 'outline_hover_box_shadow' => array( 'enabled' => true, 'type' => 'custom', 'custom_value' => array( 'color' => 'rgba(0,0,0,.1)', 'x' => 0, 'y' => 7, 'blur' => 35, 'spread' => 0, ), ), 'secondary_color' => '#ffffff', 'secondary_background_color' => '#151617', 'secondary_border_color' => '#151617', 'secondary_box_shadow' => array( 'enabled' => false, 'type' => 'custom', 'custom_value' => array( 'color' => 'rgba(47, 112, 179, .2)', 'x' => 0, 'y' => 7, 'blur' => 25, 'spread' => 0, ), ), 'secondary_border_width' => array( 'unit' => 'px', 'min' => 0, 'max' => 10, 'value' => 2, ), 'secondary_border_style' => 'solid', 'secondary_hover_color' => 'rgb(18, 41, 64)', 'secondary_hover_background_color' => '#ffffff', 'secondary_hover_border_color' => 'rgb(18 41 64)', 'secondary_hover_box_shadow' => array( 'enabled' => true, 'type' => 'custom', 'custom_value' => array( 'color' => 'rgba(0, 0, 0, .1)', 'x' => 0, 'y' => 7, 'blur' => 35, 'spread' => 0, ), ), ), ), 'sample_products' => BRANDY_TEMPLATE_DIR . '/inc/Niches/WooCommerce/sample-data/sample-products.csv', 'sample_product_category_images' => self::get_product_cats_file(), 'sample_posts' => array( 'gutenberg' => BRANDY_TEMPLATE_DIR . '/inc/Niches/WooCommerce/sample-data/sample-posts.json', ), 'sample_pages' => array( 'gutenberg' => '', ), 'sample_menus' => array( self::get_shopping_menu(), self::get_customer_service_menu(), ), 'sample_widgets' => BRANDY_TEMPLATE_DIR . '/inc/Niches/WooCommerce/sample-data/sample-widgets.json', ); return $data; } public function change_demo_cats() { if ( ! is_callable( array( parent::class, 'get_prod_cats_query_params' ) ) ) { return array(); } return get_terms( self::get_prod_cats_query_params() ); } public static function get_shopping_menu() { $menu = array( 'name' => __( 'Shopping menu', 'brandy' ), 'locations' => array( 'primary-menu', 'header-menu-1' ), 'items' => array( array( 'title' => __( 'Home', 'brandy' ), 'status' => 'publish', 'object_id' => brandy_get_home_page_id(), 'item_object' => 'page', 'item_type' => 'post_type', ), array( 'title' => __( 'Products', 'brandy' ), 'status' => 'publish', 'object_id' => brandy_get_shop_page_id(), 'item_object' => 'page', 'item_type' => 'post_type', 'key' => 'shops', ), array( 'title' => __( 'Blogs', 'brandy' ), 'status' => 'publish', 'object_id' => brandy_get_blog_page_id(), 'item_object' => 'page', 'item_type' => 'post_type', ), array( 'title' => __( 'About us', 'brandy' ), 'status' => 'publish', 'object_id' => brandy_get_about_us_page_id(), 'item_object' => 'page', 'item_type' => 'post_type', ), array( 'title' => __( 'Contact us', 'brandy' ), 'status' => 'publish', 'object_id' => brandy_get_contact_us_page_id(), 'item_object' => 'page', 'item_type' => 'post_type', ), ), ); if ( ! is_callable( array( parent::class, 'get_prod_cats_query_params' ) ) ) { $categories = array(); } else { $categories = get_terms( self::get_prod_cats_query_params() ); } if ( ! is_wp_error( $categories ) ) { foreach ( array_slice( $categories, 0, 3 ) as $cat_id ) { $cat = get_term( $cat_id ); $menu['items'][] = array( 'title' => $cat->name, 'status' => 'publish', 'url' => get_term_link( $cat_id, 'product_cat' ), 'parent' => 'shops', ); } } return $menu; } }