Great module, I did find that it was a little presumptuous that the module assumes that a "main-content" ID will be present in the template.

// Clear status messages if any.
$commands[] = ajax_command_remove('div.messages');

// Show Drupal status message without page refresh.
// @see https://www.drupal.org/node/1271004#comment-7205478
// We are checking the textual status messages so that we can save double
// calling of drupal_get_messages().
$messages = theme('status_messages');

if (!empty($messages)) {
  $commands[] = ajax_command_before('#main-content', $messages);
}

Maybe the message location could be configurable in the CMS?

Comments

RaphaelBriskie created an issue. See original summary.

subhojit777’s picture

Status: Active » Needs work

This has been fixed in 8.x https://git.drupalcode.org/project/dc_ajax_add_cart/blob/8.x-1.x/src/Ref... That needs to be backported to 7.x Patches are welcome.