implement the function in cart page.