I am looking for help with adding some summary custom fields to categories which inherit values from their child posts. Its similar to ecommerce sites that will show filters on the left hand side with a range of available filters from the category of products you are in.
For example...
100 posts with custom field height_size as a number
then on the category display automatically combine data for any posts that are added to that category
average height_size
min height_size
max height_size
etc...
I've created a product that have multiple categories, but when I click on the product it shows the wrong category "Footcare" instead of "Handcare". What am I doing wrong?
Hello i want to create firebase database for groceries store. I have categories and under each category i have subcategories and some of these subcategories has sub-subcategories and under those there are products. how can i structure that in firebase database?
firebase structure
there i would suggest this way, may be it'll helpful.
as you can see above image, i have a category tree, following which consists of two child nodes which Category and ParentId. In your case i will suggest get all categories where parentId equal to Zero.
firebase.database().ref("Category").orderByChild("ParentId").equalTo(0);
which will return all Categories. then when you click a category query like below
firebase.database().ref("Category").orderByChild("ParentId").equalTo("Pass your Category Id here");
which will return all sub-categories based on the Category that you choosed.
In your case, you can add another child node like SubCategoryParentId for your subcategories which has subcategories and query like below
firebase.database().ref("Category").orderByChild("SubCategoryParentId").equalTo("Pass your Subcategory Id here");
which will return all subcategories for the subcategories you choosed.
How can I implement multiple group category filter using a widget?
Example Category Hierarchy:
Category1: Choicea1a and Choice2a
Category2: Choice1b and Choice2b
I want to display the two categories inside a select field containing their respective child categories. Is there an existing plugin for this?
Thanks!
How to display categories with views like this?
Category1
Subcategory1, Subcategory2, Subcategory3...
Category2
Subcategory1, Subcategory2, Subcategory3...
You can do this with help of views too, I have implemented this at my workplace if you need I will provide you the export of my view.
I am showing here, the complete scenario what I understood, with the main points what you required, to achieve the exact view:
- I have one Vocabulary named "Test"
- Test has two Parent categories, category 1 and category 2.
- Each category has subcategories: For example
Category 1
sub category 1
sub category 2
Category 2
sub category 3
sub category 4
Output you want to Display:
Category1
Subcategory1, Subcategory2, Subcategory3...
Category2
Subcategory1, Subcategory2, Subcategory3...
Steps to achieve desired view:
Create a view of Taxonomy Terms for vocabulary "Test"
Add Field "Term Name"
Create Relationship for Taxonomy Parent Term
Add Relation in added field "Term Name".
Add a global PHP field, where you will get parent term tid in $data variable.
Use a simple SELECT query to fetch subcategories using JOIN, tables you need are taxonomy_term_data and taxonomy_term_hierarchy.
show all the subcategories separated by ',' or any other desired separator.
Lastly you need to group by with added field name "Term Name".
After doing all these steps, you will definitely get the desired view result.
Hope this will help you, if you found any issue, free feel to reply.
I can also provide you the export of my view, if you required.