Was given code snipped and getting V1 to V3 error.. Help!

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

You are using the Code for catalog V1. Wix has updated the catalog to V3 for new store(with more features and flexibility). You should use the Wix SDK for V3 instead.

I am sorry.. I have been looking at the V3 documentation re implementing it..

I need concrete examples of how it interfaces with the front end.

The examples all use ‘curl’ which I don’t really understand..

If there was a working V3 front end I can try and understand it..

Many many thanks.
Dave