public function CartHandler::deleteCartLine in Mailchimp E-Commerce 8
@inheritdoc
Overrides CartHandlerInterface::deleteCartLine
File
- src/
CartHandler.php, line 200
Class
- CartHandler
- Cart handler.
Namespace
Drupal\mailchimp_ecommerceCode
public function deleteCartLine($cart_id, $line_id) {
try {
$store_id = $this->helper
->getStoreId();
if (empty($store_id)) {
throw new \Exception('Cannot delete a cart line without a store ID.');
}
$this->mcEcommerce
->deleteCartLine($store_id, $cart_id, $line_id);
} catch (\Exception $e) {
//mailchimp_ecommerce_log_error_message('Unable to delete a cart line: ' . $e->getMessage());
$this->messenger
->addError($e
->getMessage());
}
}