Closed (fixed)
Project:
Ubercart
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Aug 2009 at 23:09 UTC
Updated:
6 Sep 2011 at 11:13 UTC
This would be a great way to have people purchase multiple items at once.
Comments
Comment #1
infojunkieIf "Pay Now" is exposed as an action, then yes VBO should pick it up.
I think you should redirect this question to the Ubercart team as I am not familiar with it.
Comment #2
socialnicheguru commentedAny thoughts?
Comment #3
rszrama commentedI don't even nkow what "Pay Now" means, but at least for now in the context of Ubercart, payment is either submitted by the customer during checkout or through an order's payments tab by an administrator. There's no way to do this in bulk.
Comment #4
dwwIf I understand the original request here, it's actually a good idea, and something I would be happy to make use of. ;) I believe the idea is that if you have a table view of products, instead of (or in addition to) a whole bunch of "Buy now" or "Add to cart" buttons in each row of the table, it'd be slick to use a VBO table view with checkboxes, and a single "add all these to my cart" button at the top/bottom of the table. See what I mean?
I believe all this would require on the part of UberCart would be exposing a node action that takes a given node and adds it to the current user's cart. I haven't started looking at the UC code yet, but I'd be shocked if there wasn't a nice function that already does this. So, all it'd take is about 10 lines of actions glue code to expose this as a node action on the site.
Make sense? Now that the request is more clear, any chance the UC devs are interested in supporting such a feature? ;)
Thanks,
-Derek!
Comment #5
rszrama commentedSounds interesting enough, though I'm not sure how practically useful it'd be to most Ubercart users. The API function in question would be uc_cart_add_item(), and it's showing its age... you have to pass FALSE for $check_redirect to prevent a drupal_goto(). : P
So this would require a Drupal core action?
Comment #6
dwwRe: utility:
I can't believe you don't get this request all the time. Imagine you're shopping for not-so-big-ticket items, and you're going to end up with 15 things in your cart. While you've viewing a listing of the products, would you rather click 15 buttons, click "continue shopping" 14 times, and try to remember in your head what's already in your cart as you go down the list? Or, wouldn't it be nicer to just click 15 checkboxes (or perhaps there are exposed views, you can filter to exactly what you want, then click once to select all rows), click "Add these to cart", and then proceed to checkout?
Re implementation:
With VBO, you can either use core actions (which are in theory reusable) or you can define your own custom VBO "operations". Probably better to just make it a core action out of it. It's pretty straight forward, there's an info hook where you declare the action, and then you write a little callback which is invoked when the action fires for a given node, which gets passed in a $context or something so know what node is being acted on, and then you invoke uc_cart_add_item() with the right args.
Thanks for considering it!
-Derek
Comment #7
infojunkieJust a clarification on dww's description of actions in VBO: VBO does not in fact define its own "operations". It reuses core actions declared with
hook_action_info(the sames ones used with the Trigger module for example) as well as node and user operations declared withhook_node_operationsandhook_user_operationsrespectively. I agree with dww, the simplest route is to write an action. You can also consult the VBO development guide which describes the superset of definitions that VBO supports.Comment #8
dwwOh right, I was thinking of the node operations stuff, but I forgot that that's part of core, too. ;) Just a different, parallel system to actions.
Comment #9
scottrigbyhi @infojunkie, @dww, & @rszrama - just curious if there's been any updates on adding multiple products at once (VBO etc) since last fall?
Comment #10
tedbowI need this for a current project I am working on. I am going to write a module to do this for the current project. If anybody knows if this going to be added to Ubercart core I will not release the module.
I have downloaded the dev version of Ubercart to make sure that this not already included. I didn't see it.
The only file I found that implements hook_action_info(necessary for VBO) is uc_taxes.ca.inc. So I assuming is not going to be added.
I am thinking of calling the module uc_vbo_actions(more actions could be added later). Any other ideas?
Comment #11
scottrigby@tedbow: for our needs we made 2 actions: an add_to_cart_action & remove_from_cart_action, which seem to work well - sponsored by the University of Pennsylvania. I didn't even consider a new module because it seemed like a smaller thing. But maybe this would be good? What about just uc_actions.module, since actions can be used for other things besides vbo? I'd be happy to send code, co-maintain or whatever's helpful.
Comment #12
tedbow@scottrigby yes it is very simple thing and code but for some people who don't code at all I think it would be useful. "uc_actions" is probably a better name.
I have already finished the code for what I need but I would appreciate a look at yours. Either attach it here or contact me via my contact form. A co-maintainer would be good.
Comment #13
scottrigby@tedbow heh, yeah i figured but you never know - ok, I'll email for now till we get the module together. Guess we can just keep this queue updated with info on that :)
Comment #14
longwaveuc_views now implements this feature in the 6.x-3.x-dev branch.
Comment #16
Sinan Erdem commentedSorry but there is no 6.x-3.x-dev branch??
Comment #17
Sinan Erdem commentedComment #18
longwaveuc_views 6.x-3.x-dev is definitely available at http://drupal.org/project/uc_views
Comment #19
Sinan Erdem commentedAhh sorry, I thought it was in Ubercart 6.x-3.x. Thanks for informing...