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

Support for nested categories #8

Closed
pkarw opened this issue Sep 26, 2017 · 11 comments
Closed

Support for nested categories #8

pkarw opened this issue Sep 26, 2017 · 11 comments
Assignees
Labels
good first issue Tasks that requires just basic understanding of Vue Storefront

Comments

@pkarw
Copy link
Collaborator

pkarw commented Sep 26, 2017

How do we support nested categories in navigation? Right now it's not supported (/src/themes/default/components/core/blocks/SidebarMenu/SidebarMenu.vue:16 need to be changed) - the categories object already consist of hierarchical data:

{  
  "_index":"vue_storefront_catalog",
  "_type":"category",
  "_id":"29",
  "_version":1,
  "_score":1,
  "_source":{  
    "id":29,
    "parent_id":2,
    "name":"Promotions",
    "is_active":false,
    "position":6,
    "level":2,
    "product_count":0,
    "children_data":[  
      {  
        "id":30,
        "parent_id":29,
        "name":"Women Sale",
        "is_active":true,
        "position":1,
        "level":3,
        "product_count":224,
        "children_data":[  

        ]
      },
      {  
        "id":31,
        "parent_id":29,
        "name":"Men Sale",
        "is_active":true,
        "position":2,
        "level":3,
        "product_count":39,
        "children_data":[  

        ]
      },
      {  
        "id":32,
        "parent_id":29,
        "name":"Pants",
        "is_active":true,
        "position":3,
        "level":3,
        "product_count":247,
        "children_data":[  

        ]
      },
      {  
        "id":33,
        "parent_id":29,
        "name":"Tees",
        "is_active":true,
        "position":4,
        "level":3,
        "product_count":192,
        "children_data":[  

        ]
      }
    ],
    "tsk":1505573191094
  }
}

@pkarw
Copy link
Collaborator Author

pkarw commented Sep 26, 2017

@filrak it seems it need to be styled on the frontend - could you do that? And then we need to change /vue-storefront/src/store/modules/catalog.js:61 (loadCategories method) to:

 return new Promise((resolve, reject) => {
      client.search({
        index: config.elasticsearch.index, // TODO: add grouped prodduct and bundled product support
        type: 'category',
        q: qr,
        '_sourceInclude': ['name', 'position', 'id', 'parent_id', **'children_data'**]

      }).then(function (resp) {
        commit(types.CATALOG_UPD_CATEGORIES, resp)
        resolve(resp)
      }).catch(function (err) {
        reject(err)
      })
    })

and

    let qr = 'level: 2'

@pkarw
Copy link
Collaborator Author

pkarw commented Sep 26, 2017

  • add is_active = true to filter @pkarw

@filrak
Copy link
Collaborator

filrak commented Sep 26, 2017

@pkarw of course i will ;) As far as i remember Karol said that current graphics are as simple as possible. That's the reason why there are no nested categories yet but they should be implemented later and according to what you wrote

@pkarw
Copy link
Collaborator Author

pkarw commented Sep 27, 2017

So right now we should display only the 1. level and thats all? @filrak @karolbzik

@filrak
Copy link
Collaborator

filrak commented Sep 30, 2017

@pkarw according to design and what @karolbzik said - yup

@pkarw
Copy link
Collaborator Author

pkarw commented Oct 6, 2017

Added to the sidebar but with some minor issue to be fixed (#42). @filrak @karolbzik we need some design idea for this - how to present the subs?

Right now it's quite awkward
zrzut ekranu 2017-10-06 09 02 29
:

@pkarw pkarw assigned karolbzik and filrak and unassigned pkarw and filrak Oct 6, 2017
@karolbzik
Copy link
Collaborator

#54

@karolbzik karolbzik removed their assignment Oct 10, 2017
@karolbzik karolbzik added this to the To Be Planned milestone Oct 30, 2017
@karolbzik karolbzik added enhancement good first issue Tasks that requires just basic understanding of Vue Storefront labels Oct 30, 2017
@karolbzik karolbzik assigned karolbzik and unassigned filrak Oct 30, 2017
@karolbzik
Copy link
Collaborator

vue storefront - sidebar menu

vue storefront - sidebar menu with nested categories

sidebar menu my account on mobile

sidebar menu on mobile

@karolbzik karolbzik assigned pkarw and unassigned karolbzik Dec 13, 2017
@pkarw
Copy link
Collaborator Author

pkarw commented Dec 14, 2017

Related to: #391

@pkarw pkarw modified the milestones: To Be Planned, 0.4.0 Customer's dashboard Dec 14, 2017
@pkarw pkarw assigned filrak and unassigned pkarw Dec 14, 2017
@pkarw
Copy link
Collaborator Author

pkarw commented Dec 14, 2017

@filrak you should take care of this one as it's kind of core change to the navigation

@mercs600 mercs600 self-assigned this Dec 29, 2017
mercs600 added a commit to mercs600/vue-storefront that referenced this issue Jan 6, 2018
pkarw added a commit that referenced this issue Jan 8, 2018
[#8] Add nested categories support
@pkarw
Copy link
Collaborator Author

pkarw commented Jan 8, 2018

Marvelous job @mercs600!

@pkarw pkarw closed this as completed Jan 8, 2018
pkarw pushed a commit that referenced this issue Jun 11, 2019
sethidden pushed a commit that referenced this issue Apr 5, 2024
* feat: add api-extractor-config

* fix: use correct main

* fix: use correct main

* feat: add common tsconfig

* chore: change structure of tsconfig

* feat: add api-extractor-config

* fix: use module exports
sethidden pushed a commit that referenced this issue Apr 5, 2024
* feat: add api-extractor-config

* fix: use correct main

* fix: use correct main

* feat: add common tsconfig

* chore: change structure of tsconfig

* feat: add api-extractor-config

* fix: use module exports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Tasks that requires just basic understanding of Vue Storefront
Projects
None yet
Development

No branches or pull requests

4 participants