Skip to content
This repository was archived by the owner on Mar 15, 2018. It is now read-only.

Commit aba2482

Browse files
committed
mark paid-but-unpurchasable apps as "Unavailable"
1 parent f79bf9d commit aba2482

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

hearth/media/js/apps.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ define('apps',
116116
var device = capabilities.device_type();
117117
if (product.payment_required && !capabilities.navPay && !settings.simulate_nav_pay) {
118118
reasons.push(gettext('Your device does not support payments.'));
119+
} else if (product.payment_required && !product.price) {
120+
reasons.push(gettext('This app is unavailable for purchase in your region.'));
119121
}
122+
120123
if (!capabilities.webApps) {
121124
reasons.push(gettext('Your browser or device is not web-app compatible.'));
122125
} else if (!_.contains(product.device_types, device)) {
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
{% macro market_button(app, classes, data_attrs) %}
2-
{% set price = app.price_locale if app.price and app.price != '0.00' else _('Free') %}
2+
3+
{% if app.payment_required and not app.price %}
4+
{% An app would otherwise cost money in another region but there is no tier in the user's region. %}
5+
{# L10n: This app is unavailable for purchase. %}
6+
{% set price = _('Unavailable') %}
7+
{% else %}
8+
{% set price = app.price_locale if app.price and app.price != '0.00' else _('Free') %}
9+
{% endif %}
10+
311
{% set classes = classes or [] %}
412
<button class="button product install {{ classes|join(' ') }} {{ 'incompatible' if app_incompat(app) }}"
5-
{{ data_attrs|make_data_attrs }}
6-
{{ 'disabled' if app_incompat(app) }}>
13+
{{ data_attrs|make_data_attrs }}
14+
{{ 'disabled' if app_incompat(app) }}>
715
{{ _('Install') if app.user.installed or app.user.purchased else price }}
816
</button>
917
{% endmacro %}

0 commit comments

Comments
 (0)