• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

How to Customize Product and Category URL Routes in Bagisto?

General Discussion
3
4
159
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O
    olivexy last edited by 4 Feb 2025, 20:47

    Hello Bagisto Community,

    I’m working on a Bagisto 2.2 project and need to modify the default URL structure for products and categories. Currently, the URLs are structured as:

    Products: domain.com/{product-slug}

    Categories: domain.com/{category-slug}

    Goal:
    I’d like to restructure them to:

    • Products: domain.com/{category-slug}/products/{product-slug}

    • list itemCategories: domain.com/category/{category-slug}

    Is there a built-in way to customize product/category routes in Bagisto?

    How can I ensure breadcrumbs reflect the new URL hierarchy (Home > Category > Product)?

    Any guidance, code snippets, or references to existing modules would be greatly appreciated!

    Environment:

    Bagisto 2.2.0

    PHP 8.1

    MySQL 8.0

    Thank you!

    1 Reply Last reply Reply Quote 0
    • Rishabh-Webkul
      Rishabh-Webkul last edited by 11 Feb 2025, 06:44

      Hello @olivexy

      You can manage this from routes currently we are managing with the ID if you want you can add the global parameter slug and pass that into the route and controller accordingly.

      File path for Category Admin

      packages >> Webkul >> Admin >> src >> Routes >> catalog-routes.php

      packages >> Webkul >> Admin >> src >> Http >> Controllers >> Catalog >> CategoryController.php

      categoryroute.png

      contr.png

      Product Controller File Path

      packages >> Webkul >> Admin >> src >> Http >> Controllers >> Catalog >> ProductController.php

      productController.png

      Thanks & Regards

      L O 2 Replies Last reply 13 Feb 2025, 22:25 Reply Quote 0
      • L
        laravel_dev @Rishabh-Webkul last edited by 11 Feb 2025, 13:01

        @Rishabh-Webkul said in How to Customize Product and Category URL Routes in Bagisto?:

        You can manage this from routes currently we are managing with the ID if you want you can add the global parameter slug and pass that into the route and controller accordingly.

        your awnser for admin routes? i think question about store routes. not admin routes.

        1 Reply Last reply Reply Quote 1
        • O
          olivexy @Rishabh-Webkul last edited by 13 Feb 2025, 22:25

          @Rishabh-Webkul this going to be reflected in the frontend?

          1 Reply Last reply Reply Quote 0
          3 out of 4
          • First post
            3/4
            Last post