Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
fix(cart drawer): on apply/remove coupon item price change (#304)
Browse files Browse the repository at this point in the history
* feat: multi currency

* feat: multi-currency feature

* feat: added multicurrency feature (static)

* feat: pdp: multi currency

* feat: muti-currency refactor

* chore: version upgrade

* feat: added feature to update userfields

* fix: fixed selected variantby options

* fix: cartgetters item price

* refactor: getproducts api method

* fix: login modal popup error

* feat: display discount on cart drawer

* chore: updated shopify version

* chore: remove wishlist function for now (#213)

Co-authored-by: Jeff Paltera <jpaltera@vuestorefront.io>

* fix: incosistent footer (#214)

* chore: update the misaligned margin of components (#215)

* chore: update home padding

* chore: updated margin on whole

* chore: updated margin on whole

* feat: display discount on cart drawer (#230)

* feat: multi currency

* feat: multi-currency feature

* feat: added multicurrency feature (static)

* feat: pdp: multi currency

* feat: muti-currency refactor

* chore: version upgrade

* feat: added feature to update userfields

* fix: fixed selected variantby options

* fix: cartgetters item price

* refactor: getproducts api method

* chore: remove wishlist function for now (#213)

Co-authored-by: Jeff Paltera <jpaltera@vuestorefront.io>

* fix: incosistent footer (#214)

* chore: update the misaligned margin of components (#215)

* chore: update home padding

* chore: updated margin on whole

* chore: updated margin on whole

* fix: login modal popup error

* feat: display discount on cart drawer

* chore: updated shopify version

Co-authored-by: Jeff Paltera <jeffpaltera@gmail.com>
Co-authored-by: Jeff Paltera <jpaltera@vuestorefront.io>

* fix: ssr for crawlers for multilingual

* fix: version upgraded

* refactor: added function for detect country

* fix: ssr for crawlers for multilingual (#231)

* feat: multi currency

* feat: multi-currency feature

* feat: added multicurrency feature (static)

* feat: pdp: multi currency

* feat: muti-currency refactor

* chore: version upgrade

* feat: added feature to update userfields

* fix: fixed selected variantby options

* fix: cartgetters item price

* refactor: getproducts api method

* chore: remove wishlist function for now (#213)

Co-authored-by: Jeff Paltera <jpaltera@vuestorefront.io>

* fix: incosistent footer (#214)

* chore: update the misaligned margin of components (#215)

* chore: update home padding

* chore: updated margin on whole

* chore: updated margin on whole

* fix: login modal popup error

* feat: display discount on cart drawer

* chore: updated shopify version

* fix: ssr for crawlers for multilingual

* fix: version upgraded

* refactor: added function for detect country

Co-authored-by: Jeff Paltera <jeffpaltera@gmail.com>
Co-authored-by: Jeff Paltera <jpaltera@vuestorefront.io>

* chore: add #TechForUkraine

* Update README.md

* feat(cartdrawer): coupon add/remove feature

* feat(cartdrawer): coupon add/remove feature

* fix: suggested changes

* refactor: remove shopify buy deps from createcart & checkout

* refactor: removed shopify buy deps from updatecart

* fix: resolved linter error

* refactor: suggeted changes

* refactor: suggeted changes

* refactor: refactored get country method for getproduct

* refactor: implemented suggested changes

* refactor: implemented suggested changes

* refactor: pdp: related products- disabled add to cart for out of stock products

* refactor: removed any from default query

* fix(PDP): add to cart not working on match with it section

* refactor: updated baseurl->base_url

* refactor: updated baseurl->base_url

* refactor: updated baseurl->base_url

* fix: currency sync between shopify checkout & PWA app

* refactor: tsconfig for nuxtjs/i18n

* fix(cart drawer): on apply/remove coupon item price change

* fix(cart drawer): on apply/remove coupon item price change

Co-authored-by: Jeff Paltera <jeffpaltera@gmail.com>
Co-authored-by: Jeff Paltera <jpaltera@vuestorefront.io>
Co-authored-by: Heitor Ramon Ribeiro <heitor.ramon@gmail.com>
  • Loading branch information
4 people authored Apr 6, 2022
1 parent a0dd7b2 commit 87e05df
Show file tree
Hide file tree
Showing 9 changed files with 655 additions and 616 deletions.
9 changes: 6 additions & 3 deletions packages/api-client/src/api/applyCartCoupon/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { CustomQuery } from '@vue-storefront/core';
import { CustomQuery } from '@vue-storefront/core'
import { gql } from '@apollo/client/core'
import { getCountry } from '../../helpers/utils'
export async function applyCoupon(context, params, _customQuery?: CustomQuery) {
const { currentCart, couponCode } = params;
const DEFAULT_MUTATION = gql`mutation APPLY_COUPON($checkoutId: ID!, $discountCode: String!){
const DEFAULT_MUTATION = gql`mutation APPLY_COUPON($checkoutId: ID!, $discountCode: String!, $country: CountryCode!) @inContext(country: $country ){
checkoutDiscountCodeApplyV2(checkoutId: $checkoutId, discountCode: $discountCode) {
checkout {
appliedGiftCards{
Expand Down Expand Up @@ -148,9 +149,11 @@ export async function applyCoupon(context, params, _customQuery?: CustomQuery) {
}
}
}`

const payload = {
discountCode: couponCode,
checkoutId: currentCart.id
checkoutId: currentCart.id,
country: getCountry(context)
}

const { checkoutDiscountCodeApplyV2 } = context.extendQuery(
Expand Down
6 changes: 4 additions & 2 deletions packages/api-client/src/api/removeCartCoupon/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { CustomQuery } from '@vue-storefront/core';
import { gql } from '@apollo/client/core'
import { getCountry } from '../../helpers/utils'
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export async function removeCoupon(context, params, _customQuery?: CustomQuery) {
const { currentCart, couponCode, customQuery } = params;
const DEFAULT_MUTATION = gql`mutation REMOVE_COUPON($checkoutId: ID!){
const DEFAULT_MUTATION = gql`mutation REMOVE_COUPON($checkoutId: ID!, $country: CountryCode!) @inContext(country: $country ){
checkoutDiscountCodeRemove(checkoutId: $checkoutId) {
checkout {
appliedGiftCards{
Expand Down Expand Up @@ -150,7 +151,8 @@ export async function removeCoupon(context, params, _customQuery?: CustomQuery)
}
}`
const payload = {
checkoutId: currentCart.id
checkoutId: currentCart.id,
country: getCountry(context)
}

const { checkoutDiscountCodeRemove } = context.extendQuery(
Expand Down
1 change: 0 additions & 1 deletion packages/composables/src/useCart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const params: UseCartFactoryParams<Cart, CartItem, Product> = {
// check if cart is already initiated
const app = context.$shopify.config.app;
const appKey = app.$config.appKey;
const localeInfo = { cur: app.i18n.locale, default: app.i18n.localeProperties.alias};
let existingLocale = app.$cookies.get('cur-vsf-locale');
let isLocaleSwitched = false;
if (existingLocale === undefined || existingLocale === '' || existingLocale !== app.i18n.locale) {
Expand Down
3 changes: 0 additions & 3 deletions packages/composables/src/useForgotPassword/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ const factoryParams: UseForgotPasswordFactoryParams<any> = {
const response = await context.$shopify.api.customerRecover({
email
})

console.log(response)

return response
},
setNewPassword: async (context: Context, { tokenValue, newPassword, customQuery }) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/theme/lang/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,6 @@ export default {
'Out of Stock': 'Ausverkauft',
'You haven\'t searched for items yet': 'You haven\'t searched for items yet',
'Let\'s start now - we\'ll help you': 'Let\'s start now - we\'ll help you',
'on': 'on'
'on': 'on',
'Add to Cart': 'Añadir al carrito'
};
3 changes: 2 additions & 1 deletion packages/theme/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,6 @@ export default {
'November': 'November',
'December': 'December',
'Men Fashion': 'Men Fashion',
'Social': 'Social'
'Social': 'Social',
'Add to Cart': 'Add to Cart'
};
5 changes: 2 additions & 3 deletions packages/theme/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require('isomorphic-fetch');
import webpack from 'webpack';

/** @type { import('@nuxt/types').NuxtConfig } */
const platformENV = process.env.NODE_ENV !== 'production' ? 'http' : 'https'
const config = {
server: {
port: process.env.APP_PORT || 3001,
Expand All @@ -10,7 +9,7 @@ const config = {
publicRuntimeConfig: {
appKey: 'vsf2spcon',
appVersion: Date.now(),
middlewareUrl: process.env.NODE_ENV === 'production' ? `https://${process.env.BASE_URL}/api/`: `http://${process.env.BASE_URL}/api/`
middlewareUrl: `${platformENV}://${process.env.BASE_URL}/api/`
},
privateRuntimeConfig: {
storeURL: process.env.SHOPIFY_DOMAIN,
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/pages/Product.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
})
"
>
Add to Cart
{{ $t( 'Add to Cart') }}
</SfButton>
</template>
</SfAddToCart>
Expand Down
1,239 changes: 638 additions & 601 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 87e05df

Please sign in to comment.