Skip to content

Commit 41ae0da

Browse files
committed
Add better Go to checkout button
1 parent 047a611 commit 41ae0da

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

components/Cart/AddToCartButton.component.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ const AddToCartButton = (props) => {
4141
const { loading, error, data, refetch } = useQuery(GET_CART, {
4242
notifyOnNetworkStatusChange: true,
4343
onCompleted: () => {
44-
console.log('Data from add to cart button: ');
45-
console.log(data);
4644
// Update cart in the localStorage.
4745
const updatedCart = getFormattedCart(data);
4846

@@ -75,7 +73,7 @@ const AddToCartButton = (props) => {
7573
onError: (error) => {
7674
if (error) {
7775
console.log('Error inside add to cart');
78-
//setRequestError(error.graphQLErrors[0].message);
76+
setRequestError(error);
7977
console.log(error);
8078
}
8179
},

components/Cart/CartPage/CartItemsContainer.component.jsx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,18 @@ const CartItemsContainer = () => {
8080
// updateCart={updateCart}
8181
/>
8282
))}
83-
84-
<tr>
85-
<td>
86-
<Link href="/kasse">
87-
<a
88-
className="inline-block px-6 py-3 mt-6 text-xl leading-relaxed uppercase border border-gray-600 border-solid hover:underline"
89-
href="#"
90-
>
91-
gå til kasse
92-
</a>
93-
</Link>
94-
</td>
95-
</tr>
9683
</tbody>
9784
</table>
85+
86+
<div className="mt-4">
87+
<Link href="/kasse">
88+
<button className="px-4 py-2 font-bold bg-white border border-gray-400 border-solid rounded hover:bg-gray-400">
89+
GÅ TIL KASSE
90+
</button>
91+
</Link>
92+
</div>
9893
</div>
94+
9995
) : (
10096
<div className="p-6 mx-auto mt-5">
10197
<h2 className="text-lg">Ingen varer i handlekurven</h2>

0 commit comments

Comments
 (0)