Hello,
Is it at all possible to limit the amount of digital downloads per month for a membership platform created on Wix?
I look forward hearing from anyone really.
Thank you in advance.
Hello,
Is it at all possible to limit the amount of digital downloads per month for a membership platform created on Wix?
I look forward hearing from anyone really.
Thank you in advance.
Hello. I don’t know if this would be the best way, but it’s the first that came to my mind.
I’m assuming that you will have a custom field in your database for downloads that is connected to your users.
Each time a user clicks a download button, you would need to write a function that checks that field per your criteria and increments OR blocks the download accordingly
ex. if user has less than 20 in the downloads field, allow download and increase count by 1
Then to reset the counters/db field on a schedule, you could write a job that queries all your members and resets the counter to 0 at the beginning of each month.
Thank you, Amanda, much appreciated. After playing with Wix a couple of hours, I came to the same conclusion yesterday, just using the Wix database (called Collections if I am not mistaken).
However now I have a bigger challenge: understanding how to update the prices of items added to the cart. Apparently, there is no endpoint in the Wix APIs to deal with this requirement. Indeed, I will need to maintain 2 different prices for the same item (depending on the logged user type of membership) and I’d like to avoid duplicating records for every item. Instead, I would like to change the value of items only after they’ve been added to the cart, and prior to the checkout, based on the user role.
Do you have any suggestions, perhaps?
Thanks!
Mauro
Glad you got that all worked out!!
As for the other issue, I haven’t done a lot of work with the stores API yet, but could you potentially treat the second price as a “coupon” and then use the apply coupon API to modify the price?
Already tried, thanks. The idea in general works, as you can limit the coupon to some categories only. However it does no fit my use case. I need to allow only a certain number of ‘free’ items per month and the coupon is applied to the entire cart at all instead. So if the coupons set the discount at 100% (that’s it, free item) it applies to the entire cart regardless on the number of items (it checks the category but not the number)…not sure if I explained myself
Okay, last two ideas - there is a backend function where you can update a product. Could you call this to update the product price in the add to cart function?
The only thing with that if it works, is you will want to grab the current price of the product so that you can revert it after the user checks out. I don’t love this solution bc it’s updating the product so if another user were to concurrently try to download the product, it would have a new price if it happened before the revert.
Update Product fields backend
Cart Add Products
The other idea, is you could create and destroy products on the fly as needed
Example: On the add to cart, create a product based on the other one with a price of zero
On checkout, destroy the product.
Remove Product from collection
Create Product
Not the exact same use case as yours, but here is a forum post where a user had to create some custom prices on add to cart which could also help you with ideas
I like the second idea and will explore it, thank you! Perhaps I could take all info of the product being added to the cart by the user, and create a similar one on the fly with different props instead.
The first idea was somehow tempting but too risky, as you said the same product can be (hopefully) purchased by several customers at the same time. This is why I wanted to edit the items in the cart instead, which are instances of the product and not the “blueprint” itself.
Thanks again much appreciated
Awesome! Let me know how it goes and if you get stuck along the way.