<?php

add_action( 'admin_menu', 'shopping_solution_gettingstarted' );
function shopping_solution_gettingstarted() {    	
	add_theme_page( esc_html__('About Theme', 'shopping-solution'), esc_html__('Theme Demo Import', 'shopping-solution'), 'edit_theme_options', 'shopping-solution-guide-page', 'shopping_solution_guide');   
}

function shopping_solution_admin_theme_style() {
   wp_enqueue_style('shopping-solution-custom-admin-style', esc_url(get_template_directory_uri()) . '/inc/dashboard/get_started_info.css');
   wp_enqueue_script('shopping-solution-tab', esc_url( get_stylesheet_directory_uri() ) . '/inc/dashboard/js/get_started_tab.js');
   wp_enqueue_script('shopping-solution-bundle-banner', get_template_directory_uri() . '/inc/dashboard/js/bundle_banner.js', array(), false, true);

   // Admin notice code START
	wp_register_script('shopping-solution-notice', esc_url(get_stylesheet_directory_uri()) . '/inc/dashboard/js/notice.js', array('jquery'), time(), true);
	wp_enqueue_script('shopping-solution-notice');
	// Admin notice code END
}
add_action('admin_enqueue_scripts', 'shopping_solution_admin_theme_style');

// Notice after Theme Activation
add_action('admin_notices', 'shopping_solution_notice');

function shopping_solution_notice(){
      // Hide permanently if dismissed
    if ( get_option('shopping_solution_admin_notice') == 1 ) {
        return;
    }
    // Hide ONLY on Get Started page
    if ( isset($_GET['page']) && $_GET['page'] === 'shopping-solution-guide-page' ) {
        return;
    }?>
    <div id="shopping-solution-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 Shopping Solution, You Rock!', 'shopping-solution' ) ?> </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.', 'shopping-solution' ) ?></p>
				<div style="display: grid;">
					<a class="button notice-btn" href="<?php echo esc_url( admin_url( 'themes.php?page=shopping-solution-guide-page' )); ?>"><?php esc_html_e( 'Get Started', 'shopping-solution' ) ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( SHOPPING_SOLUTION_BUY_BUNDLE ); ?>"><?php esc_html_e('Get Bundle', 'shopping-solution') ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( SHOPPING_SOLUTION_LIVE_DEMO ); ?>"><?php esc_html_e('Pro Demo', 'shopping-solution') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( SHOPPING_SOLUTION_BUY_PRO ); ?>"><?php esc_html_e('Upgrade To Pro', 'shopping-solution') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( SHOPPING_SOLUTION_FREE_DOC ); ?>"><?php esc_html_e('Free Doc', 'shopping-solution') ?></a>
				</div>
			</div>
		</div>
	</div>
	<?php 

}

//Hook (VERY IMPORTANT)
add_action('admin_notices', 'shopping_solution_notice');

// Admin notice code START
add_action('wp_ajax_shopping_solution_dismiss_notice', 'shopping_solution_dismiss_notice');
function shopping_solution_dismiss_notice() {
    update_option('shopping_solution_admin_notice', 1);
    wp_die();
}

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


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

	// Theme info
	$shopping_solution_return = add_query_arg( array()) ;
	$shopping_solution_theme = wp_get_theme( 'shopping-solution' ); ?>

	<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', 'shopping-solution' ); ?></span>
						<h2 class="bwp-bundle-banner__title"><?php esc_html_e( '250+ Premium WordPress Themes in One Bundle', 'shopping-solution' ); ?></h2>
						<p class="bwp-bundle-banner__desc">
							<strong><?php esc_html_e( 'SUMMER SALE!', 'shopping-solution' ); ?></strong>
							<?php esc_html_e( 'Get 15% off on a Bundle of 250+ Premium WP Themes. Use', 'shopping-solution' ); ?>
							<span class="bwp-bundle-banner__coupon-inline">&quot;SUMMER15&quot;</span>
							<?php esc_html_e( 'at Checkout.', 'shopping-solution' ); ?>
						</p>
						<div class="bwp-bundle-banner__actions">
							<a class="bwp-bundle-banner__cta" target="_blank" href="<?php echo esc_url( SHOPPING_SOLUTION_BUY_BUNDLE ); ?>"><?php esc_html_e( 'Get Bundle Just at $99', 'shopping-solution' ); ?><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', 'shopping-solution' ); ?>">
								<span class="bwp-bundle-banner__coupon-label"><?php esc_html_e( 'Coupon Code', 'shopping-solution' ); ?></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!', 'shopping-solution' ); ?></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', 'shopping-solution' ); ?></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="shopping_solution_openCity(event, 'bwp_getstart')"><?php esc_html_e( 'Theme Demo Import', 'shopping-solution' ); ?></button>
				<button role="tab" class="tablinks" onclick="shopping_solution_openCity(event, 'bwp_setup')"><?php esc_html_e( 'Free Theme Information', 'shopping-solution' ); ?></button>
				<button role="tab" class="tablinks" onclick="shopping_solution_openCity(event, 'bwp_premium_info')"><?php esc_html_e( 'Premium Theme Information', 'shopping-solution' ); ?></button>
				<a class="tablinks tablinks-demo" role="tab" href="<?php echo esc_url( SHOPPING_SOLUTION_LIVE_DEMO ); ?>" target="_blank">
					<?php esc_html_e( 'Live Demo', 'shopping-solution' ); ?>
				</a>
				<a class="tablinks tablinks-pro" role="tab" href="<?php echo esc_url( SHOPPING_SOLUTION_BUY_PRO ); ?>" target="_blank">
					<?php esc_html_e( 'Buy Pro', 'shopping-solution' ); ?>
				</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 Shopping Solution ', 'shopping-solution' ); ?>
							<span><?php esc_html_e( 'Version: ', 'shopping-solution' ); ?><?php echo esc_html($shopping_solution_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.', 'shopping-solution' ); ?>
							</span>
							<div class="powered-by">
								<p><strong><?php esc_html_e( 'Theme created by Buy WP Templates', 'shopping-solution' ); ?></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_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...', 'shopping-solution'); ?>" />
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-7">
						<div class="install-plugins">
							<img src="<?php echo esc_url(get_theme_file_uri() . '/inc/dashboard/media/responsive1.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'shopping-solution'); ?>" />
							<div class="install-plugins__actions">
								<a class="install-plugins__btn install-plugins__btn--pro" href="<?php echo esc_url( SHOPPING_SOLUTION_BUY_PRO ); ?>" target="_blank"><?php esc_html_e( 'Get Pro at $39', 'shopping-solution' ); ?></a>
								<a class="install-plugins__btn install-plugins__btn--bundle" href="<?php echo esc_url( SHOPPING_SOLUTION_BUY_BUNDLE ); ?>" target="_blank"><?php esc_html_e( 'Buy Bundle at $99', 'shopping-solution' ); ?></a>
							</div>
						</div>
					</div>
				</div>
				<div class="dashboard__blocks">
					<div class="row">
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Get Support','shopping-solution'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( SHOPPING_SOLUTION_FREE_SUPPORT ); ?>"><?php esc_html_e( 'Free Theme Support','shopping-solution'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Getting Started','shopping-solution'); ?></h3>
							<ol>
								<li><?php esc_html_e( 'Start','shopping-solution'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','shopping-solution'); ?></a> <?php esc_html_e( 'your website.','shopping-solution'); ?> </li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Help Docs','shopping-solution'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( SHOPPING_SOLUTION_FREE_DOC ); ?>"><?php esc_html_e( 'Free Theme Documentation','shopping-solution'); ?></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 Shopping Solution Theme', 'shopping-solution' ); ?></h2>
				<div class="row">
					<div class="theme-instruction-block col-md-7">
						<div class="pad-box">
							<p><?php esc_html_e( 'Shopping Solution is a simple and multi-purpose theme that can be used to build websites for e-commerce, novelty shops, toy shops, gadgets stores, jewelry shops, shopping cart, storefront, boutique, fashion store, dropshipping, inventory management, online store, online marketplace, mobile commerce, shopping experience, digital storefront and many more. This theme is responsive, elegant, and packed with many powerful features to enhance usability and performance. Using this theme, you can develop a website easily and effectively in less time, as it is finely designed to meet modern business needs. This theme provides options like WooCommerce integration, adaptable layouts, user-friendly interface, translation-ready support, Gutenberg compatibility, typography controls, and smooth customization in every aspect of your website. With built-in SEO-friendly and mobile-friendly capabilities, it helps attract more visitors and ensures accessibility from any device. In short, Shopping Solution will surely help you grow and expand your business in all possible ways with a professional and scalable online presence.', 'shopping-solution' ); ?><p><br>
							<ol>
								<li><?php esc_html_e( 'Start','shopping-solution'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','shopping-solution'); ?></a> <?php esc_html_e( 'your website.','shopping-solution'); ?> </li>
								<li><?php esc_html_e( 'Shopping Solution','shopping-solution'); ?> <a target="_blank" href="<?php echo esc_url( SHOPPING_SOLUTION_FREE_DOC ); ?>"><?php esc_html_e( 'Documentation','shopping-solution'); ?></a> </li>
							</ol>
						</div>
				</div>
				<div class="col-md-5">
					<div class="pad-box">
              			<img class="logo" src="<?php echo esc_url(get_theme_file_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.','shopping-solution'); ?></h2>
				<div class="row">
					<div class="col-md-7">
						<img src="<?php echo esc_url(get_theme_file_uri() . '/inc/dashboard/media/responsive.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'shopping-solution'); ?>">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Description','shopping-solution'); ?></h3>
							<p class="pad-box-p"><?php esc_html_e( 'Shopping Solution is a simple and multi-purpose theme that can be used to build websites for e-commerce, novelty shops, toy shops, gadgets stores, jewelry shops, shopping cart, storefront, boutique, fashion store, dropshipping, inventory management, online store, online marketplace, mobile commerce, shopping experience, digital storefront and many more. This theme is responsive, elegant, and packed with many powerful features to enhance usability and performance. Using this theme, you can develop a website easily and effectively in less time, as it is finely designed to meet modern business needs. This theme provides options like WooCommerce integration, adaptable layouts, user-friendly interface, translation-ready support, Gutenberg compatibility, typography controls, and smooth customization in every aspect of your website. With built-in SEO-friendly and mobile-friendly capabilities, it helps attract more visitors and ensures accessibility from any device. In short, Shopping Solution will surely help you grow and expand your business in all possible ways with a professional and scalable online presence.', 'shopping-solution' ); ?><p>
						</div>
					</div>
					<div class="col-md-5 install-plugin-right">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Features','shopping-solution'); ?></h3>
							<div class="dashboard-install-benefit">
								<ul>
									<li><?php esc_html_e( 'Car listing Shortcode with category','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Car listing Shortcode','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Multiple image feature for each property with slider.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Brand Listing Section','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Car Brand(categories) Option','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Car Tags(categories) Option','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Testimonial listing.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Testimonial shortcode.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Social icons widget.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Latest post with the image widget.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Live customize editor for the About US section.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Font Awesome integrated.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Advanced Color options and color pallets.','shopping-solution'); ?></li>
									<li><?php esc_html_e( '100+ Font Family Options.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Enable-Disable options on All sections.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Well sanitized as per WordPress standards.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Allow to set site title, tagline, logo.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Sticky post & Comment threads.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Left and Right Sidebar.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Customizable Home Page.','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Footer Widgets & Editor style','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Gallery & Banner functionality','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Multiple inner page templates','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Full-width Template','shopping-solution'); ?></li>
									<li><?php esc_html_e( 'Custom Menu, Colors Editor','shopping-solution'); ?></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

<?php }?>