Prestashop get default customer group

Today we talk about PrestaShop get the default customer group. In this tutorial, we focus on how to get customer default groups. There are three default group options visitor group, guest group, and customer group. With the following code, you can get this information.

$visitor = (int)Configuration::get('PS_UNIDENTIFIED_GROUP', false, $this->id_shop_group, $this->id_shop); // get default visitor group
$guest = (int)Configuration::get('PS_GUEST_GROUP', false, $this->id_shop_group, $this->id_shop); // get default guest group
$customer = (int)Configuration::get('PS_CUSTOMER_GROUP', false, $this->id_shop_group, $this->id_shop); // get default customer group

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