additions to product page

This commit is contained in:
2025-06-23 15:54:55 +02:00
parent 77a490a94d
commit 7d0a449a1e
13 changed files with 387 additions and 136 deletions

View File

@ -151,6 +151,28 @@ export const useMenuStore = defineStore("menuStore", () => {
}
};
function navigateToShop() {
navigateToItem(menuItems.value?.items.find(item => item.page_name === 'shop'))
}
// function redirectToPage(link_rewrite: string) {
// const page = menuItems.value?.items.find(
// (item) => item.link_rewrite === link_rewrite
// );
// if (!page?.id_page || !page?.link_rewrite) {
// console.warn(`Page not found or missing data for name: ${link_rewrite}`);
// return;
// }
// router.push({
// params: {
// id: page?.id_page,
// slug: page?.link_rewrite,
// },
// });
// }
const getFirstImage = () => {
const req = useRequestEvent();
const url = useRequestURL();
@ -210,24 +232,6 @@ export const useMenuStore = defineStore("menuStore", () => {
};
});
function redirectToPage(link_rewrite: string) {
const page = menuItems.value?.items.find(
(item) => item.link_rewrite === link_rewrite
);
if (!page?.id_page || !page?.link_rewrite) {
console.warn(`Page not found or missing data for name: ${link_rewrite}`);
return;
}
router.push({
params: {
id: page?.id_page,
slug: page?.link_rewrite,
},
});
}
watch($i18n.locale, async () => {
await loadMenu();
await loadFooter();
@ -247,13 +251,14 @@ export const useMenuStore = defineStore("menuStore", () => {
selectedCountry,
selectedCurrency,
selectedPhoneCountry,
defaultMenu,
headMeta,
navigateToShop,
loadMenu,
loadFooter,
getCountryList,
navigateToItem,
redirectToPage,
getCurrencies,
defaultMenu,
headMeta,
// redirectToPage,
getCurrencies
};
});