PrestaShop get current category information

Today we talk about how PrestaShop get current category information. You can use this code in hook related to the category page or controller and any other class. In this example, it will be shown the category name and category description, and other information. So let’s start with our example.

$categoryId = (int)Tools::getValue('id_category'); // get current category id
$categoryData = new Category ($categoryId,Context::getContext()->language->id); // get category object with id
$name    = $categoryData->name; // get category name
$description    = $categoryData->description; // get category description

Qaisar Satti

Hi, I'm Qaisar Satti! I've been a developer for over 20 years, and now I love sharing what I've learned through tutorials and guides. Whether you're working with Magento, PrestaShop, or WooCommerce, my goal is to make your development journey a bit easier and more fun. When I'm not coding or writing, you can find me exploring new tech trends and hanging out with the amazing developer community. Thanks for stopping by, and happy coding!

Recent Blogs

Categories