Attached image shows the new layout.

CommentFileSizeAuthor
uc_node_checkout_1.patch2.18 KBamitaibu
Snap1.png9.72 KBamitaibu

Comments

rszrama’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Status: Needs review » Postponed (maintainer needs more info)

Hmm... so, what this does is make it so there's still a link to the product node. The original use case for this was that we didn't want that to happen... however, I totally understand your point here. I feel the settings page is pretty complex as is, but that doesn't mean I'm totally opposed to more options.

It seems like this option would be most useful if it also altered the add to cart form on the product page so that submitted the button actually sent the customer to the node add form for the associated node type. Or perhaps I wasn't clear on your screenshot and you're actually making both the node title link and the node checkout node link (in the attributes section) both point to the node checkout node edit page.

vivianspencer’s picture

I'm actually looking for a way to alter the add to cart form on the product page so that the submitted button redirects the customer to the node add form for the associated node type.

Could you maybe give me a clue as to how I'd go about this maybe using hook_form_alter

vivianspencer’s picture

I found out how to redirect the add to cart button and I thought I'd post how I did it here.

I used hook_add_to_cart, please note I've only tested this in Drupal 5.16

function uc_node_checkout_mods_add_to_cart($nid, $qty, $data) {
  $query = db_fetch_object(db_query('SELECT type FROM {uc_node_checkout_types} WHERE product_nid = %d', $nid));
  if ($query) { // if this product is a node checkout product
    if ($_GET['q'] !== 'node/add/'. $query->type) { // if this is not the node add form
      drupal_goto('node/add/'. $query->type);
      $result[] = array(
        'success' => FALSE,
        'message' => t('Redirecting to node/add/'. $query->type),
        'silent' => TRUE,
      );
    }
  }
  return $result;
}