Category Trees
Category Tree is the structure where categories/subcategories are created for the products to go on sale. Category tree in Omnitron is formed by the combination of two different structures: CategoryTree
and CategoryNode
.
Campaigns
On the Catalogs page Products and Catalogs > Catalogs, the detail page is entered through a catalog.
The pen icon that appears when the relevant category point is hovered with the cursor is clicked on. This opens the Category Edit form. Clicking on the Campaigns tab, and then the Add Campaign button, allows adding campaigns. After filling in the required information, the Save button at the bottom is clicked on. Campaigns added here are reflected on the page of the relevant sales category.
Large Image
On the Catalogs page Products and Catalogs > Catalogs, the detail page is entered through a catalog.
The pen icon that appears when the relevant category point is hovered with the cursor is clicked on. This opens the Category Edit form. The Large Image tab is clicked on for the addition of large images. After filling in the required information, the Save button at the bottom is clicked on. The Large Image added here is reflected on the page of the relevant sales category.
Small Image
On the Catalogs page (Products and Catalogs > Catalogs), the detail page is entered through a catalog.
The pen icon that appears when the relevant category point is hovered with the cursor is clicked on. This opens the Category Edit Form. The Small Image tab is clicked on for the addition of small images. After filling in the required information, the Save button at the bottom is clicked on. The Small Image added here is reflected on the page of the relevant sales category.
Explanation
On the Catalogs page Products and Catalogs > Catalogs, the detail page is entered through a catalog.
The pen icon that appears when the relevant category point is hovered with the cursor is clicked on. This opens up the Category Edit Form. The details about the relevant category are entered in the description field and the Save button at the bottom is clicked on. The description added here is reflected on the page of the relevant sales category.
Category Tree API Methods
GET
All Category Trees
GET
All Category TreesSample HTTP request to get all category trees lists from the system.
‘content_type’ header represents the response type.
The ‘Authorization’ header is required for authentication. You can retrieve api_token
by logging in.
Request
Path: /api/v1/category_tree/
Filters
All fields except the existing “category_root” can be used in the CategoryTree
model.
Response
POST
Create Category Tree
POST
Create Category TreeRecords new objects in the CategoryTree table. The CategoryTreeSerializer class defined at omnitron.catalogs.resources.serializers
is used to validate the data.
‘content_type’ header represents the response type.
The ‘Authorization’ header is required for authentication. You can retrieve api_token
by logging in.
Request
Path: /api/v1/category_tree/
If there is another category tree with the same name, a 400 response status code is returned.
Response
Information of the created CategoryTree
object is returned. The features are described above. The status code will be 201.
Incorrect Response Example
CategoryTree model has a name field and its property is unique=True, which means the category name field must be unique. Otherwise it will display an error as shown below.
PATCH
- PUT
Update Category Tree
PATCH
- PUT
Update Category TreeIf not found, it returns a 404 response status code.
If a record with an existing “name” is being attempted, this returns a 400 response status code.
Path: /api/v1/category_tree/{pk}/
Response
Incorrect Response Example
If an existing tree name is inserted during the update, it will again throw a unique error for the name field.
DELETE
Category Tree
DELETE
Category TreeIf the category tree is not found, it returns a 404 response status code.
If the category tree with provided ID is linked to a catalog or if there are products linked to the category tree, a 400 response status code will be returned.
Path: /api/v1/category_tree/{pk}/
Response
Incorrect Response Example
If the shop is still used by some catalog(s), the status code (406) is returned. This means Not Acceptable for deletion.
GET
Category Tree
GET
Category TreeTree returns the relevant category tree with its sub branches. If the category tree with provided ID is not available, it returns a 404 response status code.
Path: /api/v1/category_tree/{pk}/tree/
Response
GET
Category Tree Detail
GET
Category Tree DetailRetrieves detailed information about category_tree
. Shows details of sort option information and sorting algorithm information, as well as the associated child information in a list.
Returns the relevant category tree with its sub branches in a more detailed manner. If the category tree is not found, it returns a 404 response status code.
Request
Path: /api/v1/category_tree/{pk}/tree_detailed/
Response
Last updated
Was this helpful?