Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I'm a bit surprised this hasn't been requested yet, but, it would make adding a product "add-to-cart" form to a page a BREEZE. Instead of having to create a view which looks for the add_to_cart form, it could just be picked up as needed. And, for Panels users, it would fall into "Miscellaneous" and be added to a panel with little or no frustration.
I've tried exploring the hook_block()
code, but don't really understand how I can pull the node ID into the block and then call uc_product_add_to_cart_form
.
Any takers?
Willing to put a small bounty on this.
Comments
Comment #1
wjaspers CreditAttribution: wjaspers commentedHere's what I have thus far. GOT IT! The only strange thing is that it doesn't show up in the Core block manager.
For now, I've just plopped this at the bottom of ubercart/uc_product/uc_product.module
EDIT!!!: I realized later that this would best be placed in the uc_cart module file.
Comment #2
wjaspers CreditAttribution: wjaspers commentedComment #3
wjaspers CreditAttribution: wjaspers commentedAnd, for Drupal 7 ... you'll need this code, since
hook_block
is now deprecated.Comment #5
wjaspers CreditAttribution: wjaspers commentedDecided to make a module of it.
Code to follow soon.
http://drupal.org/sandbox/wjaspers/1145762
Comment #6
wjaspers CreditAttribution: wjaspers commentedComment #7
TR CreditAttribution: TR commentedThis issue was improperly reopened due to a bug in the drupal.org upgrade to D7. See #2125263: Issue status not taken from last comment during D7 migration for details.