I, like others (see #627912: Typo on product removed), don't think it is helpful (indeed I think it is positively confusing) to show a message that something has been removed from the cart. Ideally there would be a configurable option to control this (possibly on a product-by-product basis). I know I should create a patch but I simply don't have the time. Sorry. Here is the relevant snippet if, like me, you are keen not to have this message appear. It's just a stop-gap until I or someone else produces a patch.

function uc_ajax_cart_cart_item( $op, $product ) {
  /* REMOVED
  switch ( $op ) {
    case 'remove':
      if ( variable_get('ajax_cart_message_remove_display', 1 ) )  {
        $message = variable_get('ajax_cart_message_remove', '!product successfully removed from cart.');
        drupal_set_message( t( $message, array('!product' => $product->title )) );
      }
    break;
  }
  */
}

Thanks very much for this module BTW.

Comments

tunic’s picture

Status: Active » Fixed

I think this bug was fixied time ago but this issue didn't get updatd.

There's no option because it doesn't make sense to display that message when order is completed, is confusing, so module never show that message on order completion.

Status: Fixed » Closed (fixed)

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

maximpodorov’s picture

Status: Closed (fixed) » Active

This is definitely the problem. On normal (unajaxified) cart page, I see 2 removal messages per product: one from Ubercart core and one from this module.

tunic’s picture

#3 Can you specify what messages do you see? And what options are you using for UC Ajax Cart? Ubercart version?

In a unajaxified cart page removing an item using checkbox and clicking update I just see two messages, "
successfully removed from cart" and "Your cart has been updated". Both of them come from Ubercart and are ok. Do you see other messages?

maximpodorov’s picture

I see two messages:

//uc_cart.module line 1007
drupal_set_message(t('<strong>!product-title</strong> removed from your shopping cart.', array('!product-title' => $form_state['values']['items'][$item]['title'])));

// uc_ajax_cart.module line 29
$message = variable_get('ajax_cart_message_remove', '!product successfully removed from cart.');
drupal_set_message(t($message, array('!product' => $product->title)));

Versions:
Ubercart - 6.x-2.x-dev (2011-Jun-23)
This version has no checkboxes for item removal. Buttons are used for this instead.
Ubercart ajax cart - 6.x-2.x-dev (2011-Jun-24 )

Variables:
uc_ajax_cart_ajaxify_cart_page = 0
uc_ajax_cart_ajaxify_class = ""
uc_ajax_cart_cart_cached_load = 1
uc_ajax_cart_cart_view = N
uc_ajax_cart_closed = 0
uc_ajax_cart_closed_default = 0
uc_ajax_cart_closed_update = N
uc_ajax_cart_hide_cart_op_msgs = 0
uc_ajax_cart_hide_update_cart_bt = 0
uc_ajax_cart_include_exclude = "0"
uc_ajax_cart_initial_state = N
uc_ajax_cart_pane_effect = 0
uc_ajax_cart_pane_effect_duration = "200"
uc_ajax_cart_registered_users_cart_cached_load = 0
uc_ajax_cart_track_closed_state = 0

tunic’s picture

Bug confirmed, problem is new Ubercart remove buttons, thanks your feedback!

tunic’s picture

Status: Active » Fixed

Stable release do not uses buttons but checkboxes to remove items. So, user must push update button, and Ubercart says 'Your cart has been updated', along with UC Ajax Cart '
successfully removed from cart'. This is ok. But with new remove button Ubertcart adds the produt name to message when removing items, and UC Ajax Cart adds its own message, so message is duplicated.

Fix has been committed to dev. Tryies to detect if a remove button has been pushed or it's just the classic update button with the remove checkboxes. I've tested it in several scenarios and seems to work fine.

maximpodorov’s picture

Thank you. It works.

Status: Fixed » Closed (fixed)

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