-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
230 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 5 additions & 11 deletions
16
packages/commercetools/composables/src/helpers/internals/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
import enhanceProduct from './enhanceProduct'; | ||
import mapPaginationParams from './mapPaginationParams'; | ||
import getFiltersFromProductsAttributes from './getFiltersFromProductsAttributes'; | ||
import getCouponsFromCart from './getCouponsFromCart'; | ||
|
||
export { | ||
enhanceProduct, | ||
mapPaginationParams, | ||
getFiltersFromProductsAttributes, | ||
getCouponsFromCart | ||
}; | ||
export { default as enhanceProduct } from './enhanceProduct'; | ||
export { default as mapPaginationParams } from './mapPaginationParams'; | ||
export { default as getFiltersFromProductsAttributes } from './getFiltersFromProductsAttributes'; | ||
export { default as getCouponsFromCart } from './getCouponsFromCart'; | ||
export { default as makeId } from './makeId'; |
9 changes: 9 additions & 0 deletions
9
packages/commercetools/composables/src/helpers/internals/makeId.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default length => { | ||
let result = ''; | ||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; | ||
const charactersLength = characters.length; | ||
for (let i = 0; i < length; i++) { | ||
result += characters.charAt(Math.floor(Math.random() * charactersLength)); | ||
} | ||
return result; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
packages/commercetools/theme/components/Checkout/ShippingPriceInfo.vue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
packages/commercetools/theme/helpers/Checkout/getShippingMethodPrice.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
import { ShippingMethod } from '@vue-storefront/commercetools-api'; | ||
|
||
export default (shippingMethod: ShippingMethod) => shippingMethod.zoneRates[0].shippingRates[0].price.centAmount / 100; | ||
export default (shippingMethod: ShippingMethod, total: number) => { | ||
const centAmount = shippingMethod?.zoneRates[0].shippingRates[0].freeAbove?.centAmount; | ||
if (centAmount && total >= (centAmount / 100)) { | ||
return 0; | ||
} | ||
return shippingMethod.zoneRates[0].shippingRates[0].price.centAmount / 100; | ||
}; |
Oops, something went wrong.