vuestorefront / shopware-pwa

Shopware PWA for eCommerce. Headless storefront solution for Shopware 6, which communicates through the SalesChannel-API. Always Open Source, MIT license. Made with :blue_heart: by shopware AG & Vue Storefront.
https://frontends.shopware.com
MIT License
345 stars 103 forks source link

Can't fetch products [BUG] #360

Closed rain-manek closed 4 years ago

rain-manek commented 4 years ago

Hi! Describe the bug I'm trying out shopware-pwa with Shopware 6 !

Shopware is running correctly in docker. Shopware-pwa is running correctly when I'm using demo backend but when I switch to local backend then the only working endpoint is /navigation which setups my navbar correctly.

When home page loads I get 404 saying: Problem with fetching CMS data Request failed with status code 404 What I see is: image

When I click on any navigation item, there is reqeust made to the backend /page endpoint with path sent. But I get 404: image

Expected behavior Getting it work like with demo backend.

Actual behavior As shown on screenshots.

mkucmus commented 4 years ago

@pawelkarauda to have a given path handled by page resolver, these things need to happen:

  1. the category should be visible and assign to the "storefront" sales channel (it's not handled for headless type yet)
  2. the plugin with page resolver should be installed and enabled (I guess you had it)
  3. the seo_path index should be rebuilt with command dal:refresh:index (manually in shopware CLI or another way)

page resolver look for given path (your case is "beauty/") in the seo_path_url table. Entries in this table are related to the "storefront" sales channel's type which describes the slugs' format.

I hope it will help

rain-manek commented 4 years ago

Hi, thanks! Routing started to work!

So when I hit any navigation link I'm able to see products. Showing single product also works.

New issues: Home site doesn't work yet. At least it is showing empty page. What should I do to show template?

I can add it to the cart and I can see that request is made but I don't really know what it saves because I'm not logged in. After website reload it is no longer in cart.

But without reloading the product is in the cart, and when I open cart and click on "Go to Checkout" button it does nothing.

I also noticed that I'm not able to register because I receive an error like this: image

Is it the case that this repo is still during development or am I doing something incorectly?

mkucmus commented 4 years ago

Great news @pawelkarauda, in regards to page resolver issue.

regarding the second problem, please open an issue and fill all required sections, but for now I can tell you that we do know the problem with "losing a session for SSR" :+1: nevertheless the issue will help us better understand the problem.

the problem with registration depending on "hardcoded" salutationId which isn't able to be selected on the register screen. You can grab it from the Shopware instance settings in the admin panel. Select the salutation you want, discover the id and use it on the frontend (@krskibin can describe where to put it) It's a temporary workaround.

@rmakara, @krskibin - as we can see, picking up the salutation (Mr, Mrs, other) is a really important feature. Shall we start doing it?

thanks again for checking the app :+1:

mkucmus commented 4 years ago

Home site doesn't work yet. At least it is showing empty page. What should I do to show template?

you can set the right template (chosen in Shopping Experiences) and assign it to the Root Category which is set as entry point in sales channel settings.

page resolver which recognizes the paths, uses the "/" for the root category, being on the top of the navigation.

Rigo-m commented 4 years ago

I am in the same situation, I still can't see the homepage, I maybe didn't properly understand how to assign the right template in shopping experiences.

patzick commented 4 years ago

Closing this issue as troubleshooting https://github.com/DivanteLtd/shopware-pwa/blob/master/TROUBLESHOOTING.md describes the solution.

@CthulhuDev please let us know if you have problems and troubleshooting won't help you.