You are here

function dc_ajax_add_cart_command_html in Commerce Ajax Add to Cart 7

Same name and namespace in other branches
  1. 7.2 dc_ajax_add_cart.module \dc_ajax_add_cart_command_html()

Creates a Ajax 'replace' command.

This command is specifically for dc_ajax_add_cart module. Unlike `ajax_command_replace()`, this command will not produce extra div wrapper with 'display: block' style.

This command is implemented by Drupal.ajax.prototype.commands.dc_ajax_add_cart_html () defined in js/dc_ajax_add_cart_html.js.

Parameters

string $selector: A jQuery selector string. If the command is a response to a request from an #ajax form element then this value can be NULL.

string $html: The data to use with the jQuery replaceWith() method.

Return value

array An array suitable for use with the ajax_render() function.

3 calls to dc_ajax_add_cart_command_html()
dc_ajax_add_cart_ajax_cart_form in ./dc_ajax_add_cart.module
AJAX-ify the product add to cart.
dc_ajax_add_cart_remove_commerce_line_item in ./dc_ajax_add_cart.module
Menu callback: Removes the product item from cart.
dc_ajax_add_cart_update_quantity_refresh in ./dc_ajax_add_cart.module
Callback that will update the quantity of line item.

File

./dc_ajax_add_cart.module, line 820
Ajax add to cart module.

Code

function dc_ajax_add_cart_command_html($selector, $html) {
  return array(
    'command' => 'dc_ajax_add_cart_html',
    'selector' => $selector,
    'data' => $html,
  );
}