Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Module doesn't work as there is a typo in the declaration of the hook_uc_add_to_cart() , which is being called hook_add_to_cart() as it was in Drupal 6. Also the database query is done D6 style and fails.
I'll attach a patch
Comment | File | Size | Author |
---|---|---|---|
#16 | uc_restrict_qty-port_to_D7-707484-16.patch | 19.15 KB | RaulMuroc |
#15 | uc_restrict_qty.module.take2_.txt | 13.29 KB | webservant316 |
#13 | uc_restrict_qty.module.txt | 13.24 KB | webservant316 |
#2 | uc_restrict_qty-2144385.patch | 1007 bytes | rlustemberg |
Comments
Comment #1
rlustemberg CreditAttribution: rlustemberg commentedComment #2
rlustemberg CreditAttribution: rlustemberg commentedComment #3
rlustemberg CreditAttribution: rlustemberg commentedComment #4
DrCord CreditAttribution: DrCord commentedThe patch did not work. I still get a WSOD anytime I try to add a restriction.
Comment #5
Northern_Girl CreditAttribution: Northern_Girl commentedHi,
I have got the same problem : when I try to add a "number restriction" (for selling roles), I end up with a WSOD.
Can the number of items in the cart be controlled with Rules? If so, how?
Thanks.
NG.
Comment #6
RaulMuroc CreditAttribution: RaulMuroc commented+1
Comment #7
pitxels CreditAttribution: pitxels commentedSo I got this in error_log:
PHP Fatal error: Call to undefined function dpm() in ****/sites/all/modules/uc_restrict_qty/uc_restrict_qty.module on line 165
So I removed this dpm($form_state); function and i'm not getting WSOD anymore.
Not sure what is that function for....
Comment #8
pitxels CreditAttribution: pitxels commentedAnyway there are more errors, I wonder why is this 7.x version is marked as stable.
Comment #9
Jaypan CreditAttribution: Jaypan commentedYeah, the D7 branch is basically unusable.
Comment #10
webservant316 CreditAttribution: webservant316 commentedI really need this module to work. Are there any alternatives since this does not appear to work?
Comment #11
nonsieI've started a sandbox project that has most of the code cleaned up and updated from D6 - https://www.drupal.org/sandbox/nonsie/2373399
Once it is fully functional I hope that it can be merged into this project for a D7 release.
Comment #12
webservant316 CreditAttribution: webservant316 commentedthanks. I posted a few questions over there.
Comment #13
webservant316 CreditAttribution: webservant316 commentedTo get this thing working I need the above patch, plus a handful of other fixes to uc_restrict_qty.module. Sorry, but I do not have the tools to make a git patch, so I have attached the whole uc_restrict_qty.module with my corrections.
Good news is I got it working.
Could someone please properly integrate these fixes into the module and update dev?
Thanks!
Comment #14
ñull CreditAttribution: ñull commented#13 does not work for me. The only thing I see that works is that in cart you no longer can change the quantity of the restricted product, but it still allows to add a quantity that is over the set quantity limit.
Comment #15
webservant316 CreditAttribution: webservant316 commentedSmall problem fixed in my patches to the uc_restrict_qty.module, reattached to this post in whole. Additionally these lines changed to...
Without the additional tweak to my earlier patch there was an error when updating the quantity of the item in the shopping cart when the restrict feature was NOT enabled. However, that now works. And with the restrict feature ENABLED on the product one cannot add quantity in the shopping cart greater than the limit.
This module patch is working fine for me, however my patches are a major hack. Could the maintainer please check out my revisions and integrate them into the module properly, please?
Install uc_restrict_qty.module.take2_.txt as uc_restrict_qty.module and report back to let me know if it works for you.
Comment #16
RaulMuroc CreditAttribution: RaulMuroc commentedAttach patch. Please test.
Comment #17
RaulMuroc CreditAttribution: RaulMuroc commentedApplying latest patch to D7 uc_restrict_qty:
So basically every feature implemented works nicely. There are many thing to improve: documentation, UI messages, more testing, new features.... but for that please open new tickets (I will also for what I see so far).
This for me is RTBC so proceeding.
Comment #18
RaulMuroc CreditAttribution: RaulMuroc commentedComment #19
RaulMuroc CreditAttribution: RaulMuroc commentedCommitted and works. (FFTR = Feel free to re-open).
Comment #20
webservant316 CreditAttribution: webservant316 commentedThanks for converting my changes to a valid patch. I installed the DEV version clean and everything works great for me. Thanks again.
Comment #21
Jaypan CreditAttribution: Jaypan commentedCan you please release this as a full release, considering it wasn't working at all before, and apparently the dev works now?
Comment #22
RaulMuroc CreditAttribution: RaulMuroc commentedTHANK YOU webservant316, a little section has been included for you in "Credentials" ;)
Comment #23
RaulMuroc CreditAttribution: RaulMuroc commented@Jaypan, done.
Comment #24
Jaypan CreditAttribution: Jaypan commentedThanks Raul!
Comment #25
webservant316 CreditAttribution: webservant316 commentedGlad to pitch in. This is an essential module for me!
Comment #26
Jaypan CreditAttribution: Jaypan commentedThanks to you as well Webservant