Products does not shows under "Everything new" section

Hello,

I made a production implementation (local implementation) in order to test Vuestorefront, but the products shows only in side menu, but not under “Everything new” section.

Please Help.

Thanks.
RP.

Hello :slight_smile:
In 1.11:
You need to fetch products in Home page component. There should be triggered dispatch store.dispatch('homepage/fetchNewCollection') and after that you gonna have products in store which can be accessed with getter['homepage/getEverythingNewCollection']

In 1.10:
Here it’s the same as in 1.11, but it’s done directly in component.

  • create query
    let newProductsQuery = prepareQuery({ queryConfig: 'newProducts' })
  • make search
    const newProductsResult = await store.dispatch('product/list', {
      query: newProductsQuery,
      size: 8,
      sort: 'created_at:desc'
    })
  • if there is result put it in store
    if (newProductsResult) {
      store.state.homepage.new_collection = newProductsResult.items
    }

If you are missing those products then check if request returns any products. Or if there is any error.

I have both, store.dispatch(‘homepage/fetchNewCollection’) and getter[‘homepage/getEverythingNewCollection’] in home.vue file but nothing appears on home screen. Do I need to add aditional category in products on MAGENTO??.

This is the code for home.vue https://www.dropbox.com/s/qd0p6lywltwux2b/Home.vue?dl=0

Thanks,

Raul.

    isLazyHydrateEnabled () {
      return config.ssr.lazyHydrateFor.some(
        field => ['homepage', 'homepage.new_collection'].includes(field)
      )
    }

Is this true? Do you have ‘homepage’ or ‘homepage.new_collection’ in config.ssr.lazyHydrateFor?

Check in if there are products:

mounted () {
console.log(this.getEverythingNewCollection)
}

Thanks. We already Did It.