Hi. I was given this code to work on my Front End..
import wixData from 'wix-data';
import wixLocationFrontend from 'wix-location-frontend';
wixLocationFrontend.onChange(getFullProductData);
$w.onReady(function () {
getFullProductData();
});
async function getFullProductData() {
const currentProduct = await $w("#productPage1").getProduct();
console.log(currentProduct);
try {
const { items } = await wixData.query('Stores/Products').eq('_id',currentProduct._id).include('collections').find();
const fullProduct = items[0];
console.log(fullProduct);
}
catch (err){ console.error( err);
return [];
}
}
Now Firstly I am getting the error
Error: WDE0080: {"message":"Endpoint belongs to CATALOG_V1, but your site is using CATALOG_V3. Read more about catalog versioning: https://dev.wix.com/docs/rest/business-solutions/stores/catalog-versioning/introduction","details":{"applicationError":{"code":"CATALOG_V3_CALLING_CATALOG_V1_API"}}}
Which totally confuses me..
Also it seems to have trouble with the
import wixLocationFrontend from 'wix-location-frontend';
Sometimes accepting it, or saying it cannot find wix-location-frontend and to check the package manager.
If anyone can offer some advice I would be very grateful..
Sincerely
Dave