Conditional layout on cart items

Is there a way to render content only if x product is added to the cart? For example, show box in home page if productId = “1” is added to cart.