UC Ajax cart feedback messages on cart operations can't be customized. This is due those messages come from different sources: from Ubecart, from UC AJax Cart module or from the JS UC Ajax Cart Layer.

The ajax cart operations flow is:
- An ajax petition is done to server
- uc_ajax_cart_callback routes the petition to the right function. Usually implies to call drupal_execute_form on an Ubercart standard form.
- Drupal messages are themed and this is the answer send back to client.

So, customizable messages must ignore those drupal setted messages, check by its own if operation has been ok and send back to client the appropiate message. AFAIK Ubercart don't offer this check in its API, so it must be done manually.

One way could be check cart contents before and after operation, but this is more expensive and module must know all operation logic to check results.

See #1047188: How to replace the text strings in $settings for more info.

Comments

stewart.adam’s picture

Status: Active » Fixed

I have added message customization in the latest dev release. Note that now the second popup containing the Drupal system messages is only displayed if there is content. This means if you disable the cart messages in the Ubercart cart module's settings (and disable cart link product information messages if you have uc_cart_links enabled) then the second popup won't appear at all unless there is an error, and the user will only see the customizable message of your choice.

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