How is a category's `tree_id` determined in BigCommerce? - bigcommerce

I observe that all categories have a tree_id of 1 when getting categories using the BigCommerce API. I was expecting that each top level categories and their children will have a different tree_id. How exactly is this category attribute being determined by BigCommerce? Thank you!

A store can have multiple, independent category trees which are useful when using multi-storefront. This allows you to have a distinct category navigation on different storefront websites.
https://developer.bigcommerce.com/api-reference/448cda022db6a-get-all-category-trees
By default, when using single-storefront, all categories are assigned to the first, default tree which exists when the store is created. It has an ID of 1.

Related

Design postgres table for entity where some columns differ and depend on category which that entity belongs

I'm developing product card entity (postgres). All cards have similar properties (like image, description, category, price etc.) but some props are absolutely different and depend on the category to which this product belong. These different properties will be used for filters inside each category.
As example there is category 'Car wheels' and all items in it have properties like weight, diameter and brand. And when I'm inside this category I want to filter by them. There is also category 'Clothes' all items have properties size and material and when I'm inside that category I need to filter by that props.
The question is how to design these properties and entity/schema itself? Use composite type where enumerate all possible options and make them optional or?

What is the best relational schema (or ERD) of dynamically nested objects?

I am trying to draw the table diagram of a product listing web application.
Application logic:
Admin user will create:
Categories (must be dynamically created by admin user),
Category's attributes (must be dynamically created by admin user),
Selection of Category attribute's options (must be dynamically created by admin user)
User will post a product under a specific category and must choose category attribute's option for each category attributes to successfully save the product.
Example: Admin creates category "food"
"food" has its attribute "meal_type" and "sugar".
"meal_type" has its options "breakfast", "lunch" and "dinner".
"sugar" has its options "with-sugar" and "non-sugar".
and now user can post his product "pizza" under category "food".
When user chosen "food" category, he must see its attributes "meal_type" and "suger"
and then must set those option values.
For example, "pizza"'s category is "food" and "meal_type"="breakfast", "sugar"="with-sugar".
And I want to call these option values together with product details when selecting these items.
I have made this (removed non-related fields)
but I am not sure this will work and be efficient at same time.
What is the most efficient relational schema (or ERD) for case like this?
I could help, but I don't really understand what exactly a user is supposed to do? Is he supposed to order products on the website? If so, maybe the naming of the tables should be different, eg "order_product" instead of "product"?
and as for the performance, at this stage and with this structure there should be no problems.

How to edit/create/delete relations / references [react-admin]

Given the demo category edit page as a reference
https://marmelab.com/react-admin-demo/#/categories/0
Is there a built-in way/guidelines to add/remove products from the category? i can't find any reference about in in the docs/example
No man, you should do it by yourself according your needs.
You can only create separate list with actions as shown in tutorial and edit it outside of category itself, as standalone table.
If u want to edit list of products which only belongs to concrete category, you should create your own component.
You may be need something like that example: https://codesandbox.io/s/rm4jy6n68o

How to work with map property in RQL (Oracle's ATG Web Commerce)

We use Oracle's ATG Web Commerce for our project. And currently we need construct RQL query which obtain products which SKU's tacticalTradeStatuses contains certain status and ordered by status value.
I briefly describe the relationship between entities: Product item descriptor contains list of SKUs. Each SKU contains map tacticalTradeStatuses (key - tactical trade status, value - sequense)
For example, how to obtain all products which SKU's tacticalTradeStatuses property contains key 'BEST_SELLER' and ordered by value associated with key 'BEST_SELLER'.
Key by which we want to select products we want to pass as RQL parameter.
i have two ways to doing that
1) first create a query which fetches all the product based on map key BEST_SELLER
2) Now pass it to foreach droplet and add sort properties. which help to sort the result based on your requirements
for sorting please refer to below link
http://docs.oracle.com/cd/E23095_01/Platform.93/PageDevGuide/html/s1316foreach01.html
2 way i think is to use query options in RQLStatement.. which work same as sort properties in for each
If you provide some XML Repository structure that will be good..hope it will help you

Ruby on Rails 3 - Modeling Products with Many Categories / Attributes

I am working on my first Rails website, a sort of shopping website: there are products sold through the website, each with multiple unique attributes.
The use case I am imagining is: a user visits the site looking to buy a used bed, they click through several higher categories until they find a bed of the correct size, something like this:
Furniture
---> Couch
---> Dresser
---> Bed
-------> Size
----------> King
----------> Queen
...
At each time the user clicks a more narrow category, they are supplied a menu with the next level of detail (a la NewEgg). When "Furniture" is clicked, all furniture is displayed, and a menu with the types of furniture appears. When "Bed" is clicked, all beds are displayed, and a menu showing the various attributes of a bed appears, etc.
So far, I have an "Item" parent class which contains all the attributes of every item sold through the website (price, description, etc...). I am stuck with what to do next.
My first instinct is to have subclasses, but they don't seem to be that useful. There is nothing about the "Furniture" subclass that would have anything new in it, other than definiting it to be furniture. Also, each parent class needs to know about its subclasses.
What sort of design pattern should I pursue to cleanly implement this model? I've been looking into nested sets, but I am not completely sure that's the way to go. Any guidance is appreciated.
Thanks!
Your categories clearly form a tree, which is probably why you're thinking about a class inheritance tree. However, you are correct that this isn't the right model, since subclasses do not add any functionality over their parents.
You should have a single "Item" class, which is a node in the category tree - with references to its parent category (another "Item", or null for the root) and its array of children (all "Item"s).
The correct place to store the information about the tree structure is the database. In your items table, add a "parent_id" column as a foreign key - to the items table.
As the user navigates down in the tree you show the subcategories by querying for the items whose parent_id equals the current item id.