Contribution Date
Technology
Contribution Project
Contribution Details
You are concerned about this part of the module:
// Hide cart if it is empty.
if ($hide_empty_cart) {
$block['content'] = theme('html_tag', array(
'element' => array(
'#tag' => 'div',
'#value' => '',
'#attributes' => array(
'class' => 'ajax-shopping-cart-wrapper',
),
),
));
}
else {
$block['content'] = '<div class="ajax-shopping-cart-wrapper">';
$block['content'] .= theme('dc_ajax_shopping_cart', array(
'order' => $commerce_cart['order'],
'line_items' => $line_items,
'quantity' => $quantity,
'total' => $total,
));
$block['content'] .= '</div>';
drupal_add_library('system', 'drupal.ajax', TRUE);
}
We need drupal_add_library('system', 'drupal.ajax', TRUE);
so as to ajaxify the "Remove from cart" link. And this link is only going to appear if there is a product in the cart. And suppose there is a product in cart, then Drupal ajax library is going to be added in the page.
This is a vanilla Drupal + Commerce installation, there is no product in cart, and there are no JS errors.
Please mention the steps so that I can replicate the problem.
Contribution Issue Link
Files count
0
Patches count
0