Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] When creating a internal link in shopware the url is always '/' #1964

Open
1 task done
bitfactory-michel-lubbers opened this issue Nov 4, 2022 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@bitfactory-michel-lubbers

What happened?

When I create a category item with a internal link.
The link in the pwa that returns is always '/' when you use getCategoryUrl.

Steps To Reproduce

  1. Shopware 6 admin
  2. Go to Catalogs -> categories
  3. Create a category that belongs to one of these three entry points (Footer-, Main- or Service navigation)
  4. Choose Category 'type link'
  5. Choose Link type 'Internal'
  6. Choose a Entity (doesn't really matter which one)
  7. Go to the Front-end of the shopware-pwa and check the navigation for the link.

image
Screenshot 2022-11-04 at 14 13 24
Screenshot 2022-11-04 at 18 18 14

Is there an existing issue for this?

  • I have searched the existing issues

Version

Latest stable (generated by CLI)

Which element is affected?

No response

Environment

- OS: Docker
- Node: 16.18
- Shopware API: 6
- Shopware PWA version: 1.5.3

Relevant log output

// this code always returns '/' when ever you use a internal link
var getCategoryUrl = (category) => {
  if (!category)
    return "/";
  switch (category.type) {
    case "link":
      return getTranslatedProperty(category, "externalLink") || "/";
    case "folder":
      return "/";
    default:
      return category.seoUrls?.[0]?.seoPathInfo ? `/${category.seoUrls[0].seoPathInfo}` : category.id ? `/navigation/${category.id}` : "/";
  }
};
var isLinkCategory = (category) => category?.type === "link";
@bitfactory-michel-lubbers bitfactory-michel-lubbers added the bug Something isn't working label Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant