We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c2c274 commit 934ce85Copy full SHA for 934ce85
src/actions/CartActions.js
@@ -7,7 +7,7 @@ import { createCustomerCart } from './RestActions';
7
export const addCouponToCart = (couponCode) => async (dispatch, getState) => {
8
dispatch({ type: types.MAGENTO_COUPON_LOADING, payload: true });
9
try {
10
- const cartId = getState().cart?.cartId;
+ const cartId = getState().cart?.cartId || getState().cart?.quote?.id;
11
let totals;
12
if (magento.isCustomerLogin()) {
13
await magento.admin.addCouponToCart(cartId, couponCode);
0 commit comments