VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: 6.522 on April 06, 2022, 15:55:58 PM

Title: limit the number of products a user can buy
Post by: 6.522 on April 06, 2022, 15:55:58 PM
Hello, is there a plugin that lets you limit the number of products a user can buy? For example one product per user?
Regards
Title: Re: limit the number of products a user can buy
Post by: pinochico on April 06, 2022, 15:58:51 PM
maybe AWO?
Title: Re: limit the number of products a user can buy
Post by: 6.522 on April 06, 2022, 16:04:31 PM
Quote from: pinochico on April 06, 2022, 15:58:51 PM
maybe AWO?

You mean AwoCoupon?
Title: Re: limit the number of products a user can buy
Post by: pinochico on April 06, 2022, 16:05:47 PM
yep
Title: Re: limit the number of products a user can buy
Post by: 6.522 on April 06, 2022, 16:19:05 PM
Quote from: pinochico on April 06, 2022, 16:05:47 PM
yep

hmm how can we achieve that?
Title: Re: limit the number of products a user can buy
Post by: pinochico on April 06, 2022, 16:20:37 PM
what say support?
Title: Re: limit the number of products a user can buy
Post by: 6.522 on April 06, 2022, 16:41:48 PM
did't ask ;) but I'm using it (AwoCoupon) and personally don't see an option to achieve that.. but maybe I'm missing something
Title: Re: limit the number of products a user can buy
Post by: Studio 42 on April 07, 2022, 10:51:22 AM
You can set Maximum Purchase Quantity in the product settings
Title: Re: limit the number of products a user can buy
Post by: 6.522 on April 07, 2022, 11:45:49 AM
yes but user can make another order and buy the product again ;) so this will work only partiary
Title: Re: limit the number of products a user can buy
Post by: Jumbo! on April 07, 2022, 15:55:55 PM
In that case, you have to manage it using a custom plugin.
Title: Re: limit the number of products a user can buy
Post by: GJC Web Design on April 07, 2022, 19:43:59 PM
code a plugin triggered by the addtocart to check if the current logged user has already this pid in their history .. if so display an error message
Title: Re: limit the number of products a user can buy
Post by: Studio 42 on April 07, 2022, 23:45:21 PM
It's not possible to full prevent a use to buy more then 1 using any trick
You create a new account and buy again using this account and voila.
Even checking the IP is not safe, because you can use different mobile phones
Use my solution and add a warning in the product that you do not delivery this product more then 1 time
Title: Re: limit the number of products a user can buy
Post by: GJC Web Design on April 08, 2022, 11:42:42 AM
QuoteYou create a new account and buy again using this account and voila.

unless u use a "private" shop .. i.e. all registrations are invite or admin approved
Title: Re: limit the number of products a user can buy
Post by: 6.522 on April 08, 2022, 17:32:57 PM
well you are both right actually ;) Studio 42 pointed out correctly that creating second account would allow to make another order.. but it's not my case because  - as GJC Web Design wrote - all users on my site must be approved by Admin so creating a plugin according the the GJC Web Design instructions would do its job :)
unfortunately my coding skills are not very hmm sophisticated ;) what would be the estimated cost of such a plugin?
Title: Re: limit the number of products a user can buy
Post by: Studio 42 on April 08, 2022, 19:16:50 PM
For the creation of the plugin, it depends on the options you need.
Eg. If the quantity is still 1, then checking all old orders is the only query to write
Do you need to check all products or just some?
Do you need a category as a filter (then you can create a query using a specific category (unpublished)
Basic code for a plugin + package requires 4 hours
Each option is 1/2 to 1 hour.
So minimum 150€ but can be 200€(or more, if you need more options)
Title: Re: limit the number of products a user can buy
Post by: 6.522 on April 09, 2022, 14:26:50 PM
thanks for the info, I will pass it on to the client and we will see what he decides :)
regards