chinhnc
AAlokai
•Created by chinhnc on 1/2/2025 in #🙋|general-help
How to work extension api for VSF (magento)
I was added extension on middleware.config.js like:
integrations: {
magento: {
location: '@vue-storefront/magento-api/server',
extensions: (extensions) => [
...extensions,
{
name: 'extension-name',
extendApiMethods: {
customMethod: async (context, params) => {
const response = await context.client.mutate({
mutation: gql${CUSTOMER_METHOD},
variables,
fetchPolicy: 'no-cache',
context: {
req: context.req,
res: context.res
}
});
}
}
}
],
},
},
then I was called the customMethod on .vue file, like:
import { useVSFContext, onSSR } from '@vue-storefront/core';
xport default {
setup() {
const { $magento} = useVSFContext();
onSSR(async () => {
await $magento.api.customMethod({
query: 'test',
limit: 20
})
});
}
}
customMethod already working when I call endpoint api.
But when I console.log($magento), the $magento is undefined.
I don't know why the $magento is undefined.2 replies
AAlokai
•Created by chinhnc on 12/18/2024 in #🙋|general-help
stock_status & only_x_left_in_stock cannot query field ( Magento 2 disabled MSI )
1 replies
AAlokai
•Created by chinhnc on 11/30/2023 in #🙋|general-help
When I reload the checkout page it automatically redirects to the home page.
When I reload the checkout page it automatically redirects to the home page. How to come when I reload the page it's still on the checkout page in VSF ?
7 replies
AAlokai
•Created by chinhnc on 9/21/2023 in #🙋|general-help
Can't load product detail in VFS when open multiple tab on browser
Hello everyone! The current project I'm working on is deployed on the client side with vuestore font from the repo . I post encountered a problem that took me a lot of time. This problem appears when I open multiple tabs on the browser with vuestore font. I really need support
1 replies