I am unable to understand the concept of having category_path table in opencart. Can any opencart expert here explain with a scenario/example?
The category_path
table stores data relating to the category hierarchy. For instance, suppose you have top level category "Shoes" with category_id 7. "Shoes" has a sub category called "Gators" with category_id 11. In the admin panel you would see something like:
Shoes > Gators
The category_path
table would have rows like:
+-------------+---------+-------+
| category_id | path_id | level |
+-------------+---------+-------+
| 11 | 7 | 0 |
| 11 | 11 | 1 |
+-------------+---------+-------+
The row where the path_id is equal to the category_id tells you how many levels deep the category is. The other rows show it's parents and their respective level.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With