Skip to content

Commit

Permalink
Remove shop links from plugin details modal
Browse files Browse the repository at this point in the history
  • Loading branch information
mneudert committed Apr 25, 2024
1 parent 884eb59 commit 7bf7418
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 37 deletions.
1 change: 0 additions & 1 deletion plugins/Marketplace/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ public function pluginDetails()
$view->activeTab = $activeTab;
$view->isAutoUpdatePossible = SettingsPiwik::isAutoUpdatePossible();
$view->isAutoUpdateEnabled = SettingsPiwik::isAutoUpdateEnabled();
$view->numUsers = $this->environment->getNumUsers();

return $view->render();
}
Expand Down
47 changes: 11 additions & 36 deletions plugins/Marketplace/templates/plugin-details.twig
Original file line number Diff line number Diff line change
Expand Up @@ -110,42 +110,17 @@
<div class="metadata">
<div class="actionButton">
{% if not plugin.isDownloadable or not isSuperUser %}
{% if hasSomeAdminAccess and plugin.hasExceededLicense is defined and plugin.hasExceededLicense and plugin.consumer %}
{% if plugin.consumer.loginUrl is defined and plugin.consumer.loginUrl %}
<a class="install update"
target="_blank"
rel="noreferrer noopener"
href="{{ plugin.consumer.loginUrl|default('')|e('html_attr') }}"
>{{ 'Marketplace_UpgradeSubscription'|translate }}</a>
{% endif %}

{% elseif not plugin.isDownloadable and plugin.isPaid and plugin.shop is defined and plugin.shop %}

{% if plugin.shop.variations|length %}

<h4 style="color:#5bb75b;font-weight: bold;font-size: 1.2em;">{{ 'Marketplace_TryFreeTrialTitle'|translate }}</h4>
<div class="input-field variationPicker">
<select title="{{ 'Marketplace_ShownPriceIsExclTax'|translate|e('html_attr') }} {{ 'Marketplace_CurrentNumPiwikUsers'|translate(numUsers)|e('html_attr') }}">
{% for variation in plugin.shop.variations %}
<option value="{{ variation.addToCartUrl }}"
title="{{ 'Marketplace_PriceExclTax'|translate(variation.price, variation.currency)|e('html_attr') }} {{ 'Marketplace_CurrentNumPiwikUsers'|translate(numUsers)|e('html_attr') }}"
{% if variation.recommended is defined and variation.recommended %}selected{% endif %}
>{{ variation.name }} - {{ variation.prettyPrice }} / {{ variation.period }}</option>
{% endfor %}
</select>
</div>

<a class="install update addToCartLink" target="_blank"
title="{{ 'Marketplace_ClickToCompletePurchase'|translate|e('html_attr') }}"
rel="noreferrer noopener"
href="{{ plugin.shop.url|default('')|e('html_attr') }}"
>{{ 'Marketplace_AddToCart'|translate }}</a>
{% else %}
<a class="install update" target="_blank"
rel="noreferrer noopener"
href="{% if plugin.shop is defined and plugin.shop and plugin.shop.url %}{{ plugin.shop.url|e('html_attr') }}{% else %}{{ plugin.homepage|e('html_attr') }}{% endif %}"
>{{ 'General_MoreDetails'|translate }}</a>
{% endif %}
{% if hasSomeAdminAccess and plugin.hasExceededLicense is defined and plugin.hasExceededLicense and plugin.consumer and plugin.consumer.loginUrl is defined and plugin.consumer.loginUrl %}
<a class="install update"
target="_blank"
rel="noreferrer noopener"
href="{{ plugin.consumer.loginUrl|default('')|e('html_attr') }}"
>{{ 'Marketplace_UpgradeSubscription'|translate }}</a>
{% else %}
<br />
<br />
<br />
<br />
{% endif %}
{% elseif isSuperUser %}
{% if not isAutoUpdatePossible %}
Expand Down

0 comments on commit 7bf7418

Please sign in to comment.