2014-07-28 14:50:11 +00:00
< ? php
/**
* Admin View : Page - Addons
2014-10-07 10:04:48 +00:00
*
2020-08-05 16:36:24 +00:00
* @ package WooCommerce\Admin
2015-01-30 14:21:46 +00:00
* @ var string $view
* @ var object $addons
2014-07-28 14:50:11 +00:00
*/
2019-07-04 03:50:40 +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 " >
2015-12-03 13:38:13 +00:00
< ? php if ( $sections ) : ?>
2021-07-30 10:58:51 +00:00
< div class = " marketplace-header " >
< h1 class = " marketplace-header__title " >< ? php esc_html_e ( 'WooCommerce Marketplace' , 'woocommerce' ); ?> </h1>
< p class = " marketplace-header__description " >< ? php esc_html_e ( 'Grow your business with hundreds of free and paid WooCommerce extensions.' , 'woocommerce' ); ?> </p>
< form class = " marketplace-header__search-form " method = " GET " >
< input
type = " text "
name = " search "
value = " <?php echo esc_attr( isset( $_GET['search'] ) ? sanitize_text_field( wp_unslash( $_GET['search'] ) ) : '' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?> "
placeholder = " <?php esc_attr_e( 'Search for extensions', 'woocommerce' ); ?> "
/>
< button type = " submit " >
< span class = " dashicons dashicons-search " ></ span >
</ button >
< input type = " hidden " name = " page " value = " wc-addons " >
< input type = " hidden " name = " section " value = " _all " >
</ form >
</ div >
2017-12-05 16:15:09 +00:00
2019-08-30 17:33:59 +00:00
< ? php if ( isset ( $_GET [ 'search' ] ) ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>
2017-12-05 16:15:09 +00:00
< h1 class = " search-form-title " >
2020-11-10 14:48:11 +00:00
< ? php // translators: search keyword. ?>
2019-09-15 15:27:49 +00:00
< ? php printf ( esc_html__ ( 'Showing search results for: %s' , 'woocommerce' ), '<strong>' . esc_html ( sanitize_text_field ( wp_unslash ( $_GET [ 'search' ] ) ) ) . '</strong>' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>
2017-12-05 16:15:09 +00:00
</ h1 >
< ? php endif ; ?>
2021-07-30 10:58:51 +00:00
2017-12-05 15:06:58 +00:00
< ? php if ( '_featured' === $current_section ) : ?>
2016-09-20 17:42:46 +00:00
< div class = " addons-featured " >
< ? php
$featured = WC_Admin_Addons :: get_featured ();
?>
</ div >
< ? php endif ; ?>
2017-12-05 15:06:58 +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 ; ?>
2020-11-10 14:48:11 +00:00
< ? php if ( 'payment-gateways' === $current_section ) : ?>
2020-11-09 12:19:11 +00:00
< div class = " addons-shipping-methods " >
2020-11-09 12:20:24 +00:00
< ? php WC_Admin_Addons :: output_wcpay_banner_block (); ?>
2020-11-09 12:19:11 +00:00
</ div >
< ? php endif ; ?>
2015-12-03 13:38:13 +00:00
< ul class = " products " >
< ? php foreach ( $addons as $addon ) : ?>
2018-03-05 18:59:17 +00:00
< ? php
if ( 'shipping_methods' === $current_section ) {
2017-06-14 10:24:45 +00:00
// 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 (
2019-07-04 03:50:40 +00:00
$addon -> link ,
'woocommerce.com/products/usps-shipping-method'
2018-03-05 18:59:17 +00:00
)
2017-06-14 10:24:45 +00:00
) {
continue ;
}
if ( 'CA' === $country
&& false !== strpos (
2019-07-04 03:50:40 +00:00
$addon -> link ,
'woocommerce.com/products/canada-post-shipping-method'
2018-03-05 18:59:17 +00:00
)
2017-06-14 10:24:45 +00:00
) {
continue ;
}
}
?>
2015-12-03 13:38:13 +00:00
< li class = " product " >
2019-07-04 03:53:27 +00:00
< a href = " <?php echo esc_attr( WC_Admin_Addons::add_in_app_purchase_url_params( $addon->link ) ); ?> " >
2015-12-03 13:38:13 +00:00
< ? php if ( ! empty ( $addon -> image ) ) : ?>
2017-12-08 13:23:08 +00:00
< span class = " product-img-wrap " >< img src = " <?php echo esc_url( $addon->image ); ?> " /></ span >
2015-12-03 13:38:13 +00:00
< ? 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 : ?>
2019-07-04 03:50:40 +00:00
< ? php /* translators: a url */ ?>
2019-09-07 06:53:33 +00:00
< p >< ? php printf ( wp_kses_post ( __ ( '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
2017-12-05 15:06:58 +00:00
< ? php if ( 'Storefront' !== $theme [ 'Name' ] && '_featured' !== $current_section ) : ?>
2015-12-03 13:38:13 +00:00
< div class = " storefront " >
2019-08-22 11:31:08 +00:00
< a href = " <?php echo esc_url( 'https://woocommerce.com/storefront/' ); ?> " target = " _blank " >< img src = " <?php echo esc_url( WC()->plugin_url() ); ?>/assets/images/storefront.png " alt = " <?php esc_attr_e( 'Storefront', 'woocommerce' ); ?> " /></ a >
2019-07-04 03:50:40 +00:00
< h2 >< ? php esc_html_e ( 'Looking for a WooCommerce theme?' , 'woocommerce' ); ?> </h2>
2019-08-30 17:29:08 +00:00
< p >< ? php echo wp_kses_post ( __ ( 'We recommend Storefront, the <em>official</em> WooCommerce theme.' , 'woocommerce' ) ); ?> </p>
< p >< ? php echo wp_kses_post ( __ ( '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 >
2019-07-04 03:50:40 +00:00
< a href = " https://woocommerce.com/storefront/ " target = " _blank " class = " button " >< ? php esc_html_e ( 'Read all about it' , 'woocommerce' ); ?> </a>
< 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 esc_html_e ( 'Download & install' , 'woocommerce' ); ?> </a>
2015-12-03 13:38:13 +00:00
</ p >
</ div >
2014-12-16 11:43:26 +00:00
< ? php endif ; ?>
2014-05-23 12:54:26 +00:00
</ div >