Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Change category list to subcategories

Krzysztof Białogłowicz4606076d45c2
diff --git a/saleor/static/js/components/CategoryFilter.js b/saleor/static/js/components/CategoryFilter.js
index ec952265f2..9cfb6cb190 100644
--- a/saleor/static/js/components/CategoryFilter.js
+++ b/saleor/static/js/components/CategoryFilter.js
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
+import AttributeInput from './AttributeInput';
export default class CategoryFilter extends Component {
@@ -16,11 +17,15 @@ export default class CategoryFilter extends Component {
<a href={category.url}><strong>{category.name}</strong></a>
<span>{category.productsCount}</span>
</li>
- {category.siblings && (category.siblings.map((sibling) => {
+ {category.children && (category.children.map((child) => {
return (
- <li key={sibling.pk} className="item">
- <a href={sibling.url}>{sibling.name}</a>
- <span>{sibling.productsCount}</span>
+ <li key={child.pk} className="item">
+ <input
+ name={child.slug}
+ type="checkbox"
+ value={child.slug}
+ />
+ {child.name}
</li>
);
}))}
diff --git a/saleor/static/js/components/CategoryPage.js b/saleor/static/js/components/CategoryPage.js
index b657b8111f..e388391788 100644
--- a/saleor/static/js/components/CategoryPage.js
+++ b/saleor/static/js/components/CategoryPage.js
@@ -164,11 +164,12 @@ export default Relay.createContainer(CategoryPage, {
name
url
productsCount
- siblings {
+ children {
name
pk
url
productsCount
+ slug
}
products (first: $count, attributes: $attributesFilter, priceGte: $minPrice, priceLte: $maxPrice) {
${ProductList.getFragment('products')}
diff --git a/saleor/static/scss/demo/components/_category-page.scss b/saleor/static/scss/demo/components/_category-page.scss
index 364d39fff0..35491e951c 100644
--- a/saleor/static/scss/demo/components/_category-page.scss
+++ b/saleor/static/scss/demo/components/_category-page.scss
@@ -41,18 +41,13 @@
}
.categories {
ul {
- list-style: circle;
- padding-left: $global-padding;
+ list-style: none;
li {
a {
font-size: 1.2rem;
color: $body-color;
padding-right: $global-padding/2;
}
- span {
- color: $gray;
- font-size: 1.1rem;
- }
}
}
}