Hi

i want refresh(update) "Ajax shopping cart block " after adding commerce_coupon ("drupal.org/project/commerce_coupon) in checkout page, and i don't know how can do it programmatically.

Comments

mimalef70 created an issue. See original summary.

subhojit777’s picture

Status: Active » Closed (won't fix)

You have to do something like this:

function hook_commerce_coupon_add() {
      $content_cart = theme('dc_ajax_shopping_cart', array(
        'order' => $commerce_cart['order'],
        'line_items' => $line_items,
        'quantity' => $quantity,
        'total' => $total,
      ));
$commands[] = dc_ajax_add_cart_command_html('div.ajax-shopping-cart-wrapper', $content_cart);
}

The hook should be called after coupon is added. You have to figure out the hook.


This is feature has a limited a scope, and is not appropriate for the module, so it cannot be added to this module.