2014-07-28 14:50:11 +00:00
< ? php
/**
* Admin View : Page - Addons
2014-10-07 10:04:48 +00:00
*
2015-01-30 14:21:46 +00:00
* @ var string $view
* @ var object $addons
2014-07-28 14:50:11 +00:00
*/
2014-07-28 15:16:35 +00:00
if ( ! defined ( 'ABSPATH' ) ) {
2015-12-03 13:38:13 +00:00
exit ;
2014-07-28 15:16:35 +00:00
}
2016-02-23 09:11:02 +00:00
2014-07-28 14:50:11 +00:00
?>
2013-08-06 13:04:24 +00:00
< div class = " wrap woocommerce wc_addons_wrap " >
2017-05-30 16:46:26 +00:00
< nav class = " nav-tab-wrapper woo-nav-tab-wrapper " >
< a href = " <?php echo esc_url( admin_url( 'admin.php?page=wc-addons' ) ); ?> " class = " nav-tab nav-tab-active " >< ? php _e ( 'Browse Extensions' , 'woocommerce' ); ?> </a>
2017-08-28 07:01:01 +00:00
< ? php
2017-08-30 14:19:06 +00:00
$count_html = WC_Helper_Updater :: get_updates_count_html ();
2017-08-28 07:01:01 +00:00
$menu_title = sprintf ( __ ( 'WooCommerce.com Subscriptions %s' , 'woocommerce' ), $count_html );
?>
< a href = " <?php echo esc_url( admin_url( 'admin.php?page=wc-addons§ion=helper' ) ); ?> " class = " nav-tab " >< ? php echo $menu_title ; ?> </a>
2017-05-30 16:46:26 +00:00
</ nav >
2016-10-13 16:34:48 +00:00
2017-05-30 19:26:33 +00:00
< h1 class = " screen-reader-text " >< ? php _e ( 'WooCommerce Extensions' , 'woocommerce' ); ?> </h1>
2016-10-13 16:34:48 +00:00
2015-12-03 13:38:13 +00:00
< ? php if ( $sections ) : ?>
2014-03-06 15:25:05 +00:00
< ul class = " subsubsub " >
2015-12-03 13:38:13 +00:00
< ? php foreach ( $sections as $section_id => $section ) : ?>
2017-03-07 20:24:24 +00:00
< li >< a class = " <?php echo $current_section === $section_id ? 'current' : ''; ?> " href = " <?php echo admin_url( 'admin.php?page=wc-addons§ion=' . esc_attr( $section_id ) ); ?> " >< ? php echo esc_html ( $section -> title ); ?> </a><?php echo ( end( $section_keys ) !== $section_id ) ? ' |' : ''; ?></li>
2015-12-03 13:38:13 +00:00
< ? php endforeach ; ?>
2014-03-06 15:25:05 +00:00
</ ul >
2017-11-27 21:11:55 +00:00
< form class = " search-form " method = " GET " >
< button type = " submit " >
< span class = " dashicons dashicons-search " ></ span >
</ button >
2017-11-28 20:45:55 +00:00
< input type = " text " name = " search " value = " " placeholder = " Enter a search term and press enter " >
2017-11-27 21:11:55 +00:00
< input type = " hidden " name = " page " value = " wc-addons " >
2017-11-29 19:50:38 +00:00
< ? php $page_section = isset ( $_GET [ 'section' ] ) ? $_GET [ 'section' ] : '' ; ?>
< ? php $page_section = 'featured' === $page_section ? '' : $page_section ; ?>
< input type = " hidden " name = " section " value = " <?php echo esc_attr( $page_section ); ?> " >
2017-11-27 21:11:55 +00:00
</ form >
2016-09-20 17:42:46 +00:00
< ? php if ( 'featured' === $current_section ) : ?>
< div class = " addons-featured " >
< ? php
$featured = WC_Admin_Addons :: get_featured ();
?>
</ div >
< ? php endif ; ?>
2017-11-27 21:11:55 +00:00
< ? php if ( 'featured' !== $current_section && $addons ) : ?>
2017-05-31 02:27:36 +00:00
< ? php if ( 'shipping_methods' === $current_section ) : ?>
< div class = " addons-shipping-methods " >
< ? php WC_Admin_Addons :: output_wcs_banner_block (); ?>
</ div >
< ? php endif ; ?>
2015-12-03 13:38:13 +00:00
< ul class = " products " >
< ? php foreach ( $addons as $addon ) : ?>
2017-06-14 10:24:45 +00:00
< ? php if ( 'shipping_methods' === $current_section ) {
// Do not show USPS or Canada Post extensions for US and CA stores, respectively.
$country = WC () -> countries -> get_base_country ();
if ( 'US' === $country
&& false !== strpos (
$addon -> link , 'woocommerce.com/products/usps-shipping-method'
)
) {
continue ;
}
if ( 'CA' === $country
&& false !== strpos (
$addon -> link , 'woocommerce.com/products/canada-post-shipping-method'
)
) {
continue ;
}
}
?>
2015-12-03 13:38:13 +00:00
< li class = " product " >
< a href = " <?php echo esc_attr( $addon->link ); ?> " >
< ? php if ( ! empty ( $addon -> image ) ) : ?>
< img src = " <?php echo esc_attr( $addon->image ); ?> " />
< ? php else : ?>
2016-02-17 18:29:42 +00:00
< h2 >< ? php echo esc_html ( $addon -> title ); ?> </h2>
2015-12-03 13:38:13 +00:00
< ? php endif ; ?>
< span class = " price " >< ? php echo wp_kses_post ( $addon -> price ); ?> </span>
< p >< ? php echo wp_kses_post ( $addon -> excerpt ); ?> </p>
</ a >
</ li >
< ? php endforeach ; ?>
</ ul >
< ? php endif ; ?>
2014-03-06 15:25:05 +00:00
< ? php else : ?>
2016-09-13 11:47:40 +00:00
< p >< ? php printf ( __ ( 'Our catalog of WooCommerce Extensions can be found on WooCommerce.com here: <a href="%s">WooCommerce Extensions Catalog</a>' , 'woocommerce' ), 'https://woocommerce.com/product-category/woocommerce-extensions/' ); ?> </p>
2014-03-06 15:25:05 +00:00
< ? php endif ; ?>
2014-12-16 11:43:26 +00:00
2016-09-20 17:42:46 +00:00
< ? php if ( 'Storefront' !== $theme [ 'Name' ] && 'featured' !== $current_section ) : ?>
2015-12-03 13:38:13 +00:00
< div class = " storefront " >
2016-07-05 22:52:16 +00:00
< a href = " <?php echo esc_url( 'https://woocommerce.com/storefront/' ); ?> " target = " _blank " >< img src = " <?php echo WC()->plugin_url(); ?>/assets/images/storefront.png " alt = " Storefront " /></ a >
2016-02-17 18:29:42 +00:00
< h2 >< ? php _e ( 'Looking for a WooCommerce theme?' , 'woocommerce' ); ?> </h2>
2016-10-27 17:36:24 +00:00
< p >< ? php _e ( 'We recommend Storefront, the <em>official</em> WooCommerce theme.' , 'woocommerce' ); ?> </p>
< p >< ? php _e ( 'Storefront is an intuitive, flexible and <strong>free</strong> WordPress theme offering deep integration with WooCommerce and many of the most popular customer-facing extensions.' , 'woocommerce' ); ?> </p>
2015-12-03 13:38:13 +00:00
< p >
2016-10-27 17:36:24 +00:00
< a href = " https://woocommerce.com/storefront/ " target = " _blank " class = " button " >< ? php _e ( 'Read all about it' , 'woocommerce' ) ?> </a>
2015-12-03 13:38:13 +00:00
< a href = " <?php echo esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-theme&theme=storefront' ), 'install-theme_storefront' ) ); ?> " class = " button button-primary " >< ? php _e ( 'Download & install' , 'woocommerce' ); ?> </a>
</ p >
</ div >
2014-12-16 11:43:26 +00:00
< ? php endif ; ?>
2014-05-23 12:54:26 +00:00
</ div >