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' ) ) {
exit ; // Exit if accessed directly
}
2014-07-28 14:50:11 +00:00
2014-12-16 11:43:26 +00:00
$view = isset ( $_GET [ 'view' ] ) ? sanitize_text_field ( $_GET [ 'view' ] ) : '' ;
$theme = wp_get_theme ();
2014-11-19 23:36:47 +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 " >
< div class = " icon32 icon32-posts-product " id = " icon-woocommerce " >< br /></ div >
2015-11-27 12:27:27 +00:00
< h1 >
2013-08-06 13:04:24 +00:00
< ? php _e ( 'WooCommerce Add-ons/Extensions' , 'woocommerce' ); ?>
< a href = " http://www.woothemes.com/product-category/woocommerce-extensions/ " class = " add-new-h2 " >< ? php _e ( 'Browse all extensions' , 'woocommerce' ); ?> </a>
2015-11-20 07:33:51 +00:00
< ? php WC_Admin_Addons :: output_storefront_button (); ?>
2015-11-27 12:27:27 +00:00
</ h1 >
2014-03-06 15:25:05 +00:00
< ? php if ( $addons ) : ?>
< ul class = " subsubsub " >
< ? php
$links = array (
'' => __ ( 'Popular' , 'woocommerce' ),
'payment-gateways' => __ ( 'Gateways' , 'woocommerce' ),
'shipping-methods' => __ ( 'Shipping' , 'woocommerce' ),
'import-export-extensions' => __ ( 'Import/export' , 'woocommerce' ),
'product-extensions' => __ ( 'Products' , 'woocommerce' ),
'marketing-extensions' => __ ( 'Marketing' , 'woocommerce' ),
2014-05-23 12:54:26 +00:00
'accounting-extensions' => __ ( 'Accounting' , 'woocommerce' ),
2014-05-19 11:53:15 +00:00
'free-extensions' => __ ( 'Free' , 'woocommerce' ),
'third-party-extensions' => __ ( 'Third-party' , 'woocommerce' ),
2014-03-06 15:25:05 +00:00
);
2013-08-06 13:04:24 +00:00
2014-03-06 15:25:05 +00:00
$i = 0 ;
2013-08-06 13:04:24 +00:00
2014-03-06 15:25:05 +00:00
foreach ( $links as $link => $name ) {
$i ++ ;
?> <li><a class="<?php if ( $view == $link ) echo 'current'; ?>" href="<?php echo admin_url( 'admin.php?page=wc-addons&view=' . esc_attr( $link ) ); ?>"><?php echo $name; ?></a><?php if ( $i != sizeof( $links ) ) echo ' |'; ?></li><?php
}
?>
</ ul >
< br class = " clear " />
2014-05-19 11:53:15 +00:00
< ul class = " products " >
< ? php
switch ( $view ) {
case '' :
$addons = $addons -> popular ;
break ;
case 'payment-gateways' :
$addons = $addons -> { 'payment-gateways' };
break ;
case 'shipping-methods' :
$addons = $addons -> { 'shipping-methods' };
break ;
case 'import-export-extensions' :
$addons = $addons -> { 'import-export' };
break ;
case 'product-extensions' :
$addons = $addons -> product ;
break ;
case 'marketing-extensions' :
$addons = $addons -> marketing ;
break ;
case 'accounting-extensions' :
$addons = $addons -> accounting ;
break ;
case 'free-extensions' :
$addons = $addons -> free ;
break ;
case 'third-party-extensions' :
$addons = $addons -> { 'third-party' };
break ;
}
foreach ( $addons as $addon ) {
echo '<li class="product">' ;
echo '<a href="' . $addon -> link . '">' ;
if ( ! empty ( $addon -> image ) ) {
echo '<img src="' . $addon -> image . '"/>' ;
} else {
echo '<h3>' . $addon -> title . '</h3>' ;
}
echo '<span class="price">' . $addon -> price . '</span>' ;
echo '<p>' . $addon -> excerpt . '</p>' ;
echo '</a>' ;
echo '</li>' ;
}
?>
</ ul >
2014-03-06 15:25:05 +00:00
< ? php else : ?>
< p >< ? php printf ( __ ( 'Our catalog of WooCommerce Extensions can be found on WooThemes.com here: <a href="%s">WooCommerce Extensions Catalog</a>' , 'woocommerce' ), 'http://www.woothemes.com/product-category/woocommerce-extensions/' ); ?> </p>
< ? php endif ; ?>
2014-12-16 11:43:26 +00:00
< ? php if ( 'Storefront' != $theme [ 'Name' ] ) : ?>
< div class = " storefront " >
< img src = " <?php echo WC()->plugin_url(); ?>/assets/images/storefront.jpg " alt = " Storefront " />
< h3 >< ? php _e ( 'Looking for a WooCommerce theme?' , 'woocommerce' ); ?> </h3>
< p >
< ? php printf ( __ ( 'We recommend Storefront, the %sofficial%s WooCommerce theme.' , 'woocommerce' ), '<em>' , '</em>' ); ?>
</ p >
< p >
< ? php printf ( __ ( 'Storefront is an intuitive & flexible, %sfree%s WordPress theme offering deep integration with WooCommerce and many of the most popular customer-facing extensions.' , 'woocommerce' ), '<strong>' , '</strong>' ); ?>
</ p >
< p >
2015-02-11 17:15:00 +00:00
< a href = " <?php echo esc_url( 'http://www.woothemes.com/storefront/' ); ?> " target = " _blank " class = " button " >< ? php _e ( 'Read all about it' , 'woocommerce' ) ?> </a>
2015-02-11 17:14:03 +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>
2014-12-16 11:43:26 +00:00
</ p >
</ div >
< ? php endif ; ?>
2014-05-23 12:54:26 +00:00
</ div >