public function RefreshPageElementsHelper::updateCart in Commerce Ajax Add to Cart 8
Updates content inside cart block.
Return value
$this
File
- src/
RefreshPageElementsHelper.php, line 148
Class
- RefreshPageElementsHelper
- Provides methods that would help in refreshing certain page elements.
Namespace
Drupal\dc_ajax_add_cartCode
public function updateCart() {
/** @var \Drupal\Core\Block\BlockPluginInterface $block */
$block = $this
->getCartBlock();
$this->response
->addCommand(new ReplaceCommand('.cart--cart-block', $block
->build()));
return $this;
}