Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
tunicI 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.
Comment #3
maximpodorov CreditAttribution: maximpodorov commentedThis 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.
Comment #4
tunic#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?
Comment #5
maximpodorov CreditAttribution: maximpodorov commentedI see two messages:
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
Comment #6
tunicBug confirmed, problem is new Ubercart remove buttons, thanks your feedback!
Comment #7
tunicStable 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.
Comment #8
maximpodorov CreditAttribution: maximpodorov commentedThank you. It works.