Closed (fixed)
Project:
Ubercart Restrict Qty
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2011 at 10:17 UTC
Updated:
1 Aug 2013 at 01:27 UTC
Jump to comment: Most recent file
Comments
Comment #1
ParisLiakos commentedthis is what i have done so far,against 6.x-2.x-dev
There some warnings left , i think it needs a bit more work
Comment #2
raulmuroc commentedNice job @rootatwc :-)!!
As soon as I can I'll review it (or whoever).
Comment #3
raulmuroc commentedOk tested it. It failed to me. Found errors:
It is looking for *.install, but this module doesn't have that file. :S So it looks like doesn't have sense.
At line 84 of uc_restrict_qty.module it brokes.
Hope the feedback helps to repair. As soon as I can I will contribute to repairing patch but I am full of work and other modules patches and cannot more. Sorry for that and thanks for your effort.
Comment #4
ParisLiakos commented@RaulMuroc, like i stated above,this patch is against 6.x-2.x-dev, not 6.x-1.1
Comment #5
Freakachoo commentedI found errors in patch.
Code:
$models = uc_product_get_models($node);
shouldSbe
$models = uc_product_get_models($node->nid);
Because in ubercart module this function get as argument $nid, not $node
function uc_product_get_models($nid, $add_blank = TRUE) {
Also code:
$key = NULL;
if ($product_qty['rqpid']) {
$key = 'rqpid';
}
Should be:
$key = array();
if ($product_qty['rqpid']) {
$key[] = 'rqpid';
}
Code:
function uc_restrict_qty_cart_item($op, &$item) {
Should be:
function uc_restrict_qty_uc_cart_item($op, &$item) {
Code:
function uc_restrict_qty_add_to_cart_data($form_values) {
Should be:
function uc_restrict_qty_uc_add_to_cart_data($form_values) {
Code:
function uc_restrict_qty_theme() {
return array(
'restrict_qty_field' => array(
'arguments' => arra('form' => null),
),
);
}
Should be:
/**
* Implementation of hook_theme().
*/
function uc_restrict_qty_theme() {
return array(
'restrict_qty_field' => array(
'render element' => 'form',
),
);
}
AND
Code:
// Themes cart Qty. boxes so they can't be changed. (currently not in use)
function theme_restrict_qty_field($element) {
return check_plain($element['#value']);
}
Should be:
// Themes cart Qty. boxes so they can't be changed. (currently not in use)
function theme_restrict_qty_field($variables) {
return check_plain($variables['form']['#value']);
}
Sorry i don't know how to make patch file. :)
Comment #6
Freakachoo commentedOk here is working ported d7 module.
Comment #7
ParisLiakos commentedhere,this will help you with patching:
http://drupal.org/project/uc_restrict_qty/git-instructions
Comment #8
Hendry Lee commented@Freakachoo
Thanks for the ported version. Unfortunately, it doesn't work with UC 3.0. A quick troubleshooting reveals that uc3 no longer uses hook_cart_item or hook_uc_cart_item, so the function uc_restrict_qty_uc_add_to_cart() is never called.
Comment #9
raulmuroc commentedComment #10
jhrizz commentedI too am interested in this. When I try to use rules, it tells me that the Item QTY field is not writable.. Going to see if there is another way to force a qty for a product.
Comment #11
denisr commentedI had a go too, same thing. :(
Comment #12
raulmuroc commentedThins would become easier to port & test to D7 with a nex 7.x-1.x-dev branch.
Thanks in advance.
Comment #13
a.knutson commentedDoes anyone have any plans to port this to D7 UC3? I'm compiling a list of Ubercart related modules and trying to get an idea of what still needs to get ported over.
Thanks in advance!!
Comment #14
raulmuroc commentedI have just contacted the module maintainer to discover if he is considering that way...
Comment #15
Jeffrey C. commentedChanging the issue to the correct category.
Comment #16
raulmuroc commentedI made a petition (again) of a new 7.x-1.x-dev branch and to be co-maintainer if possible.
after that we should spend our energy on make it working.
Until now we have the filre in #6 (thanks @Freakachoo) which just implements the Interface part (see attached image) but it does not do anything at all whaever which option you choose.
Does somebody else want to help? Let me know please.
thank you.
Comment #17
anjjriit commentedI've tested this version, but still found this error
"Notice: Undefined index: restrict_qty in uc_restrict_qty_form_alter() (line 281 of ../sites/all/modules/uc_restrict_qty/uc_restrict_qty.module)."....
my be the order already in chart form before this module installed.
Comment #18
raulmuroc commentedFirst of all we need a new maintainer (and co-maintainer if possible :P).
The current one is so busy that even do not answer mail contact :(
Could you please send some message to him as well?
We also need to open a new branch: 7.x-1.x-dev to commit the ported version and future bug fixes.
Comment #19
raulmuroc commentedThis patch:
- Ports to D7 coming from 6.x-2.x-dev branch.
- Fixes previous bugs.
Comment #20
raulmuroc commentedThe above patch has been committed through the creation of a new Branch for Drupal 7:
7.x-1.x-dev.
Since now we should work on solving bugs, adding new reliable features, etc.
Thank you.
Comment #21
ParisLiakos commentedyou should use spaces, not tabs. see http://drupal.org/coding-standards#indenting
Comment #22
teddymik commentedWill the 7.x-1.x-dev version be uploaded shortly?
Comment #23
raulmuroc commentedIt is currently uploaded as development version.
Feel free to point any bug issue or patch.
Comment #24
diego.paroni commentedOne solution for me is the module "UC Add to Cart Tweaks":
empty the shopping cart when the add to cart form is submitted and alter the add to cart redirect URL to checkout page.
Comment #25
rimu commentedIn UC 3, hook_uc_cart_item has become several functions hook_uc_cart_item_OPERATION where OPERATION is insert, update, delete and presave. See ubercart/uc_cart/uc_cart.api.php for details.
Rather than patch this module, as a fix to @Hendry Lee #8 (getting this module working with UC 3.0), I put this code in a custom module