This patch provides a menu item that provides admin panel control for the redirect for anonymous users when the anonymous checkout is disabled. This fixed a very specific problem of redirecting users to user register or during promotions to a splash page registration and then back to the cart, but I made it a little more flexible so that the admin has complete control over this behavior from the cart settings page. Hopefully someone else will find this useful.

This is related to several redirect issues that have been fixed in dev, but answers the problem a bit differently defaulting to the store admin for control of this behavior.

Comments

jpwarren00’s picture

Added issue # and uc sub module to patch.

longwave’s picture

Status: Active » Needs review
longwave’s picture

Would be nice to also control this line at the same time:

drupal_set_message(t('If you do not have an account yet, you should <a href="!url">register now</a>.', array('!url' => url('user/register', array('query' => drupal_get_destination())))));

If you set this new redirect option to user/register, it seems a little silly to show the same thing in a message.

jpwarren00’s picture

Good idea, I doubt our client will think so, but I'll add that into the patch later tonight.

longwave’s picture

Possible improvement for this: radio buttons for "Anonymous checkout redirect":

  • Login page
  • Registration page
  • Custom page (with a textfield to enter the path)

Then we can show appropriate messages to direct the user to registration/login if one of the first options is selected, or no message if the third option is selected.

Status: Needs review » Needs work
tr’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev

If this is put in, it should be added to 7.x-3.x first. Anyone interested in contributing a small patch for this simple feature?

longwave’s picture

Status: Needs work » Active

This is more easily achieved with Rules. You can add a rule for anonymous users viewing /cart/checkout that should fire before Ubercart's own code, and show messages, redirect to different pages, and much more. Perhaps it's worth converting the existing "anonymous checkout" setting to a rule, to make this more obvious.

tr’s picture

Version: 7.x-3.x-dev » 8.x-4.x-dev
Issue summary: View changes