additions to product page
This commit is contained in:
@ -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
|
||||
};
|
||||
});
|
||||
|
Reference in New Issue
Block a user