Jump to content

SQL query subcategries


Recommended Posts

Hello,

I need to use Prestashop SQL interface with SQL query and obtain a list of all products with category and subcategories , like in this sample:

product1,price1,name1,category>subcategory

product2,price2,name2,category

product3,price3,name3,category>subcategory>subsubcategory

...

 

For each product I need full path categories,delimited with character >.

It is possible with SQL query?

 

Thank you,

Link to comment
Share on other sites

Why don't you make a simple PHP script?

 

In pseudo code it would look something like:

 - select all products and their default category from database

 - foreach product

   { while (category-depth > 1)

     { get parent category

       category = its parent

     }

  }

Link to comment
Share on other sites

×
×
  • Create New...