:::: MENU ::::
Monthly Archives: February 2021

PrestaShop change the store contact information

Today we talk about how to change store contact information like email, name, phone, city, country, state, phone number, and other information. You can edit the following information by following these steps.

Step 1:

Login to the back office to access the back office.

Step 2:

To change information Shop Parameters -> Contact and click on Stores. You can see the following form.
store contact information

Author: Qaisar Satti
Category: Prestashop
Last Modified: February 23, 2021


PrestaShop get all customer group

Today we talk about PrestaShop to get current user information. In this tutorial, we focus on how to get customer information. Grou name, group id, and other customer group related information.

You can get the context variable by following.

       $groups = Group::getGroups(Context::getContext()->language->id);
       foreach ($groups as $group) {
            $idGroup = $group['id_group']; // get group id
            $groupName = $group['name']; // get group name
        }
Author: Qaisar Satti
Category: Prestashop
Last Modified: February 23, 2021


WooCommerce get current user role

Today we talk about WooCommerce or WordPress get the current user role. In this tutorial, We focus on getting the current user group for example you need to match or check what is current user role. On the basis of that need to give a discount or show some extra text.

Let’s start with our example.

// get Current User Role
$currentUser      = wp_get_current_user();
$currentUserRole = $currentUser->roles[0];
Author: Qaisar Satti
Last Modified: February 23, 2021


WooCommerce get previous URL

Today we talk about WooCommerce or WordPress get the previous URL or referrer URL. In this tutorial, We focus on getting the previous URL for example you need to match or check what was the previous URL. Sometimes you need to perform the action according to the user’s previous page.

Let’s start with our example.

$previousUrl = esc_url(wp_get_referer());
Author: Qaisar Satti
Last Modified: February 23, 2021


WooCommerce get current url

Today we talk about WooCommerce or WordPress get the current URL. In this tutorial, We focus on getting the current URL for example you need to match or check what is current URL of the category Url or product URL or any other page URL.

Let’s start with our example.

$currentUrl = home_url($_SERVER['REQUEST_URI']);
Author: Qaisar Satti
Last Modified: June 2, 2021


PrestaShop get current user group

Today we talk about PrestaShop get current user group. In this tutorial, we focus on how to get a customer user group. Sometimes we need user groups to perform some actions. So let’s start with an example. This tutorial will only give the default group of the customer.

 $groupId = Group::getCurrent()->id;
Author: Qaisar Satti
Category: Prestashop
Last Modified: February 23, 2021


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
Author: Qaisar Satti
Category: Prestashop
Last Modified: February 23, 2021