<?php

add_action( 'admin_menu', 'storefront_ecommerce_gettingstarted' );
function storefront_ecommerce_gettingstarted() {
	add_theme_page( esc_html__('About Theme', 'storefront-ecommerce'), esc_html__('Theme Demo Import', 'storefront-ecommerce'), 'edit_theme_options', 'storefront-ecommerce-guide-page', 'storefront_ecommerce_guide');
}

function storefront_ecommerce_admin_theme_style() {
   wp_enqueue_style('storefront-ecommerce-custom-admin-style', esc_url(get_template_directory_uri()) . '/inc/dashboard/get_started_info.css');
   wp_enqueue_script('storefront_ecommerce-tab', esc_url( get_template_directory_uri() ) . '/inc/dashboard/js/get_started_tab.js');
   wp_enqueue_script('storefront-ecommerce-bundle-banner', get_template_directory_uri() . '/inc/dashboard/js/bundle_banner.js', array(), false, true);
   // Admin notice code START
	wp_register_script('storefront-ecommerce-notice', esc_url(get_template_directory_uri()) . '/inc/dashboard/js/notice.js', array('jquery'), time(), true);
	wp_enqueue_script('storefront-ecommerce-notice');
	// Admin notice code END
}
add_action('admin_enqueue_scripts', 'storefront_ecommerce_admin_theme_style');

// Notice after Theme Activation
function storefront_ecommerce_notice(){
    // Hide permanently if dismissed
    if ( get_option('storefront_ecommerce_admin_notice') == 1 ) {
        return;
    }
    // Hide ONLY on Get Started page
    if ( isset($_GET['page']) && $_GET['page'] === 'storefront-ecommerce-guide-page' ) {
        return;
    }  {?>
    <div id="storefront-ecommerce-welcome-notice" class="notice notice-success is-dismissible getting_started activation-notice">
		<div class="notice-info-row">
			<div class="notice-image">
				<img style="width: 100%;max-width: 320px;line-height: 40px;display: inline-block;vertical-align: top;" src="<?php echo esc_url(get_stylesheet_directory_uri()) .'/screenshot.png'; ?>" />
			</div>
			<div class="notice-content">
				<h2><?php esc_html_e( 'Thanks For Installing Storefront Ecommerce, You Rock!', 'storefront-ecommerce' ) ?> </h2>
				<p><?php esc_html_e( 'Take benefit of a variety of features, functionalities, elements, and an exclusive set of customization options to build your own professional charity website. Please Click on the link below to know the theme setup information.', 'storefront-ecommerce' ) ?></p>
				<div style="display: grid;">
					<a class="button notice-btn" href="<?php echo esc_url( admin_url( 'themes.php?page=storefront-ecommerce-guide-page' )); ?>"><?php esc_html_e( 'Get Started', 'storefront-ecommerce' ) ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( STOREFRONT_ECOMMERCE_BUY_BUNDLE ); ?>"><?php esc_html_e('Get Bundle', 'storefront-ecommerce') ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( STOREFRONT_ECOMMERCE_LIVE_DEMO ); ?>"><?php esc_html_e('Pro Demo', 'storefront-ecommerce') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( STOREFRONT_ECOMMERCE_BUY_PRO ); ?>"><?php esc_html_e('Upgrade To Pro', 'storefront-ecommerce') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( STOREFRONT_ECOMMERCE_FREE_DOC ); ?>"><?php esc_html_e('Free Doc', 'storefront-ecommerce') ?></a>
				</div>
			</div>
		</div>
	</div>
	<?php }
}
//Hook (VERY IMPORTANT)
add_action('admin_notices', 'storefront_ecommerce_notice');

// Admin notice code START
add_action('wp_ajax_storefront_ecommerce_dismiss_notice', 'storefront_ecommerce_dismiss_notice');
function storefront_ecommerce_dismiss_notice() {
    update_option('storefront_ecommerce_admin_notice', 1);
    wp_die();
}

//After Switch theme function
add_action('after_switch_theme', 'storefront_ecommerce_getstart_setup_options');
function storefront_ecommerce_getstart_setup_options () {
    delete_option('storefront_ecommerce_admin_notice');
}
// Admin notice code END

/**
 * Theme Info Page
 */
function storefront_ecommerce_guide() {

	// Theme info
	$storefront_ecommerce_return = add_query_arg( array()) ;
	$storefront_ecommerce_theme = wp_get_theme( 'storefront-ecommerce' ); ?>

	<div class="wrap getting-started">
		<div class="getting-started__header">
		    <div>
                <h2 class="tgmpa-notice-warning"></h2>
            </div>
		</div>
		<div class="tab-sec">
			<div class="bwp-bundle-banner">
				<div class="bwp-bundle-banner__row">
					<div class="bwp-bundle-banner__content">
						<span class="bwp-bundle-banner__badge"><?php esc_html_e( 'Limited Time Deal - 25% Off', 'storefront-ecommerce' ); ?></span>
						<h2 class="bwp-bundle-banner__title"><?php esc_html_e( '250+ Premium WordPress Themes in One Bundle', 'storefront-ecommerce' ); ?></h2>
						<p class="bwp-bundle-banner__desc">
							<strong><?php esc_html_e( 'SUMMER SALE!', 'storefront-ecommerce' ); ?></strong>
							<?php esc_html_e( 'Get 15% off on a Bundle of 250+ Premium WP Themes. Use', 'storefront-ecommerce' ); ?>
							<span class="bwp-bundle-banner__coupon-inline">&quot;SUMMER15&quot;</span>
							<?php esc_html_e( 'at Checkout.', 'storefront-ecommerce' ); ?>
						</p>
						<div class="bwp-bundle-banner__actions">
							<a class="bwp-bundle-banner__cta" target="_blank" href="<?php echo esc_url( STOREFRONT_ECOMMERCE_BUY_BUNDLE ); ?>"><?php esc_html_e( 'Get Bundle Just at $99', 'storefront-ecommerce' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span></a>
							<button type="button" class="bwp-bundle-banner__coupon" id="bwp-copy-coupon" data-coupon="SUMMER15" aria-label="<?php echo esc_attr__( 'Copy coupon code SUMMER15', 'storefront-ecommerce' ); ?>">
								<span class="bwp-bundle-banner__coupon-label"><?php esc_html_e( 'Coupon Code', 'storefront-ecommerce' ); ?></span>
								<span class="bwp-bundle-banner__coupon-code">SUMMER15</span>
								<span class="bwp-bundle-banner__coupon-copied" id="bwp-copy-coupon-msg"><?php esc_html_e( 'Copied!', 'storefront-ecommerce' ); ?></span>
							</button>
						</div>
					</div>
					<div class="bwp-bundle-banner__price">
						<div class="bwp-bundle-banner__price-amount">
							<span class="bwp-bundle-banner__price-old">$9750</span>
							<span class="bwp-bundle-banner__price-new">$99</span>
						</div>
						<span class="bwp-bundle-banner__price-note"><?php esc_html_e( '* Lifetime Updates & All Future Themes Included', 'storefront-ecommerce' ); ?></span>
					</div>
					<div class="bwp-bundle-banner__visual" aria-hidden="true">
						<img class="logo" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/bwt-bundle.png'); ?>"/>
					</div>
				</div>
			</div>
			<div class="tab">
				<button role="tab" class="tablinks home" onclick="storefront_ecommerce_openCity(event, 'bwp_getstart')"><?php esc_html_e( 'Theme Demo Import', 'storefront-ecommerce' ); ?></button>
				<button role="tab" class="tablinks" onclick="storefront_ecommerce_openCity(event, 'bwp_setup')"><?php esc_html_e( 'Free Theme Information', 'storefront-ecommerce' ); ?></button>
				<button role="tab" class="tablinks" onclick="storefront_ecommerce_openCity(event, 'bwp_premium_info')"><?php esc_html_e( 'Premium Theme Information', 'storefront-ecommerce' ); ?></button>
				<a class="tablinks" role="tab" href="<?php echo esc_url( STOREFRONT_ECOMMERCE_LIVE_DEMO ); ?>" target="_blank">
					<?php esc_html_e( 'Live Demo', 'storefront-ecommerce' ); ?>
				</a>
				<a class="tablinks" role="tab" href="<?php echo esc_url( STOREFRONT_ECOMMERCE_BUY_PRO ); ?>" target="_blank">
					<?php esc_html_e( 'Buy Pro', 'storefront-ecommerce' ); ?>
				</a>
			</div>
			<div  id="bwp_getstart" class="tabcontent">
				<div class="row">
					<div class="col-md-5 intro">
						<div class="pad-box">
							<h2><?php esc_html_e( 'Welcome to Storefront Ecommerce ', 'storefront-ecommerce' ); ?>
							<span><?php esc_html_e( 'Version: ', 'storefront-ecommerce' ); ?><?php echo esc_html($storefront_ecommerce_theme['Version']);?></span>
							</h2>
							<span class="intro__version"><?php esc_html_e( 'Congratulations! You are about to use the most easy to use and flexible WordPress theme.', 'storefront-ecommerce' ); ?>
							</span>
							<div class="powered-by">
								<p><strong><?php esc_html_e( 'Theme created by Buy WP Templates', 'storefront-ecommerce' ); ?></strong></p>
								<p>
									<img class="logo" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/theme-logo.png'); ?>"/>
								</p>
								<div class="demo-content">
									<?php
										/* Demo Import */
										require get_parent_theme_file_path( '/inc/dashboard/demo-content.php' );
									?>
								</div>

								<div id="demo-import-loader">
									<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/spinner.gif'); ?>" alt="<?php echo esc_attr( 'Loading...', 'storefront-ecommerce'); ?>" />
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-7">
						<div class="install-plugins">
							<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/responsive1.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'storefront-ecommerce'); ?>" />
							<div class="install-plugins__actions">
								<a class="install-plugins__btn install-plugins__btn--pro" href="<?php echo esc_url( STOREFRONT_ECOMMERCE_BUY_PRO ); ?>" target="_blank"><?php esc_html_e( 'Get Pro at $39', 'storefront-ecommerce' ); ?></a>
								<a class="install-plugins__btn install-plugins__btn--bundle" href="<?php echo esc_url( STOREFRONT_ECOMMERCE_BUY_BUNDLE ); ?>" target="_blank"><?php esc_html_e( 'Buy Bundle at $99', 'storefront-ecommerce' ); ?></a>
							</div>
						</div>
					</div>
				</div>
				<div class="dashboard__blocks">
					<div class="row">
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Get Support','storefront-ecommerce'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( STOREFRONT_ECOMMERCE_FREE_SUPPORT ); ?>"><?php esc_html_e( 'Free Theme Support','storefront-ecommerce'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Getting Started','storefront-ecommerce'); ?></h3>
							<ol>
								<li><?php esc_html_e( 'Start','storefront-ecommerce'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','storefront-ecommerce'); ?></a> <?php esc_html_e( 'your website.','storefront-ecommerce'); ?> </li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Help Docs','storefront-ecommerce'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( STOREFRONT_ECOMMERCE_FREE_DOC ); ?>"><?php esc_html_e( 'Free Theme Documentation','storefront-ecommerce'); ?></a></li>
							</ol>
						</div>
					</div>
				</div>
			</div>
			<div  id="bwp_setup" class="tabcontent">
				<h2 class="tg-docs-section intruction-title" id="section-4"><?php esc_html_e( '1) Setup Storefront Ecommerce Theme', 'storefront-ecommerce' ); ?></h2>
				<div class="row">
					<div class="theme-instruction-block col-md-7">
						<div class="pad-box">
							<p><?php esc_html_e( 'Need a perfect and professional manager for your store who will effectively oversee all services and products in a well-organized manner? Storefront Ecommerce is the ideal solution for businesses like electronics shops, online retail stores, fashion boutiques, grocery stores, furniture shops, cosmetic stores, jewelry stores, toy stores, home decor shops, gadget stores, and more, including handcraft sellers and Etsy-style online shops. With built-in responsive features and the WooCommerce plugin, this multi-purpose e-commerce platform transforms your offline business into a comprehensive digital marketplace. The clean, sleek, and modern design attracts visitors, while gallery sliders, product grids, and featured sections allow for a professional presentation of your products and services. Whether managing a large electronics shop or a small boutique or even a handcraft store inspired by Etsy, the customization options let you personalize your site to match your unique brand without any coding. Its responsive layout ensures your store looks fantastic on desktops, tablets, and mobile devices, while multilingual support with RTL capabilities helps reach a global audience. By integrating advanced e-commerce features powered by WooCommerce, Storefront Ecommerce provides a seamless shopping experience, making it easy for customers to browse, purchase, and interact with your products. Perfect for selling gadgets, accessories, fashion, or home essentials in a multi-purpose setup, this platform offers all the tools needed to run a successful online store, attract new customers, and boost sales.', 'storefront-ecommerce' ); ?><p><br>
							<ol>
								<li><?php esc_html_e( 'Start','storefront-ecommerce'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','storefront-ecommerce'); ?></a> <?php esc_html_e( 'your website.','storefront-ecommerce'); ?> </l>
								<li><?php esc_html_e( 'Storefront Ecommerce','storefront-ecommerce'); ?> <a target="_blank" href="<?php echo esc_url( STOREFRONT_ECOMMERCE_FREE_DOC ); ?>"><?php esc_html_e( 'Documentation','storefront-ecommerce'); ?></a> </li>
							</ol>
						</div>
					</div>
					<div class="col-md-5">
						<div class="pad-box">
								<img class="logo" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/screenshot.png'); ?>"/>
						</div>
					</div>	
				</div>
			</div>
			<div class="col-md-12 text-block tabcontent"  id="bwp_premium_info">
				<h2 class="dashboard-install-title"><?php esc_html_e( '2) Premium Theme Information.','storefront-ecommerce'); ?></h2>
				<div class="row">
					<div class="col-md-7">
						<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/responsive.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'storefront-ecommerce'); ?>">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Description','storefront-ecommerce'); ?></h3>
							<p class="pad-box-p"><?php esc_html_e( 'Storefront Ecommerce WordPress Theme comes with a simple yet enticing design as the design is the first thing that your visitors will notice. They will then explore your products and services. This theme puts together a great display of your products and is well combined with all the eCommerce features so that your buyers will get the best possible online purchasing experience. It is designed by experienced developers to give you a wonderful online store and this is made possible because of the Woocommece compliance with this theme. Along with online buying options for customers, you will be able to receive payments online. If you want to get a customized website, this Storefront Ecommerce WordPress Theme comes with many easy customization options included in the themes options panel. With these, you will get a personalized look for your store. You can also make the most out of its drag and drop page builder to create customized pages. It features a fully responsive design that will let your website look incredible on multiple devices. It is designed using Bootstrap delivering a powerful design. You will find many useful shortcodes and widgets in the theme. Storefront Ecommerce WordPress Theme can help you create the perfect online store that you have always wished for.', 'storefront-ecommerce' ); ?><p>
						</div>
					</div>
					<div class="col-md-5 install-plugin-right">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Features','storefront-ecommerce'); ?></h3>
							<div class="dashboard-install-benefit">
								<ul>
									<li><?php esc_html_e( 'Car listing Shortcode with category','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Car listing Shortcode','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Multiple image feature for each property with slider.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Brand Listing Section','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Car Brand(categories) Option','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Car Tags(categories) Option','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Testimonial listing.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Testimonial shortcode.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Social icons widget.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Latest post with the image widget.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Live customize editor for the About US section.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Font Awesome integrated.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Advanced Color options and color pallets.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( '100+ Font Family Options.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Enable-Disable options on All sections.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Well sanitized as per WordPress standards.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Allow to set site title, tagline, logo.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Sticky post & Comment threads.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Left and Right Sidebar.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Customizable Home Page.','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Footer Widgets & Editor style','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Gallery & Banner functionality','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Multiple inner page templates','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Full-width Template','storefront-ecommerce'); ?></li>
									<li><?php esc_html_e( 'Custom Menu, Colors Editor','storefront-ecommerce'); ?></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

<?php }?>
