I'm only implementing anonymous checkout, all works fine. If an anonymous user creates a checkout node, then removes their item from the cart, the checkout node is not deleted. I do have checked "Delete nodes whose creators remove the associated product from their cart". Should this delete the node (with blank status at this point)?

I do have my CA php written so when the same setup successfully goes through checkout, the status is correctly changed to "Completed".

Comments

Now I see that this setting works for logged in customers, which ours are not. I'd like to find a way I can have checkout nodes with a field_status of null, be deleted after a period of time. Ideas?

subscribing

I also found a similar issue when automatic (cron) cleaning of cart, if anonymous, or even authenticated cart duration is reached. Cart is cleared, but nodes remains then as orphans.

Subscribing. Is there any support for this module? So many open issues.

subscribing

I've been trying to work around this with Product Trigges http://drupal.org/project/uc_product_triggers

Basically, with this module, you get more triggers to use in CA, like "Trigger: Product node is removed from cart", so we can then add some custom php code to delete the node.

that's were I am now stuck :(

I'm guessing the code would look something like this http://drupal.org/node/376384#comment-2032176 (getting the id of the node from that has just been removed from the cart, with node_load?) except with node_delete instead of node_save being the end result.

Again, more of a workaround than a fix, let me know if you can help or have other ideas.
cheers,

Priority:Critical» Normal

I've got it working. ugh. Just needed to adjust permissions so users can delete there 'own' node of this type. no work around required (as I mentioned in #6).

Testing to see if this will work when a cart expires, but after seeing it work when a user empties the cart, I'm hopeful.

UPDATE: does not delete the node when the cart expires. Does remove the item, does not delete the node. ugh...

Another thought, I don't think you can give anon users the ability to delete there 'own' nodes... any anon user could then delete any other anon users nodes... just read that somewhere, makes sense no?

Priority:Normal» Critical

subscribing

Priority:Normal» Critical

Having the same issue.
Subscribing.

I've confirmed that the problem for nodes not being deleted when users remove items from their carts is because you need to give them permissions to delete their own (node checkout) related nodes.

About the problem when the cart expires and gets emptied by cron, I've written a fix in http://drupal.org/node/654916#comment-2737854 you can try out.

@Libriana, Thank you! Giving anonymous users permission to delete their own checkout nodes works, it must use the session id.

If the following link is checked, users without the "edit any node" can NOT delete their nodes: "Redirect customers to their cart after adding or editing a node checkout governed node."

The problem is that this settings adds $form['#redirect'] to the node forms but that overrides the delete button, and looking through the Form API I can't figure out how you can get around that :(

I also unchecked "Redirect customers to their cart when they try to view a node governed by node checkout" because it's not fully functional either - when you try to view the node you just created you get an "access denied" page.

The only solution I can find is to set "cart" as the 403 page for drupal. That redirects anyone trying to view a node_checkout node whether they just edited the node or if they are just trying to view the node by itself. Certainly not ideal for obvious reasons but it works for my site.

Does anyone have any better ideas for working with form redirects more appropriately? The module settings are just plain broken.

+1

subscribe

just some information in the description of the setting uc_node_checkout_delete_nodes would be helpfull. maybe something like

<?php
  $form
['behavior']['uc_node_checkout_delete_nodes'] = array(
   
'#type' => 'checkbox',
   
'#title' => t('Delete nodes whose creators remove the associated product from their cart'),
   
'#description' => t('User must have the permission to delete the specified node type in admin/user/permissions'),
   
'#default_value' => variable_get('uc_node_checkout_delete_nodes', TRUE),
  );
?>

Status:Active» Fixed

Added the extra documentation as suggested by uniquename

Thanks

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Status:Closed (fixed)» Active

Would be nice if you could write directely on
admin/store/settings/node-checkout/settings
section "Delete nodes whose creators remove the associated product from their cart."

that on has to grant "delete own content type" permission to get it working