masugadesign / link-vault-craft-cms

The Link Vault download link protection plugin for Craft CMS v3.
Other
5 stars 2 forks source link

Question about features #21

Closed zzseba78 closed 1 year ago

zzseba78 commented 2 years ago

Craft Version & Installed Plugin Version
Craft: 3 lastest

Question
I need to implement sales discounts banners, wich will be available until it rich the maximun estimated downloads ( could be an additional field en the entry or plugin custom field ) and with users (previously logged in) download each assets.

I see that this plugin keep the count of downloads, i wanto to know if i'm able to:

If i can achieve this task with the plugin, i would ask to buy a licence to the proyect manager. thanks.

** PD: Oh, if i buy craft 3 licence, then if we update to craft 4 buy a new license is needed?

benjaminkohl commented 2 years ago

This plugin can do all the things you described. I'll address each bullet point individually.

If you supply an Asset element or an asset ID to the Link Vault downloadUrl template variable, the plugin will automatically store the Asset ID in the linkvault_downloads.assetId table column.

{% set url = craft.linkvault.downloadUrl(assetVariable.id) %}

If a user is logged in while they are clicking download links generated by Link Vault, the user's ID is automatically stored in the linkvault_downloads.userId table column.

You can use template conditionals to determine whether or not a download link should be displayed.

{% set totalDownloads = craft.linkvault.downloads.assetId(assetVariable.id).count() %}
{% if totalAssetDownloads < 5 %}
  ... show download link ...
{% endif %}

The plugin itself won't enforce download limits per asset ID so custom development would be required for any existing download links a user might see on a page. To clarify, if a user loads a page that has a download link on it, they will be able to click that link as many times as they want and download the file unless additional development is done to prevent that kind of behavior.

Link Vault URLS appear as hashes so there are no identifying values (ids, filenames, paths, etc) included in the URL.

You can query download records like normal Craft elements using the linkvault.downloads template variable. For "top 5" downloads or similar lists that query records grouped by a particular table column value, use the linkvault.groupCount template variable. The documentation provides a "top 5" example.

craft.linkvault.groupCount(columnName, criteria, orderSort, Limit)

As for upgrading from Craft 3 to Craft 4, you wouldn't need to buy a new license. It would be the same license with the usual annual plugin renewal fees.

zzseba78 commented 2 years ago

@benjaminkohl Hi Benjamin! Loud and clear, thanks for your detailed response, i will submit this to project manager, thank you. I will leave this issue open for now, maybe this information is useful to other users, but of course you can close it when you want. Have a nice day.