-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TQLG-392: preselected-shipping-cost #107
base: main
Are you sure you want to change the base?
Conversation
@@ -1,4 +1,5 @@ | |||
<script setup lang="ts"> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we can delete this line, or? but not that important for me haha
@@ -0,0 +1,27 @@ | |||
import type { Schemas } from '@shopware/api-client/api-types'; | |||
import { useCart, useCheckout } from "#build/imports"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { useCart, useCheckout } from "#build/imports"; |
I dont think we need these imports, since we are not in the module
); | ||
const { preselectShippingMethod } = useShippingMethod(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
); | |
const { preselectShippingMethod } = useShippingMethod(); | |
); | |
const { preselectShippingMethod } = useShippingMethod(); |
import { useCart, useCheckout } from "#build/imports"; | ||
|
||
export function useShippingMethod() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
export function useShippingMethod() { | ||
|
||
const preselectShippingMethod = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to rename this function to "preselectShippingMethodFallback", since it serves as the fallback in case the usual preselected one is not available (and doesnt include the actual logic for the preselection in the non fallback case)
Preselect the cheapest shipping method available if the one set initially on the cart( from previous orders for eg.) is not available anymore.