It is not 100% intuitive that a donation should simply add the amount to the shopping cart. There should be an option for sending the user straight to checkout after putting in the amount. Most people donating simply want to leave an amount, and not feel as if they are going through an online shop.

This is based on the feedback from a few of my users.

Anyone know how to rewrite the hook for theme_product_donate_view to send the user to checkout instead of reloading same page?

Any guidance on whether this can be added from within the donate.module, or whether it requires some more rewriting of the shopping cart module?

Thanks!

Comments

steffen’s picture

I changed line 129 in donate.module from $form['#action'] = url("donate/cart/$node->nid"); to $form['#action'] = url("cart/checkout");. Quite simple, really.

steffen’s picture

This quickfix obviously didn't work. I'm forwarded to checkout, but the donation is not placed in shopping cart.

If anyone has suggestions, please let me know.

neclimdul’s picture

quick fix, not tested but should work.
Add:

$form['destination'] = array(
      '#type' => 'hidden',
      '#value' => 'cart/checkout',
    );

I might change the layout of the code a little as a larger fix to remove some un-needed logic and to use the form api better but even so, something similar to that would be part of the solution.

steffen’s picture

Thanks! Worked great neclimdul.

lunas’s picture

I tried this and it worked once and then subsequent attempts kept referring me to a page saying my cart was empty. Any idea why?

sime’s picture

Component: donate.module » cart
Status: Active » Fixed

marking fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)