Merge Commit

This commit is contained in:
Jonathan Belcher 2017-12-07 12:10:00 -05:00
commit f4d6b6f68f
5 changed files with 345 additions and 38 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -227,7 +227,6 @@
}
.addons-column-block-item {
display: flex;
border-top: 2px solid #f9f9f9;
flex-direction: row;
flex-wrap: wrap;
@ -266,6 +265,18 @@
float: left;
}
.addons-banner-block-item,
.addons-column-block-item {
display: none;
}
.addons-banner-block-item:nth-child(-n+3) {
display: block;
}
.addons-column-block-item:nth-of-type(-n+3) {
display: flex;
}
.addons-small-dark-block {
background-color: #54687d;
text-align: center;

View File

@ -4,7 +4,11 @@ msgid ""
msgstr ""
"Project-Id-Version: WooCommerce 3.3-dev\n"
"Report-Msgid-Bugs-To: https://github.com/woocommerce/woocommerce/issues\n"
<<<<<<< HEAD
"POT-Creation-Date: 2017-12-07 17:02:20+00:00\n"
=======
"POT-Creation-Date: 2017-12-07 16:50:27+00:00\n"
>>>>>>> master
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
@ -6210,23 +6214,37 @@ msgstr ""
msgid "Need a theme? Try Storefront"
msgstr ""
<<<<<<< HEAD
#: includes/admin/class-wc-admin-addons.php:364
#: includes/admin/class-wc-admin-addons.php:535
=======
#: includes/admin/class-wc-admin-addons.php:338
#: includes/admin/class-wc-admin-addons.php:502
>>>>>>> master
#: includes/admin/class-wc-admin-setup-wizard.php:615
msgid "WooCommerce Services"
msgstr ""
<<<<<<< HEAD
#: includes/admin/class-wc-admin-addons.php:365
msgid "Buy discounted shipping labels — then print them from your dashboard."
msgstr ""
#: includes/admin/class-wc-admin-addons.php:366
=======
#: includes/admin/class-wc-admin-addons.php:339
msgid "Buy discounted shipping labels — then print them from your dashboard."
msgstr ""
#: includes/admin/class-wc-admin-addons.php:340
>>>>>>> master
msgid ""
"Integrate your store with USPS to buy discounted shipping labels, and print "
"them directly from your WooCommerce dashboard. Powered by WooCommerce "
"Services."
msgstr ""
<<<<<<< HEAD
#: includes/admin/class-wc-admin-addons.php:367
msgid "Free - Install now"
msgstr ""
@ -6236,16 +6254,35 @@ msgid "Show Canada Post shipping rates"
msgstr ""
#: includes/admin/class-wc-admin-addons.php:377
=======
#: includes/admin/class-wc-admin-addons.php:341
msgid "Free - Install now"
msgstr ""
#: includes/admin/class-wc-admin-addons.php:350
msgid "Show Canada Post shipping rates"
msgstr ""
#: includes/admin/class-wc-admin-addons.php:351
>>>>>>> master
msgid ""
"Display live rates from Canada Post at checkout to make shipping a breeze. "
"Powered by WooCommerce Services."
msgstr ""
<<<<<<< HEAD
#: includes/admin/class-wc-admin-addons.php:478
msgid "Free"
msgstr ""
#: includes/admin/class-wc-admin-addons.php:480
=======
#: includes/admin/class-wc-admin-addons.php:452
msgid "Free"
msgstr ""
#: includes/admin/class-wc-admin-addons.php:454
>>>>>>> master
#: includes/admin/helper/class-wc-helper.php:331
msgid "Installed"
msgstr ""
@ -12797,6 +12834,7 @@ msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:88
msgid "Manage stock"
<<<<<<< HEAD
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:89
@ -13028,6 +13066,239 @@ msgstr ""
msgid "Enable AJAX add to cart buttons on archives"
msgstr ""
=======
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:89
msgid "Enable stock management"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:96
msgid "Hold stock (minutes)"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:97
msgid ""
"Hold stock (for unpaid orders) for x minutes. When this limit is reached, "
"the pending order will be cancelled. Leave blank to disable."
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:111
msgid "Notifications"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:112
msgid "Enable low stock notifications"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:122
msgid "Enable out of stock notifications"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:132
msgid "Notification recipient(s)"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:133
msgid "Enter recipients (comma separated) that will receive this notification."
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:144
msgid "Low stock threshold"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:145
msgid "When product stock reaches this amount you will be notified via email."
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:160
msgid "Out of stock threshold"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:161
msgid ""
"When product stock reaches this amount the stock status will change to "
"\"out of stock\" and you will be notified via email. This setting does not "
"affect existing \"in stock\" products."
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:175
msgid "Out of stock visibility"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:176
msgid "Hide out of stock items from the catalog"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:183
msgid "Stock display format"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:184
msgid "This controls how stock quantities are displayed on the frontend."
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:191
msgid "Always show quantity remaining in stock e.g. \"12 in stock\""
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:192
msgid "Only show quantity remaining in stock when low e.g. \"Only 2 left in stock\""
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:193
msgid "Never show quantity remaining in stock"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:214
msgid "File download method"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:217
#. translators: 1: X-Accel-Redirect 2: X-Sendfile 3: mod_xsendfile
msgid ""
"Forcing downloads will keep URLs hidden, but some servers may serve large "
"files unreliably. If supported, %1$s / %2$s can be used to serve downloads "
"instead (server requires %3$s)."
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:229
msgid "Force downloads"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:230
msgid "X-Accel-Redirect/X-Sendfile"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:231
msgid "Redirect only"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:237
msgid "Access restriction"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:238
msgid "Downloads require login"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:242
msgid "This setting does not apply to guest purchases."
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:248
msgid "Grant access to downloadable products after payment"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:252
msgid ""
"Enable this option to grant access to downloads when orders are "
"\"processing\", rather than \"completed\"."
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:267
msgid "Shop pages"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:273
msgid "Shop page"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:274
msgid ""
"The base page can also be used in your <a href=\"%s\">product "
"permalinks</a>."
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:280
msgid ""
"This sets the base page of your shop - this is where your product archive "
"will be."
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:283
msgid "Shop page display"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:284
msgid "This controls what is shown on the product archive."
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:291
#: includes/admin/settings/class-wc-settings-products.php:306
msgid "Show products"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:292
msgid "Show categories"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:293
msgid "Show categories &amp; products"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:298
msgid "Default category display"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:299
msgid "This controls what is shown on category archives."
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:307
msgid "Show subcategories"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:308
msgid "Show subcategories &amp; products"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:313
msgid "Default product sorting"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:314
msgid "This controls the default sort order of the catalog."
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:321
msgid "Default sorting (custom ordering + name)"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:322
msgid "Popularity (sales)"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:323
#: includes/widgets/class-wc-widget-rating-filter.php:30
msgid "Average rating"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:324
msgid "Sort by most recent"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:325
msgid "Sort by price (asc)"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:326
msgid "Sort by price (desc)"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:331
msgid "Add to cart behaviour"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:332
msgid "Redirect to the cart page after successful addition"
msgstr ""
#: includes/admin/settings/class-wc-settings-products.php:339
msgid "Enable AJAX add to cart buttons on archives"
msgstr ""
>>>>>>> master
#: includes/admin/settings/class-wc-settings-products.php:351
msgid "Measurements"
msgstr ""

View File

@ -24,7 +24,7 @@ class WC_Admin_Addons {
*/
public static function get_featured() {
if ( false === ( $featured = get_transient( 'wc_addons_featured' ) ) ) {
$raw_featured = wp_safe_remote_get( 'https://d3t0oesq8995hv.cloudfront.net/add-ons/featured.json', array( 'user-agent' => 'WooCommerce Addons Page' ) );
$raw_featured = wp_safe_remote_get( 'https://d3t0oesq8995hv.cloudfront.net/add-ons/featured-v2.json', array( 'user-agent' => 'WooCommerce Addons Page' ) );
if ( ! is_wp_error( $raw_featured ) ) {
$featured = json_decode( wp_remote_retrieve_body( $raw_featured ) );
if ( $featured ) {
@ -188,23 +188,25 @@ class WC_Admin_Addons {
<p><?php echo esc_html( $block->description ); ?></p>
<div class="addons-banner-block-items">
<?php foreach ( $block->items as $item ) : ?>
<div class="addons-banner-block-item">
<div class="addons-banner-block-item-icon">
<img class="addons-img" src="<?php echo esc_url( $item->image ); ?>" />
<?php if ( self::show_extension( $item ) ) : ?>
<div class="addons-banner-block-item">
<div class="addons-banner-block-item-icon">
<img class="addons-img" src="<?php echo esc_url( $item->image ); ?>" />
</div>
<div class="addons-banner-block-item-content">
<h3><?php echo esc_html( $item->title ); ?></h3>
<p><?php echo esc_html( $item->description ); ?></p>
<?php
self::output_button(
$item->href,
$item->button,
'addons-button-solid',
$item->plugin
);
?>
</div>
</div>
<div class="addons-banner-block-item-content">
<h3><?php echo esc_html( $item->title ); ?></h3>
<p><?php echo esc_html( $item->description ); ?></p>
<?php
self::output_button(
$item->href,
$item->button,
'addons-button-solid',
$item->plugin
);
?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
@ -249,25 +251,25 @@ class WC_Admin_Addons {
<h1><?php echo esc_html( $block->title ); ?></h1>
<p><?php echo esc_html( $block->description ); ?></p>
<?php foreach ( $block->items as $item ) : ?>
<div class="addons-column-block-item">
<div class="addons-column-block-item-icon">
<img class="addons-img" src="<?php echo esc_url( $item->image ); ?>" />
<?php if ( self::show_extension( $item ) ) : ?>
<div class="addons-column-block-item">
<div class="addons-column-block-item-icon">
<img class="addons-img" src="<?php echo esc_url( $item->image ); ?>" />
</div>
<div class="addons-column-block-item-content">
<h2><?php echo esc_html( $item->title ); ?></h2>
<?php
self::output_button(
$item->href,
$item->button,
'addons-button-solid',
$item->plugin
);
?>
<p><?php echo esc_html( $item->description ); ?></p>
</div>
</div>
<div class="addons-column-block-item-content">
<h2><?php echo esc_html( $item->title ); ?></h2>
<?php
self::output_button(
$item->href,
$item->button,
'addons-button-solid',
$item->plugin
);
?>
<p><?php echo esc_html( $item->description ); ?></p>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
@ -541,4 +543,27 @@ class WC_Admin_Addons {
wp_safe_redirect( remove_query_arg( array( 'install-addon', '_wpnonce' ) ) );
exit;
}
/**
* Should an extension be shown on the featured page.
*
* @param object $item
* @return boolean
*/
public static function show_extension( $item ) {
$location = WC()->countries->get_base_country();
if ( isset( $item->geowhitelist ) && ! in_array( $location, $item->geowhitelist, true ) ) {
return false;
}
if ( isset( $item->geoblacklist ) && in_array( $location, $item->geoblacklist, true ) ) {
return false;
}
if ( is_plugin_active( $item->plugin ) ) {
return false;
}
return true;
}
}