It would be nice to specify which page the cart would redirect per product class.

for example, if a customer purchases a role, I would like my customers to be redirected to a certain welcome page or new product page as opposed to the cart.

Comments

rszrama’s picture

Status: Active » Closed (works as designed)

That's what this module does, just when the item is added to the cart instead of after checkout. Remember, just b/c they've added a product with a role promotion to the shopping cart doesn't mean they're going to buy it.

FranCarstens’s picture

Hi Ryan,

I was trying to find the same thing. I only have 4 options under Features:

  1. Global Default
  2. Cart view page
  3. Checkout Form
  4. No redirect

I find no place to add a custom URL to redirect to. Am I missing something or is there a hidden setup page for this module?

!! EDIT !!

Okay, by hacking the actual module I was able to add my own options. Not sure if this is the way it's meant to be done but here goes:

Around Line#86

// Submit handler for the add to cart form to process after the normal handler.
function uc_atctweaks_add_to_cart_post_submit($form, &$form_state) {
  if (!empty($form_state['values']['atctweaks_data'])) {
    $data = $form_state['values']['atctweaks_data'];

    switch ($data->redirect) {
      case 'cart':
        $form_state['redirect'] = 'cart';
        break;
      case 'checkout':
        $form_state['redirect'] = 'cart/checkout';
        break;
	case 'logo_add_on':                                           // MY OWN CUSTOM LINES //
        $form_state['redirect'] = 'content/logo-add';          // MY OWN CUSTOM LINES //
        break;				                             // MY OWN CUSTOM LINES //
      case 'none':
        $form_state['redirect'] = 'node/'. $form_state['values']['nid'];
        break;
      case 'global':
      default:
        break;
    }
  }
}

As well as

Around Line#197

 $form['redirect'] = array(
    '#type' => 'radios',
    '#title' => t('Add to cart form redirect'),
    '#options' => array(
      'global' => t('Global default'),
      'cart' => t('Cart view page'),
      'logo_add_on' => t('Logo Add-on'),  // MY OWN CUSTOM LINE //
      'checkout' => t('Checkout form'),
      'none' => t('No redirect'),
    ),
    '#default_value' => $data ? $data->redirect : 'global',
  );

Cheers!
Francois.