VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: cleoni on October 03, 2014, 11:59:18 AM

Title: Setting a max number of products results in a zero amount order
Post by: cleoni on October 03, 2014, 11:59:18 AM
Hello,
I am setting up a site built with Virtuemart 2.60, I have noticed the following:

- In a specific product, I have set up a max amount of products that can be put in the cart by editing the Product's details ("Quantity range" fields). The rationale behind is that if one tries to buy say 100 pieces of the item it must be a fake/illegal order, one would contact the company directly for big buys.

Now here's the problem, on the product page, it turns out that I can select a high number of items and put them in the cart (that is, the operation is permitted, I would say it was not)
And here'a an ever stranger effect: the displayed price for the 100 pieces is blank (and not 100 x unit price) and if you try to close the order then VM will not say it is not permitted (as it should) and neither ask for payment method as it does normally, but simply it accepts it as an order which is put in Waiting state.

Is my template buggy or did I miss a configuration on VM behaviour?
Any ideas?
Title: Re: Setting a max number of products results in a zero amount order
Post by: GJC Web Design on October 03, 2014, 15:35:27 PM
you don't mention your site url or your template etc
Title: Re: Setting a max number of products results in a zero amount order
Post by: cleoni on October 03, 2014, 17:53:58 PM
Yes the development site is not publicly accessible, still.

I just hoped someone had tried to use this bultin feature before me and could confirm that at least in his/her install it works. I just need to understand if it's my theme's fault of the plaform's fault.

After inspection of the template (I'm using MJ cart from themeforest) I found absolutely no code on the frontend managing the max-items limits, I am modifying it so that it can handle this feature.
Title: Re: Setting a max number of products results in a zero amount order
Post by: jenkinhill on October 03, 2014, 18:22:16 PM
If you want to make a max limit to purchase of 100 then you should simply enter that value for Maximum Purchase Quantity on the product status page. You could even override the language string in the popup that tells the customer they cannot order that number, and include something like "Call us for a large quantity price".

If you don't see the popup whan you place an order larger than the maximum then your template overrides are incorrect and need editing.
Title: Re: Setting a max number of products results in a zero amount order
Post by: cleoni on October 06, 2014, 11:45:20 AM
Thank you.

I confirm that the template override managing the cart was not considering at all that field and so I had to patch it.

I thought there was an option somewhere asking "If the quantity > max purchase..." (o) Accept order (o) Refuse order

but now I see it's simply that my template does not perform all the validations it should.

Thanks again