it is possible to change the value back into a false value on the cart screen

CommentFileSizeAuthor
#3 qtyupdate.patch1.69 KBOfflein
#4 qtyupdate-2.patch572 bytesOfflein
#10 qtyupdate-3.patch3.11 KBOfflein

Comments

fred0’s picture

I'm not sure what you are asking. Can you elaborate?

arski’s picture

Hi,

I assume he means that when you're in the cart you can change the quantity value to something that is outside the min/max range. It is true that when you click on "checkout" an error is shown and you are prompted to adjust the quantities, but it would make so much more sense if this weren't possible in the first place - i.e. if someone tried to set the quantity to some value that is outside the min/max range an error would be shown that that is simply not possible.

This should be very easy to implement I guess - instead of (or "in addition to") having a validator that gets called when the "checkout" button is pressed, a similar validator could be added to the "update cart" button.

Would be a very nice addition.

Thanks a lot in advance,

Martin

Offlein’s picture

StatusFileSize
new1.69 KB

Hi, I rolled a patch for this. What it does is hook_form_alter the update form on the View Cart page, and add a uc_product_minmax special validation function, which is almost the same as the other one. If it senses something amiss, it will return the form in error.

Someone should test this now.

[Edit: Please don't use this patch. Use the patch in #10]

Offlein’s picture

Title: Still able to change quantity in checkout or add same product multiple times » able to change quantity in checkout
StatusFileSize
new572 bytes

Hi, actually, I realized there was a problem with the patch - if the new quantity is less than 1 (that is, "0" or a negative number) it should still "go through" because Ubercart will then delete the item. This patch includes that.

[Edit: please don't use this patch. Use the patch in #10]

arski’s picture

Status: Active » Needs review

Works good for me - thanks.

fred0’s picture

I will review this as soon as I get a chance. I started a new full time gig last week and am somewhat consumed with that. As mentioned in the description, this module was originally a blending of two different modules. Because of that, there is still some stuff to clean up.

Offlein’s picture

Thanks fred0. Let me know if there's anything I can do to help?

PeGo’s picture

Assigned: Unassigned » PeGo

Can someone please offer step by step instructions on where and how to apply the above patch from Offlein's post.

Thanks!

Offlein’s picture

Assigned: PeGo » Unassigned

PeGo, visit here: http://drupal.org/patch/apply

And specifically, if you have Shell access to your server (and assuming it's a Unix-based server) you need to download my patch, put it in the same directory as this module, and browse to that directory. Once there, type
patch -p0 < qtyupdate-2.patch

And as long as you were using the same version as me (the latest release) it should have no problem detecting what file my patch is supposed to change and modifying that file.

Offlein’s picture

Title: able to change quantity in checkout » Still able to change quantity in checkout or add same product multiple times
StatusFileSize
new3.11 KB

I actually made a new patch; I had another problem with the module.

You are able to add the same product multiple times. The module currently only checks to see that you aren't adding too much all at once. But say your maximum is 1, and you add your one product to the cart. If you clicked back and added it again, you would have two. ..A disASTER!

So, now if the module reports that you are not adding too many at once, it then checks your cart to see if it already exists and, if it does, to make sure that you are not doing something illegal.

PeGo, if you already used my old patch, you should revert to the original file. This is based off the most recent 6.x-1.x-dev release. You should be able to use the same command from before (Except use the new qtyupdate-3.patch filename!)

Alaska’s picture

Title: able to change quantity in checkout » Checkout seems to be working as it should with the January 27th download
Priority: Critical » Minor
Status: Needs review » Active

Running the January 27, 2010 version 6.x 1.x-dev. Is your patch 3 included in this download?

Running D 6.16 and Uber 2.2.

Ran the above without the patch. Set the inventory at 1. If the Qty field is changed to 2, the checkout button is disabled and a message is displayed "The maximum is one..."

Tried the 'continue shopping' button and added the same produce once again. And yes the Qty will be changed to 3. However, the checkout button will not function and the warning message is once again displayed. If the Qty is changed to 1 then the checkout button is active and the purchase is processed.

From what I can tell all is working as it should. If not, what will change with the new patch made on Feb 25th?

However, it would appear that if someone else purchased the same product (of which only 1 is available) their purchase would be completed. But, from what I gather, that is not the purpose of this module.

fred0’s picture

Status: Active » Closed (works as designed)

Marking closed since reports indicate that the module works as it should.